Skip to content

Commit

Permalink
feat(logger_level_configure): make it possible to change level of con…
Browse files Browse the repository at this point in the history
…tainer logger (#6823)

* feat(launch): add logging_demo::LoggerConfig into container

Signed-off-by: satoshi-ota <[email protected]>

* fix(logger_level_reconfigure_plugin): fix yaml

Signed-off-by: satoshi-ota <[email protected]>

* feat(logging_level_configure): add composable node

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Apr 17, 2024
1 parent 8319209 commit 51b5f83
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 18 deletions.
5 changes: 5 additions & 0 deletions common/tier4_autoware_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_
1 change: 1 addition & 0 deletions common/tier4_autoware_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<depend>pcl_conversions</depend>
<depend>pcl_ros</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tf2</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tier4_debug_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(tier4_autoware_utils::LoggerLevelConfigureNode)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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

# ============================================================
Expand All @@ -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

# ============================================================
Expand All @@ -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
6 changes: 6 additions & 0 deletions launch/tier4_control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions launch/tier4_control_launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@

<exec_depend>external_cmd_converter</exec_depend>
<exec_depend>external_cmd_selector</exec_depend>
<exec_depend>glog_component</exec_depend>
<exec_depend>lane_departure_checker</exec_depend>
<exec_depend>shift_decider</exec_depend>
<exec_depend>tier4_autoware_utils</exec_depend>
<exec_depend>trajectory_follower_node</exec_depend>
<exec_depend>vehicle_cmd_gate</exec_depend>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
<let name="behavior_velocity_planner_launch_modules" value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + '$(var launch_module_list_end)'&quot;)"/>

<node_container pkg="rclcpp_components" exec="$(var container_type)" name="behavior_planning_container" namespace="" args="" output="both">
<composable_node pkg="tier4_autoware_utils" plugin="tier4_autoware_utils::LoggerLevelConfigureNode" name="container_logger_configure" namespace=""/>
<composable_node pkg="behavior_path_planner" plugin="behavior_path_planner::BehaviorPathPlannerNode" name="behavior_path_planner" namespace="">
<!-- topic remap -->
<remap from="~/input/route" to="$(var input_route_topic_name)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<composable_node pkg="glog_component" plugin="GlogComponent" name="glog_component" namespace=""/>
</node_container>

<load_composable_node target="/planning/scenario_planning/lane_driving/motion_planning/motion_planning_container">
<composable_node pkg="tier4_autoware_utils" plugin="tier4_autoware_utils::LoggerLevelConfigureNode" name="config_logger" namespace=""/>
</load_composable_node>

<!-- path smoothing -->
<group>
<group if="$(eval &quot;'$(var motion_path_smoother_type)' == 'elastic_band'&quot;)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<!-- motion velocity smoother -->
<group>
<node_container pkg="rclcpp_components" exec="component_container" name="motion_velocity_smoother_container" namespace="">
<composable_node pkg="tier4_autoware_utils" plugin="tier4_autoware_utils::LoggerLevelConfigureNode" name="container_logger_configure" namespace=""/>
<composable_node pkg="motion_velocity_smoother" plugin="motion_velocity_smoother::MotionVelocitySmootherNode" name="motion_velocity_smoother" namespace="">
<param name="algorithm_type" value="$(var motion_velocity_smoother_type)"/>
<param from="$(var common_param_path)"/>
Expand Down
1 change: 1 addition & 0 deletions launch/tier4_planning_launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<exec_depend>planning_validator</exec_depend>
<exec_depend>scenario_selector</exec_depend>
<exec_depend>surround_obstacle_checker</exec_depend>
<exec_depend>tier4_autoware_utils</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
1 change: 1 addition & 0 deletions planning/mission_planner/launch/mission_planner.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<arg name="mission_planner_param_path" default="$(find-pkg-share mission_planner)/config/mission_planner.param.yaml"/>

<node_container pkg="rclcpp_components" exec="component_container_mt" name="mission_planner_container" namespace="">
<composable_node pkg="tier4_autoware_utils" plugin="tier4_autoware_utils::LoggerLevelConfigureNode" name="container_logger_configure" namespace=""/>
<composable_node pkg="mission_planner" plugin="mission_planner::MissionPlanner" name="mission_planner" namespace="">
<param from="$(var mission_planner_param_path)"/>
<remap from="~/input/modified_goal" to="$(var modified_goal_topic_name)"/>
Expand Down

0 comments on commit 51b5f83

Please sign in to comment.