Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/change nodes log level #7660

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<launch>
<node pkg="component_interface_tools" exec="service_log_checker_node"/>
<arg name="log_level" default="WARN"/>

<node pkg="component_interface_tools" exec="service_log_checker_node" ros_args="--log-level $(var log_level)"/>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<arg name="input/reference_trajectory" default="/planning/scenario_planning/lane_driving/motion_planning/path_optimizer/trajectory"/>
<arg name="input/objects" default="/perception/object_recognition/objects"/>
<arg name="input/modified_goal" default="/planning/scenario_planning/modified_goal"/>
<arg name="log_level" default="WARN"/>

<!-- planning evaluator -->
<group>
<node name="planning_evaluator" exec="planning_evaluator" pkg="autoware_planning_evaluator">
<node name="planning_evaluator" exec="planning_evaluator" pkg="autoware_planning_evaluator" ros_args="--log-level $(var log_level)">
<param from="$(find-pkg-share autoware_planning_evaluator)/param/planning_evaluator.defaults.yaml"/>
<remap from="~/input/odometry" to="$(var input/odometry)"/>
<remap from="~/input/trajectory" to="$(var input/trajectory)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
<arg name="rosbridge_respawn" default="true"/>
<arg name="rosbridge_max_message_size" default="10000000"/>

<arg name="log_level" default="WARN"/>

<!-- Deprecated API -->
<group if="$(var launch_deprecated_api)">
<include file="$(find-pkg-share tier4_autoware_api_launch)/launch/deprecated_api.launch.xml"/>
</group>

<!-- AD API -->
<group>
<include file="$(find-pkg-share default_ad_api)/launch/default_ad_api.launch.py" if="$(var launch_default_ad_api)"/>
<include file="$(find-pkg-share ad_api_adaptors)/launch/rviz_adaptors.launch.xml" if="$(var launch_rviz_adaptors)"/>
<include file="$(find-pkg-share default_ad_api)/launch/default_ad_api.launch.py" if="$(var launch_default_ad_api)">
<arg name="log_level" value="$(var log_level)"/>
</include>
<include file="$(find-pkg-share ad_api_adaptors)/launch/rviz_adaptors.launch.xml" if="$(var launch_rviz_adaptors)">
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>

<!-- RTC controller -->
Expand Down
16 changes: 16 additions & 0 deletions launch/tier4_control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,115 +336,130 @@
plugin="GlogComponent",
name="glog_component",
)

log_args = ["--log-level", ["control.control_container:=", LaunchConfiguration("log_level")],
"--log-level", ["control.obstacle_collision_checker:=", LaunchConfiguration("log_level")],
"--log-level", ["control.autoware_operation_mode_transition_manager:=", LaunchConfiguration("log_level")],
"--log-level", ["control.vehicle_cmd_gate:=", LaunchConfiguration("log_level")],
"--log-level", ["control.predicted_path_checker:=", LaunchConfiguration("log_level")],
"--log-level", ["control.autonomous_emergency_braking:=", LaunchConfiguration("log_level")],
"--log-level", ["control.autoware_shift_decider:=", LaunchConfiguration("log_level")],
"--log-level", ["control.trajectory_follower.lane_departure_checker_node:=", LaunchConfiguration("log_level")],
"--log-level", ["control.trajectory_follower.controller_node_exe:=", LaunchConfiguration("log_level")],]

# set container to run all required components in the same process
if trajectory_follower_mode == "trajectory_follower_node":
container = ComposableNodeContainer(
name="control_container",
namespace="",
package="rclcpp_components",
executable=LaunchConfiguration("container_executable"),
composable_node_descriptions=[
controller_component,
lane_departure_component,
shift_decider_component,
vehicle_cmd_gate_component,
autoware_operation_mode_transition_manager_component,
glog_component,
],
ros_arguments=log_args,
)

