From 5512d6cbeb70c5cc8dcb112fc39b3b11c70d17b0 Mon Sep 17 00:00:00 2001 From: Milosz Lagan Date: Fri, 20 Dec 2024 13:50:26 +0000 Subject: [PATCH] Reduce verbosity of some nodes --- .../launch/controller.launch.py | 37 ++++++++++++++++--- .../launch/simulate_robot.launch.py | 5 --- lynx_description/launch/load_urdf.launch.py | 9 ----- .../launch/load_urdf.launch.py | 10 ----- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/husarion_ugv_controller/launch/controller.launch.py b/husarion_ugv_controller/launch/controller.launch.py index 92597bcf3..a09b1a9c0 100644 --- a/husarion_ugv_controller/launch/controller.launch.py +++ b/husarion_ugv_controller/launch/controller.launch.py @@ -218,6 +218,25 @@ def generate_launch_description(): ) robot_description = {"robot_description": robot_description_content} + joint_state_broadcaster_log_level = PythonExpression( + [ + "'", + namespace, + "' + '.joint_state_broadcaster:=INFO' if '", + namespace, + "' else 'joint_state_broadcaster:=INFO'", + ] + ) + controller_manager_log_level = PythonExpression( + [ + "'", + namespace, + "' + '.controller_manager:=INFO' if '", + namespace, + "' else 'controller_manager:=INFO'", + ] + ) + control_node = Node( package="controller_manager", executable="ros2_control_node", @@ -246,6 +265,19 @@ def generate_launch_description(): "_joint_state_broadcaster/transition_event", ), ], + arguments=[ + "--ros-args", + "--log-level", + log_level, + "--log-level", + "rcl:=INFO", + "--log-level", + "pluginlib.ClassLoader:=INFO", + "--log-level", + joint_state_broadcaster_log_level, + "--log-level", + controller_manager_log_level, + ], condition=UnlessCondition(use_sim), emulate_tty=True, ) @@ -289,11 +321,6 @@ def generate_launch_description(): "controller_manager", "--controller-manager-timeout", "10", - "--ros-args", - "--log-level", - log_level, - "--log-level", - "rcl:=INFO", ], namespace=namespace, emulate_tty=True, diff --git a/husarion_ugv_gazebo/launch/simulate_robot.launch.py b/husarion_ugv_gazebo/launch/simulate_robot.launch.py index 0cf1373d2..18312ac52 100644 --- a/husarion_ugv_gazebo/launch/simulate_robot.launch.py +++ b/husarion_ugv_gazebo/launch/simulate_robot.launch.py @@ -239,11 +239,6 @@ def generate_launch_description(): "world", "--child-frame-id", child_tf, - "--ros-args", - "--log-level", - log_level, - "--log-level", - "rcl:=INFO", ], namespace=namespace, emulate_tty=True, diff --git a/lynx_description/launch/load_urdf.launch.py b/lynx_description/launch/load_urdf.launch.py index 98787dcc6..cc3e6dbfc 100644 --- a/lynx_description/launch/load_urdf.launch.py +++ b/lynx_description/launch/load_urdf.launch.py @@ -84,13 +84,6 @@ def generate_launch_description(): ), ) - log_level = LaunchConfiguration("log_level") - declare_log_level_arg = DeclareLaunchArgument( - "log_level", - default_value="info", - description="Logging level", - ) - namespace = LaunchConfiguration("namespace") declare_namespace_arg = DeclareLaunchArgument( "namespace", @@ -184,7 +177,6 @@ def generate_launch_description(): package="joint_state_publisher", executable="joint_state_publisher", namespace=namespace, - arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, condition=IfCondition(add_wheel_joints), ) @@ -195,7 +187,6 @@ def generate_launch_description(): declare_components_config_path_arg, declare_wheel_type_arg, # wheel_type is used by controller_config_path declare_controller_config_path_arg, - declare_log_level_arg, declare_namespace_arg, declare_use_sim_arg, declare_wheel_config_path_arg, diff --git a/panther_description/launch/load_urdf.launch.py b/panther_description/launch/load_urdf.launch.py index 5b4e40aa9..1297f7c10 100644 --- a/panther_description/launch/load_urdf.launch.py +++ b/panther_description/launch/load_urdf.launch.py @@ -83,13 +83,6 @@ def generate_launch_description(): ), ) - log_level = LaunchConfiguration("log_level") - declare_log_level_arg = DeclareLaunchArgument( - "log_level", - default_value="info", - description="Logging level", - ) - namespace = LaunchConfiguration("namespace") declare_namespace_arg = DeclareLaunchArgument( "namespace", @@ -176,7 +169,6 @@ def generate_launch_description(): {"frame_prefix": namespace_ext}, ], namespace=namespace, - arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, ) @@ -184,7 +176,6 @@ def generate_launch_description(): package="joint_state_publisher", executable="joint_state_publisher", namespace=namespace, - arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, condition=IfCondition(add_wheel_joints), ) @@ -195,7 +186,6 @@ def generate_launch_description(): declare_components_config_path_arg, declare_wheel_type_arg, # wheel_type is used by controller_config_path declare_controller_config_path_arg, - declare_log_level_arg, declare_namespace_arg, declare_use_sim_arg, declare_wheel_config_path_arg,