diff --git a/husarion_ugv_battery/launch/battery.launch.py b/husarion_ugv_battery/launch/battery.launch.py index d8327e332..6e7c1e32c 100644 --- a/husarion_ugv_battery/launch/battery.launch.py +++ b/husarion_ugv_battery/launch/battery.launch.py @@ -21,6 +21,13 @@ 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", @@ -34,10 +41,12 @@ def generate_launch_description(): name="battery_driver", namespace=namespace, remappings=[("/diagnostics", "diagnostics")], + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, ) actions = [ + declare_log_level_arg, declare_namespace_arg, battery_driver_node, ] diff --git a/husarion_ugv_bringup/launch/bringup.launch.py b/husarion_ugv_bringup/launch/bringup.launch.py index 824112ebf..e5bb6ac8c 100644 --- a/husarion_ugv_bringup/launch/bringup.launch.py +++ b/husarion_ugv_bringup/launch/bringup.launch.py @@ -44,6 +44,13 @@ def generate_launch_description(): choices=["True", "true", "False", "false"], ) + 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", @@ -62,7 +69,11 @@ def generate_launch_description(): [FindPackageShare("husarion_ugv_controller"), "launch", "controller.launch.py"] ) ), - launch_arguments={"namespace": namespace, "common_dir_path": common_dir_path}.items(), + launch_arguments={ + "log_level": log_level, + "namespace": namespace, + "common_dir_path": common_dir_path, + }.items(), ) system_monitor_launch = IncludeLaunchDescription( @@ -75,7 +86,7 @@ def generate_launch_description(): ] ), ), - launch_arguments={"namespace": namespace}.items(), + launch_arguments={"log_level": log_level, "namespace": namespace}.items(), ) lights_launch = IncludeLaunchDescription( @@ -84,7 +95,11 @@ def generate_launch_description(): [FindPackageShare("husarion_ugv_lights"), "launch", "lights.launch.py"] ) ), - launch_arguments={"namespace": namespace, "common_dir_path": common_dir_path}.items(), + launch_arguments={ + "log_level": log_level, + "namespace": namespace, + "common_dir_path": common_dir_path, + }.items(), ) battery_launch = IncludeLaunchDescription( @@ -93,7 +108,7 @@ def generate_launch_description(): [FindPackageShare("husarion_ugv_battery"), "launch", "battery.launch.py"] ), ), - launch_arguments={"namespace": namespace}.items(), + launch_arguments={"log_level": log_level, "namespace": namespace}.items(), ) ekf_launch = IncludeLaunchDescription( @@ -102,7 +117,11 @@ def generate_launch_description(): [FindPackageShare("husarion_ugv_localization"), "launch", "localization.launch.py"] ) ), - launch_arguments={"namespace": namespace, "common_dir_path": common_dir_path}.items(), + launch_arguments={ + "log_level": log_level, + "namespace": namespace, + "common_dir_path": common_dir_path, + }.items(), ) manager_launch = IncludeLaunchDescription( @@ -112,7 +131,11 @@ def generate_launch_description(): ) ), condition=UnlessCondition(disable_manager), - launch_arguments={"namespace": namespace, "common_dir_path": common_dir_path}.items(), + launch_arguments={ + "log_level": log_level, + "namespace": namespace, + "common_dir_path": common_dir_path, + }.items(), ) delayed_action = TimerAction( @@ -128,6 +151,7 @@ def generate_launch_description(): actions = [ declare_common_dir_path_arg, declare_disable_manager_arg, + declare_log_level_arg, declare_namespace_arg, welcome_info, controller_launch, diff --git a/husarion_ugv_controller/launch/controller.launch.py b/husarion_ugv_controller/launch/controller.launch.py index 12809dce9..92597bcf3 100644 --- a/husarion_ugv_controller/launch/controller.launch.py +++ b/husarion_ugv_controller/launch/controller.launch.py @@ -117,6 +117,13 @@ 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", @@ -263,6 +270,11 @@ 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, @@ -277,6 +289,11 @@ 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, @@ -299,6 +316,11 @@ 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, @@ -324,6 +346,7 @@ def generate_launch_description(): declare_publish_robot_state_arg, declare_use_sim_arg, declare_wheel_config_path_arg, + declare_log_level_arg, SetParameter(name="use_sim_time", value=use_sim), control_node, robot_state_pub_node, diff --git a/husarion_ugv_diagnostics/launch/system_monitor.launch.py b/husarion_ugv_diagnostics/launch/system_monitor.launch.py index 6bba1d6c0..830db7fc6 100644 --- a/husarion_ugv_diagnostics/launch/system_monitor.launch.py +++ b/husarion_ugv_diagnostics/launch/system_monitor.launch.py @@ -26,6 +26,13 @@ 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", @@ -53,10 +60,12 @@ def generate_launch_description(): parameters=[system_monitor_config_path], namespace=namespace, remappings=[("/diagnostics", "diagnostics")], + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, ) actions = [ + declare_log_level_arg, declare_namespace_arg, declare_system_monitor_config_path_arg, system_monitor_node, diff --git a/husarion_ugv_gazebo/launch/simulate_robot.launch.py b/husarion_ugv_gazebo/launch/simulate_robot.launch.py index a13a0115c..0cf1373d2 100644 --- a/husarion_ugv_gazebo/launch/simulate_robot.launch.py +++ b/husarion_ugv_gazebo/launch/simulate_robot.launch.py @@ -86,6 +86,13 @@ def generate_launch_description(): description="Path to the parameter_bridge configuration file.", ) + 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", @@ -108,6 +115,7 @@ def generate_launch_description(): ), launch_arguments={ "add_wheel_joints": "False", + "log_level": log_level, "namespace": namespace, }.items(), ) @@ -118,7 +126,11 @@ def generate_launch_description(): [FindPackageShare("husarion_ugv_lights"), "launch", "lights.launch.py"] ) ), - launch_arguments={"namespace": namespace, "use_sim": "True"}.items(), + launch_arguments={ + "log_level": log_level, + "namespace": namespace, + "use_sim": "True", + }.items(), ) manager_launch = IncludeLaunchDescription( @@ -127,7 +139,11 @@ def generate_launch_description(): [FindPackageShare("husarion_ugv_manager"), "launch", "manager.launch.py"] ) ), - launch_arguments={"namespace": namespace, "use_sim": "True"}.items(), + launch_arguments={ + "log_level": log_level, + "namespace": namespace, + "use_sim": "True", + }.items(), condition=UnlessCondition(disable_manager), ) @@ -142,6 +158,7 @@ def generate_launch_description(): ) ), launch_arguments={ + "log_level": log_level, "namespace": namespace, "publish_robot_state": "False", "use_sim": "True", @@ -158,7 +175,11 @@ def generate_launch_description(): ] ) ), - launch_arguments={"namespace": namespace, "use_sim": "True"}.items(), + launch_arguments={ + "log_level": log_level, + "namespace": namespace, + "use_sim": "True", + }.items(), ) simulate_components = IncludeLaunchDescription( @@ -191,6 +212,7 @@ def generate_launch_description(): name="gz_bridge", parameters=[{"config_file": namespaced_gz_bridge_config_path}], namespace=namespace, + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, ) @@ -217,6 +239,11 @@ 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, @@ -230,6 +257,7 @@ def generate_launch_description(): declare_components_config_path_arg, declare_disable_manager_arg, declare_gz_bridge_config_path_arg, + declare_log_level_arg, declare_namespace_arg, SetUseSimTime(True), spawn_robot_launch, diff --git a/husarion_ugv_gazebo/launch/simulation.launch.py b/husarion_ugv_gazebo/launch/simulation.launch.py index 34da7dc98..e95543700 100644 --- a/husarion_ugv_gazebo/launch/simulation.launch.py +++ b/husarion_ugv_gazebo/launch/simulation.launch.py @@ -39,6 +39,13 @@ def generate_launch_description(): description="Run simulation with specific GUI layout.", ) + 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", @@ -91,10 +98,12 @@ def generate_launch_description(): ] ) ), + launch_arguments={"log_level": log_level}.items(), ) actions = [ declare_gz_gui, + declare_log_level_arg, declare_namespace_arg, declare_use_rviz_arg, # Sets use_sim_time for all nodes started below (doesn't work for nodes started from ignition gazebo) diff --git a/husarion_ugv_gazebo/launch/spawn_robot.launch.py b/husarion_ugv_gazebo/launch/spawn_robot.launch.py index f3013e134..5d6c05f5e 100644 --- a/husarion_ugv_gazebo/launch/spawn_robot.launch.py +++ b/husarion_ugv_gazebo/launch/spawn_robot.launch.py @@ -30,6 +30,12 @@ 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( @@ -91,6 +97,7 @@ def generate_launch_description(): ), launch_arguments={ "add_wheel_joints": LaunchConfiguration("add_wheel_joints", default="True"), + "log_level": log_level, "namespace": namespace, "use_sim": "True", }.items(), @@ -116,12 +123,18 @@ def generate_launch_description(): pitch, "-Y", yaw, + "--ros-args", + "--log-level", + log_level, + "--log-level", + "rcl:=INFO", ], namespace=namespace, emulate_tty=True, ) actions = [ + declare_log_level_arg, declare_namespace_arg, declare_robot_model_arg, declare_x_arg, diff --git a/husarion_ugv_lights/launch/lights.launch.py b/husarion_ugv_lights/launch/lights.launch.py index 8f681d695..cff0f7856 100644 --- a/husarion_ugv_lights/launch/lights.launch.py +++ b/husarion_ugv_lights/launch/lights.launch.py @@ -60,6 +60,13 @@ def generate_launch_description(): description="Path to a YAML file with a description of led configuration.", ) + 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", @@ -124,6 +131,7 @@ def generate_launch_description(): ], ), ], + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, on_exit=Shutdown(), ) @@ -132,6 +140,7 @@ def generate_launch_description(): declare_common_dir_path_arg, declare_robot_model_arg, # robot_model is used by animations_config_path declare_animations_config_path_arg, + declare_log_level_arg, declare_namespace_arg, declare_use_sim_arg, declare_user_led_animations_path_arg, diff --git a/husarion_ugv_localization/launch/localization.launch.py b/husarion_ugv_localization/launch/localization.launch.py index 8dfc86daa..7f8398dc6 100644 --- a/husarion_ugv_localization/launch/localization.launch.py +++ b/husarion_ugv_localization/launch/localization.launch.py @@ -57,6 +57,13 @@ def generate_launch_description(): choices=["relative", "enu"], ) + 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", @@ -125,6 +132,7 @@ def generate_launch_description(): ("set_pose", "localization/set_pose"), ("toggle", "localization/toggle"), ], + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], condition=IfCondition(use_ekf), ) @@ -134,7 +142,7 @@ def generate_launch_description(): [FindPackageShare("husarion_ugv_localization"), "launch", "nmea_navsat.launch.py"] ) ), - launch_arguments={"namespace": namespace}.items(), + launch_arguments={"log_level": log_level, "namespace": namespace}.items(), condition=IfCondition(launch_nmea_gps), ) @@ -149,6 +157,7 @@ def generate_launch_description(): ("gps/fix", "gps/fix"), ("odometry/gps", "_odometry/gps"), ], + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], condition=IfCondition(fuse_gps), ) @@ -158,6 +167,7 @@ def generate_launch_description(): declare_launch_nmea_gps_arg, declare_localization_mode_arg, declare_localization_config_path_arg, # localization_config_path use fuse_gps and localization_mode + declare_log_level_arg, declare_namespace_arg, declare_use_ekf_arg, declare_use_sim_arg, diff --git a/husarion_ugv_localization/launch/nmea_navsat.launch.py b/husarion_ugv_localization/launch/nmea_navsat.launch.py index 70fe996d9..b51847bc8 100644 --- a/husarion_ugv_localization/launch/nmea_navsat.launch.py +++ b/husarion_ugv_localization/launch/nmea_navsat.launch.py @@ -26,6 +26,12 @@ def generate_launch_description(): + log_level = LaunchConfiguration("log_level") + declare_log_level_arg = DeclareLaunchArgument( + "log_level", + default_value="info", + description="Logging level", + ) nmea_params_path = LaunchConfiguration("nmea_params_path") declare_nmea_params_path_arg = DeclareLaunchArgument( @@ -62,12 +68,14 @@ def generate_launch_description(): ("vel", [device_namespace, "/vel"]), ("heading", ["_", device_namespace, "/heading"]), ], + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], ) - return LaunchDescription( - [ - declare_nmea_params_path_arg, - declare_robot_namespace_arg, - nmea_driver_node, - ] - ) + actions = [ + declare_log_level_arg, + declare_nmea_params_path_arg, + declare_robot_namespace_arg, + nmea_driver_node, + ] + + return LaunchDescription(actions) diff --git a/husarion_ugv_manager/launch/manager.launch.py b/husarion_ugv_manager/launch/manager.launch.py index d54676133..44784abc6 100644 --- a/husarion_ugv_manager/launch/manager.launch.py +++ b/husarion_ugv_manager/launch/manager.launch.py @@ -58,6 +58,13 @@ def generate_launch_description(): description="Path to BehaviorTree project file, responsible for lights management.", ) + 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", @@ -103,6 +110,7 @@ def generate_launch_description(): {"bt_project_path": lights_bt_project_path}, ], namespace=namespace, + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, ) @@ -118,12 +126,14 @@ def generate_launch_description(): }, ], namespace=namespace, + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, condition=UnlessCondition(use_sim), ) actions = [ declare_common_dir_path_arg, + declare_log_level_arg, declare_lights_bt_project_path_arg, declare_safety_bt_project_path_arg, declare_namespace_arg, diff --git a/lynx_description/launch/load_urdf.launch.py b/lynx_description/launch/load_urdf.launch.py index cc3e6dbfc..98787dcc6 100644 --- a/lynx_description/launch/load_urdf.launch.py +++ b/lynx_description/launch/load_urdf.launch.py @@ -84,6 +84,13 @@ 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", @@ -177,6 +184,7 @@ 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), ) @@ -187,6 +195,7 @@ 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 1297f7c10..5b4e40aa9 100644 --- a/panther_description/launch/load_urdf.launch.py +++ b/panther_description/launch/load_urdf.launch.py @@ -83,6 +83,13 @@ 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", @@ -169,6 +176,7 @@ def generate_launch_description(): {"frame_prefix": namespace_ext}, ], namespace=namespace, + arguments=["--ros-args", "--log-level", log_level, "--log-level", "rcl:=INFO"], emulate_tty=True, ) @@ -176,6 +184,7 @@ 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), ) @@ -186,6 +195,7 @@ 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,