elif trajectory_follower_mode == "smart_mpc_trajectory_follower":
container = ComposableNodeContainer(
name="control_container",
namespace="",
package="rclcpp_components",
executable=LaunchConfiguration("container_executable"),
composable_node_descriptions=[
lane_departure_component,
shift_decider_component,
vehicle_cmd_gate_component,
autoware_operation_mode_transition_manager_component,
glog_component,
],
ros_arguments=log_args,
)
else:
raise Exception(
f"The argument trajectory_follower_mode must be either trajectory_follower_node or smart_mpc_trajectory_follower, but {trajectory_follower_mode} was given."
)

# control evaluator
control_evaluator_component = ComposableNode(
package="autoware_control_evaluator",
plugin="control_diagnostics::controlEvaluatorNode",
name="control_evaluator",
remappings=[
("~/input/diagnostics", "/diagnostics"),
("~/input/odometry", "/localization/kinematic_state"),
("~/input/trajectory", "/planning/scenario_planning/trajectory"),
("~/metrics", "/diagnostic/control_evaluator/metrics"),
],
)

control_evaluator_loader = LoadComposableNodes(
composable_node_descriptions=[control_evaluator_component],
target_container="/control/control_container",
)

# control validator checker
control_validator_component = ComposableNode(
package="autoware_control_validator",
plugin="autoware::control_validator::ControlValidator",
name="control_validator",
remappings=[
("~/input/kinematics", "/localization/kinematic_state"),
("~/input/reference_trajectory", "/planning/scenario_planning/trajectory"),
(
"~/input/predicted_trajectory",
"/control/trajectory_follower/lateral/predicted_trajectory",
),
("~/output/validation_status", "~/validation_status"),
],
parameters=[control_validator_param],
)

group = GroupAction(
[
PushRosNamespace("control"),
container,
external_cmd_selector_loader,
external_cmd_converter_loader,
obstacle_collision_checker_loader,
autonomous_emergency_braking_loader,
predicted_path_checker_loader,
control_evaluator_loader,
]
)

control_validator_group = GroupAction(
[
PushRosNamespace("control"),
ComposableNodeContainer(
name="control_validator_container",
namespace="",
package="rclcpp_components",
executable=LaunchConfiguration("container_executable"),
composable_node_descriptions=[
control_validator_component,
ComposableNode(
package="glog_component",
plugin="GlogComponent",
name="glog_validator_component",
),
],
ros_arguments=["--log-level", ["control.control_validator_container:=", LaunchConfiguration("log_level")],
"--log-level", ["control.control_validator:=", LaunchConfiguration("log_level")]],
),
]
)

