From 51b5f830780eb69bd1a7dfe60e295773f394fd8e Mon Sep 17 00:00:00 2001 From: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com> Date: Thu, 18 Apr 2024 08:41:30 +0900 Subject: [PATCH] feat(logger_level_configure): make it possible to change level of container logger (#6823) * feat(launch): add logging_demo::LoggerConfig into container Signed-off-by: satoshi-ota * fix(logger_level_reconfigure_plugin): fix yaml Signed-off-by: satoshi-ota * feat(logging_level_configure): add composable node Signed-off-by: satoshi-ota --------- Signed-off-by: satoshi-ota --- common/tier4_autoware_utils/CMakeLists.txt | 5 ++++ .../ros/logger_level_configure.hpp | 5 ++++ common/tier4_autoware_utils/package.xml | 1 + .../src/ros/logger_level_configure.cpp | 7 +++++ .../config/logger_config.yaml | 30 ++++++++----------- .../launch/control.launch.py | 6 ++++ launch/tier4_control_launch/package.xml | 2 ++ .../behavior_planning.launch.xml | 1 + .../motion_planning.launch.xml | 4 +++ .../scenario_planning.launch.xml | 1 + launch/tier4_planning_launch/package.xml | 1 + .../launch/mission_planner.launch.xml | 1 + 12 files changed, 46 insertions(+), 18 deletions(-) diff --git a/common/tier4_autoware_utils/CMakeLists.txt b/common/tier4_autoware_utils/CMakeLists.txt index 9cb54e52362a5..f9bc00f891879 100644 --- a/common/tier4_autoware_utils/CMakeLists.txt +++ b/common/tier4_autoware_utils/CMakeLists.txt @@ -18,6 +18,11 @@ ament_auto_add_library(tier4_autoware_utils SHARED src/system/backtrace.cpp ) +rclcpp_components_register_node(tier4_autoware_utils + PLUGIN "tier4_autoware_utils::LoggerLevelConfigureNode" + EXECUTABLE logger_level_configure_node +) + if(BUILD_TESTING) find_package(ament_cmake_ros REQUIRED) diff --git a/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/logger_level_configure.hpp b/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/logger_level_configure.hpp index 5aee3a251dad2..9aca59e4fa514 100644 --- a/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/logger_level_configure.hpp +++ b/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/logger_level_configure.hpp @@ -64,5 +64,10 @@ class LoggerLevelConfigure const ConfigLogger::Response::SharedPtr response); }; +class LoggerLevelConfigureNode : public rclcpp::Node, public LoggerLevelConfigure +{ +public: + explicit LoggerLevelConfigureNode(const rclcpp::NodeOptions & node_options); +}; } // namespace tier4_autoware_utils #endif // TIER4_AUTOWARE_UTILS__ROS__LOGGER_LEVEL_CONFIGURE_HPP_ diff --git a/common/tier4_autoware_utils/package.xml b/common/tier4_autoware_utils/package.xml index c34d3b5fdfdd0..8cac2809a13b3 100644 --- a/common/tier4_autoware_utils/package.xml +++ b/common/tier4_autoware_utils/package.xml @@ -23,6 +23,7 @@ pcl_conversions pcl_ros rclcpp + rclcpp_components tf2 tf2_geometry_msgs tier4_debug_msgs diff --git a/common/tier4_autoware_utils/src/ros/logger_level_configure.cpp b/common/tier4_autoware_utils/src/ros/logger_level_configure.cpp index d764299290d05..39950d806a9f6 100644 --- a/common/tier4_autoware_utils/src/ros/logger_level_configure.cpp +++ b/common/tier4_autoware_utils/src/ros/logger_level_configure.cpp @@ -58,4 +58,11 @@ void LoggerLevelConfigure::onLoggerConfigService( return; } +LoggerLevelConfigureNode::LoggerLevelConfigureNode(const rclcpp::NodeOptions & node_options) +: Node("logger_level_configure_node", node_options), LoggerLevelConfigure(this) +{ +} + } // namespace tier4_autoware_utils +#include +RCLCPP_COMPONENTS_REGISTER_NODE(tier4_autoware_utils::LoggerLevelConfigureNode) diff --git a/common/tier4_logging_level_configure_rviz_plugin/config/logger_config.yaml b/common/tier4_logging_level_configure_rviz_plugin/config/logger_config.yaml index a298967a31af9..c7bc1cc835ebc 100644 --- a/common/tier4_logging_level_configure_rviz_plugin/config/logger_config.yaml +++ b/common/tier4_logging_level_configure_rviz_plugin/config/logger_config.yaml @@ -31,12 +31,14 @@ Planning: behavior_path_planner: - node_name: /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner logger_name: planning.scenario_planning.lane_driving.behavior_planning.behavior_path_planner - - node_name: /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner + - node_name: /planning/scenario_planning/lane_driving/behavior_planning/container_logger_configure logger_name: tier4_autoware_utils behavior_path_planner_avoidance: - node_name: /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner logger_name: planning.scenario_planning.lane_driving.behavior_planning.behavior_path_planner.avoidance + - node_name: /planning/scenario_planning/lane_driving/behavior_planning + logger_name: planning.scenario_planning.lane_driving.behavior_planning.behavior_path_planner.avoidance.utils behavior_path_planner_goal_planner: - node_name: /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner @@ -57,7 +59,7 @@ Planning: behavior_velocity_planner: - node_name: /planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner logger_name: planning.scenario_planning.lane_driving.behavior_planning.behavior_velocity_planner - - node_name: /planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner + - node_name: /planning/scenario_planning/lane_driving/behavior_planning/container_logger_configure logger_name: tier4_autoware_utils behavior_velocity_planner_intersection: @@ -67,13 +69,13 @@ Planning: motion_obstacle_avoidance: - node_name: /planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner logger_name: planning.scenario_planning.lane_driving.motion_planning.obstacle_avoidance_planner - - node_name: /planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner + - node_name: /planning/scenario_planning/lane_driving/motion_planning/container_logger_configure logger_name: tier4_autoware_utils motion_velocity_smoother: - node_name: /planning/scenario_planning/motion_velocity_smoother logger_name: planning.scenario_planning.motion_velocity_smoother - - node_name: /planning/scenario_planning/motion_velocity_smoother + - node_name: /planning/scenario_planning/lane_driving/motion_planning/container_logger_configure logger_name: tier4_autoware_utils # ============================================================ @@ -83,19 +85,19 @@ Control: lateral_controller: - node_name: /control/trajectory_follower/controller_node_exe logger_name: control.trajectory_follower.controller_node_exe.lateral_controller - - node_name: /control/trajectory_follower/controller_node_exe + - node_name: /control/container_logger_configure logger_name: tier4_autoware_utils longitudinal_controller: - node_name: /control/trajectory_follower/controller_node_exe logger_name: control.trajectory_follower.controller_node_exe.longitudinal_controller - - node_name: /control/trajectory_follower/controller_node_exe + - node_name: /control/container_logger_configure logger_name: tier4_autoware_utils vehicle_cmd_gate: - node_name: /control/vehicle_cmd_gate logger_name: control.vehicle_cmd_gate - - node_name: /control/vehicle_cmd_gate + - node_name: /control/container_logger_configure logger_name: tier4_autoware_utils # ============================================================ @@ -104,17 +106,9 @@ Control: Common: tier4_autoware_utils: - - node_name: /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner + - node_name: /planning/scenario_planning/lane_driving/behavior_planning/container_logger_configure logger_name: tier4_autoware_utils - - node_name: /planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner + - node_name: /planning/scenario_planning/lane_driving/motion_planning/container_logger_configure logger_name: tier4_autoware_utils - - node_name: /planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner - logger_name: tier4_autoware_utils - - node_name: /planning/scenario_planning/lane_driving/motion_planning/path_smoother - logger_name: tier4_autoware_utils - - node_name: /planning/scenario_planning/motion_velocity_smoother - logger_name: tier4_autoware_utils - - node_name: /control/trajectory_follower/controller_node_exe - logger_name: tier4_autoware_utils - - node_name: /control/vehicle_cmd_gate + - node_name: /control/container_logger_configure logger_name: tier4_autoware_utils diff --git a/launch/tier4_control_launch/launch/control.launch.py b/launch/tier4_control_launch/launch/control.launch.py index a63e7f547fef1..4e58e7898b6bb 100644 --- a/launch/tier4_control_launch/launch/control.launch.py +++ b/launch/tier4_control_launch/launch/control.launch.py @@ -381,6 +381,12 @@ def launch_setup(context, *args, **kwargs): package="rclcpp_components", executable=LaunchConfiguration("container_executable"), composable_node_descriptions=[ + ComposableNode( + package="tier4_autoware_utils", + plugin="tier4_autoware_utils::LoggerLevelConfigureNode", + name="container_logger_configure", + namespace="control_validator_container", + ), control_validator_component, ComposableNode( package="glog_component", diff --git a/launch/tier4_control_launch/package.xml b/launch/tier4_control_launch/package.xml index 4bfefa4d93747..0f18c6e07d705 100644 --- a/launch/tier4_control_launch/package.xml +++ b/launch/tier4_control_launch/package.xml @@ -13,8 +13,10 @@ external_cmd_converter external_cmd_selector + glog_component lane_departure_checker shift_decider + tier4_autoware_utils trajectory_follower_node vehicle_cmd_gate diff --git a/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml b/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml index aa649710836da..9ef1a80595b27 100644 --- a/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml +++ b/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml @@ -182,6 +182,7 @@ + diff --git a/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/motion_planning/motion_planning.launch.xml b/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/motion_planning/motion_planning.launch.xml index 18de04fd9e317..4b904ff48c7cd 100644 --- a/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/motion_planning/motion_planning.launch.xml +++ b/launch/tier4_planning_launch/launch/scenario_planning/lane_driving/motion_planning/motion_planning.launch.xml @@ -6,6 +6,10 @@ + + + + diff --git a/launch/tier4_planning_launch/launch/scenario_planning/scenario_planning.launch.xml b/launch/tier4_planning_launch/launch/scenario_planning/scenario_planning.launch.xml index 0a30204ca3c99..f4b2e13b082e2 100644 --- a/launch/tier4_planning_launch/launch/scenario_planning/scenario_planning.launch.xml +++ b/launch/tier4_planning_launch/launch/scenario_planning/scenario_planning.launch.xml @@ -27,6 +27,7 @@ + diff --git a/launch/tier4_planning_launch/package.xml b/launch/tier4_planning_launch/package.xml index 950ef67865a85..62c200eab5070 100644 --- a/launch/tier4_planning_launch/package.xml +++ b/launch/tier4_planning_launch/package.xml @@ -74,6 +74,7 @@ planning_validator scenario_selector surround_obstacle_checker + tier4_autoware_utils ament_lint_auto autoware_lint_common diff --git a/planning/mission_planner/launch/mission_planner.launch.xml b/planning/mission_planner/launch/mission_planner.launch.xml index eca6d05bb9463..8df1198ab3fe0 100644 --- a/planning/mission_planner/launch/mission_planner.launch.xml +++ b/planning/mission_planner/launch/mission_planner.launch.xml @@ -5,6 +5,7 @@ +