smart_mpc_trajectory_follower = Node(
package="autoware_smart_mpc_trajectory_follower",
executable="pympc_trajectory_follower.py",
name="pympc_trajectory_follower",
arguments=["--ros-args", "--log-level", LaunchConfiguration("log_level")]

Check warning on line 462 in launch/tier4_control_launch/launch/control.launch.py

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Large Method

launch_setup increases from 380 to 394 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
)
if trajectory_follower_mode == "trajectory_follower_node":
return [group, control_validator_group]
Expand Down Expand Up @@ -493,6 +508,7 @@
"trajectory_follower_node",
"Options for which trajectory_follower to use. Options: `trajectory_follower_node`, `smart_mpc_trajectory_follower`",
)
add_launch_arg("log_level", "WARN")
set_container_executable = SetLaunchConfiguration(
"container_executable",
"component_container",
Expand Down
12 changes: 10 additions & 2 deletions launch/tier4_map_launch/launch/map.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
<let name="container_type" value="component_container" unless="$(var use_multithread)"/>
<let name="container_type" value="component_container_mt" if="$(var use_multithread)"/>

<arg name="log_level" default="WARN"/>

<group>
<push-ros-namespace namespace="map"/>

<node_container pkg="rclcpp_components" exec="$(var container_type)" name="map_container" namespace="" output="both">
<node_container pkg="rclcpp_components" exec="$(var container_type)" name="map_container" namespace="" output="both"
ros_args="--log-level map.map_container:=$(var log_level) \
--log-level map.pointcloud_map_loader:=$(var log_level) \
--log-level map.lanelet2_map_loader:=$(var log_level) \
--log-level map.lanelet2_map_visualization:=$(var log_level) \
--log-level map.vector_map_tf_generator:=$(var log_level)">
<composable_node pkg="map_loader" plugin="PointCloudMapLoaderNode" name="pointcloud_map_loader">
<param from="$(var pointcloud_map_loader_param_path)"/>
<param name="pcd_paths_or_directory" value="[$(var pointcloud_map_path)]"/>
Expand Down Expand Up @@ -54,7 +61,7 @@
</composable_node>
</node_container>

<node pkg="map_loader" exec="map_hash_generator" name="map_hash_generator">
<node pkg="map_loader" exec="map_hash_generator" name="map_hash_generator" ros_args="--log-level $(var log_level)">
<param name="lanelet2_map_path" value="$(var lanelet2_map_path)"/>
<param name="pointcloud_map_path" value="$(var pointcloud_map_path)"/>
</node>
Expand All @@ -63,6 +70,7 @@
<arg name="param_path" value="$(var map_projection_loader_param_path)"/>
<arg name="map_projector_info_path" value="$(var map_projector_info_path)"/>
<arg name="lanelet2_map_path" value="$(var lanelet2_map_path)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
<launch>
<arg name="use_vector_map" default="false" description="use vector map in prediction"/>
<arg name="input/objects" default="/perception/object_recognition/tracking/objects"/>
<arg name="log_level" default="WARN"/>

<group if="$(var use_vector_map)">
<set_remap from="objects" to="/perception/object_recognition/objects"/>
<include file="$(find-pkg-share autoware_map_based_prediction)/launch/map_based_prediction.launch.xml">
<arg name="output_topic" value="/perception/object_recognition/objects"/>
<arg name="input_topic" value="$(var input/objects)"/>
<arg name="param_path" value="$(var object_recognition_prediction_map_based_prediction_param_path)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>
<group unless="$(var use_vector_map)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<arg name="occupancy_grid_map_updater_param_path"/>
<arg name="input_obstacle_pointcloud" default="false" description="subscribe obstacle pointcloud"/>
<arg name="input_obstacle_and_raw_pointcloud" default="true" description="subscribe both obstacle and raw pointcloud"/>
<arg name="log_level" default="WARN"/>

<!--pointcloud based method-->
<group if="$(eval &quot;'$(var occupancy_grid_map_method)'=='pointcloud_based_occupancy_grid_map'&quot;)">
Expand Down Expand Up @@ -45,6 +46,7 @@
<arg name="updater_param_file" value="$(var occupancy_grid_map_updater_param_path)"/>
<arg name="input_obstacle_pointcloud" value="$(var input_obstacle_pointcloud)"/>
<arg name="input_obstacle_and_raw_pointcloud" value="$(var input_obstacle_and_raw_pointcloud)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<arg name="car_classifier_param_path" default="$(find-pkg-share traffic_light_classifier)/config/car_traffic_light_classifier.param.yaml"/>
<arg name="pedestrian_classifier_param_path" default="$(find-pkg-share traffic_light_classifier)/config/pedestrian_traffic_light_classifier.param.yaml"/>

<arg name="log_level" default="WARN"/>

<!-- namespace1 camera TLR pipeline -->
<group>
<push-ros-namespace namespace="$(var namespace1)"/>
Expand Down Expand Up @@ -79,6 +81,7 @@
<arg name="input/car/traffic_signals" value="classified/car/traffic_signals"/>
<arg name="input/pedestrian/traffic_signals" value="classified/pedestrian/traffic_signals"/>
<arg name="output/traffic_signals" value="$(var output/traffic_signals1)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>
</group>
Expand Down Expand Up @@ -140,7 +143,7 @@

<!-- traffic_light_multi_camera_fusion -->
<group>
<node pkg="traffic_light_multi_camera_fusion" exec="traffic_light_multi_camera_fusion_node" name="traffic_light_multi_camera_fusion" output="screen">
<node pkg="traffic_light_multi_camera_fusion" exec="traffic_light_multi_camera_fusion_node" name="traffic_light_multi_camera_fusion" output="screen" ros_args="--log-level $(var log_level)">
<param name="camera_namespaces" value="$(var all_camera_namespaces)"/>
<param name="perform_group_fusion" value="true"/>
<remap from="~/input/vector_map" to="/map/vector_map"/>
Expand All @@ -154,11 +157,12 @@
<arg name="perception_traffic_signals" value="$(var internal/traffic_signals)"/>
<arg name="external_traffic_signals" value="$(var external/traffic_signals)"/>
<arg name="output_traffic_signals" value="$(var judged/traffic_signals)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>

<group if="$(var use_crosswalk_traffic_light_estimator)">
<node pkg="autoware_crosswalk_traffic_light_estimator" exec="crosswalk_traffic_light_estimator_node" name="crosswalk_traffic_light_estimator" output="screen">
<node pkg="autoware_crosswalk_traffic_light_estimator" exec="crosswalk_traffic_light_estimator_node" name="crosswalk_traffic_light_estimator" output="screen" ros_args="--log-level $(var log_level)">
<remap from="~/input/vector_map" to="/map/vector_map"/>
<remap from="~/input/route" to="/planning/mission_planning/route"/>
<remap from="~/input/classified/traffic_signals" to="$(var judged/traffic_signals)"/>
Expand All @@ -168,7 +172,7 @@
</group>

<group unless="$(var use_crosswalk_traffic_light_estimator)">
<node pkg="topic_tools" exec="relay" name="fusion_signals_relay" output="screen">
<node pkg="topic_tools" exec="relay" name="fusion_signals_relay" output="screen" ros_args="--log-level $(var log_level)">
<param name="input_topic" value="$(var judged/traffic_signals)"/>
<param name="output_topic" value="$(var output/traffic_signals)"/>
<param name="type" value="autoware_perception_msgs/msg/TrafficLightGroupArray"/>
Expand All @@ -177,6 +181,8 @@

<!-- visualizer -->
<group>
<include file="$(find-pkg-share traffic_light_visualization)/launch/traffic_light_map_visualizer.launch.xml"/>
<include file="$(find-pkg-share traffic_light_visualization)/launch/traffic_light_map_visualizer.launch.xml">
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>
</launch>
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<launch>
<arg name="mission_planner_param_path" default="$(find-pkg-share autoware_mission_planner)/config/mission_planner.param.yaml"/>
<arg name="log_level" default="WARN"/>
<group>
<include file="$(find-pkg-share autoware_mission_planner)/launch/mission_planner.launch.xml">
<arg name="mission_planner_param_path" value="$(var mission_planner_param_path)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>
<group>
Expand Down
12 changes: 10 additions & 2 deletions launch/tier4_planning_launch/launch/planning.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<!-- Auto mode setting-->
<arg name="enable_all_modules_auto_mode"/>
<arg name="is_simulation"/>
<arg name="log_level" default="WARN"/>

<group>
<push-ros-namespace namespace="planning"/>
Expand All @@ -18,6 +19,7 @@
<push-ros-namespace namespace="mission_planning"/>
<include file="$(find-pkg-share tier4_planning_launch)/launch/mission_planning/mission_planning.launch.xml">
<arg name="mission_planner_param_path" value="$(var mission_planner_param_path)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>

Expand All @@ -27,6 +29,7 @@
<include file="$(find-pkg-share tier4_planning_launch)/launch/scenario_planning/scenario_planning.launch.xml">
<arg name="enable_all_modules_auto_mode" value="$(var enable_all_modules_auto_mode)"/>
<arg name="is_simulation" value="$(var is_simulation)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>

Expand All @@ -36,17 +39,22 @@
<arg name="input_trajectory" value="/planning/scenario_planning/velocity_smoother/trajectory"/>
<arg name="output_trajectory" value="/planning/scenario_planning/trajectory"/>
<arg name="planning_validator_param_path" value="$(var planning_validator_param_path)"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>

<!-- planning evaluator -->
<group>
<include file="$(find-pkg-share autoware_planning_evaluator)/launch/planning_evaluator.launch.xml"/>
<include file="$(find-pkg-share autoware_planning_evaluator)/launch/planning_evaluator.launch.xml">
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>

<!-- mission remaining distance and time calculator -->
<group>
<include file="$(find-pkg-share autoware_remaining_distance_time_calculator)/launch/remaining_distance_time_calculator.launch.xml"/>
<include file="$(find-pkg-share autoware_remaining_distance_time_calculator)/launch/remaining_distance_time_calculator.launch.xml">
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>
</group>
</launch>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<launch>
<arg name="enable_all_modules_auto_mode"/>
<arg name="is_simulation"/>
<arg name="log_level" default="WARN"/>

<!-- lane_driving scenario -->
<group>
Expand All @@ -15,6 +16,7 @@
<arg name="is_simulation" value="$(var is_simulation)"/>
<!-- This condition should be true if run_out module is enabled and its detection method is Points -->
<arg name="launch_compare_map_pipeline" value="false"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>
</group>
Expand All @@ -25,6 +27,7 @@
<group>
<include file="$(find-pkg-share tier4_planning_launch)/launch/scenario_planning/lane_driving/motion_planning/motion_planning.launch.xml">
<arg name="container_type" value="component_container_mt"/>
<arg name="log_level" value="$(var log_level)"/>
</include>
</group>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

<arg name="launch_module_list_end" default="&quot;&quot;]"/>

<arg name="log_level" default="WARN"/>

<!-- assemble launch config for behavior path planner -->
<arg name="behavior_path_planner_launch_modules" default="["/>
<let
Expand Down Expand Up @@ -169,7 +171,12 @@
/>
<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">
<node_container pkg="rclcpp_components" exec="$(var container_type)" name="behavior_planning_container" namespace="" args="" output="both"
ros_args="--log-level planning.scenario_planning.lane_driving.behavior_planning.behavior_planning_container:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.behavior_planning.behavior_velocity_planner:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.behavior_planning.behavior_path_planner:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.behavior_planning.voxel_distance_based_compare_map_filter_node:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.behavior_planning.vector_map_inside_area_filter_node:=$(var log_level)">
<composable_node pkg="autoware_behavior_path_planner" plugin="autoware::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 @@ -7,6 +7,8 @@
<arg name="launch_obstacle_velocity_limiter_module" default="true"/>
<arg name="launch_module_list_end" default="&quot;&quot;]"/>

<arg name="log_level" default="WARN"/>

<!-- assemble launch config for motion velocity planner -->
<arg name="motion_velocity_planner_launch_modules" default="["/>
<let
Expand All @@ -26,7 +28,16 @@
/>
<let name="motion_velocity_planner_launch_modules" value="$(eval &quot;'$(var motion_velocity_planner_launch_modules)' + '$(var launch_module_list_end)'&quot;)"/>

<node_container pkg="rclcpp_components" exec="$(var container_type)" name="motion_planning_container" namespace="" args="" output="screen">
<node_container pkg="rclcpp_components" exec="$(var container_type)" name="motion_planning_container" namespace="" args="" output="screen"
ros_args="--log-level planning.scenario_planning.lane_driving.motion_planning.motion_planning_container:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.motion_planning.elastic_band_smoother:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.motion_planning.path_smoother_relay:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.motion_planning.path_optimizer:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.motion_planning.path_sampler:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.motion_planning.path_to_trajectory_converter:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.motion_planning.obstacle_cruise_planner:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.motion_planning.obstacle_stop_planner:=$(var log_level) \
--log-level planning.scenario_planning.lane_driving.motion_planning.obstacle_stop_relay:=$(var log_level)">
<composable_node pkg="glog_component" plugin="GlogComponent" name="glog_component" namespace=""/>
</node_container>

Expand Down
Loading
Loading