Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jun 24, 2024
1 parent 717920f commit cc227c9
Show file tree
Hide file tree
Showing 21 changed files with 186 additions and 61 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<launch>
<arg name="log_level" default="WARN"/>

<node pkg="component_interface_tools" exec="service_log_checker_node" ros_args="--log-level $(var log_level)"/>
<node pkg="component_interface_tools" exec="service_log_checker_node" ros_args="--log-level $(var log_level)"/>
</launch>
44 changes: 31 additions & 13 deletions launch/tier4_control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,30 @@ def launch_setup(context, *args, **kwargs):
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")],]

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":
Expand Down Expand Up @@ -449,8 +463,12 @@ def launch_setup(context, *args, **kwargs):
name="glog_validator_component",
),
],
ros_arguments=["--log-level", ["control.control_validator_container:=", LaunchConfiguration("log_level")],
"--log-level", ["control.control_validator:=", LaunchConfiguration("log_level")]],
ros_arguments=[
"--log-level",
["control.control_validator_container:=", LaunchConfiguration("log_level")],
"--log-level",
["control.control_validator:=", LaunchConfiguration("log_level")],
],
),
]
)
Expand All @@ -459,7 +477,7 @@ def launch_setup(context, *args, **kwargs):
package="autoware_smart_mpc_trajectory_follower",
executable="pympc_trajectory_follower.py",
name="pympc_trajectory_follower",
arguments=["--ros-args", "--log-level", LaunchConfiguration("log_level")]
arguments=["--ros-args", "--log-level", LaunchConfiguration("log_level")],

Check warning on line 480 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 412 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
10 changes: 8 additions & 2 deletions launch/tier4_map_launch/launch/map.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@
<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)">
--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
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@
</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" ros_args="--log-level $(var log_level)">
<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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,19 @@
/>
<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)">
--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 @@ -28,7 +28,13 @@
/>
<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) \
Expand All @@ -37,7 +43,8 @@
--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)">
--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
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
<group if="$(var launch_parking_module)">
<push-ros-namespace namespace="parking"/>

<node_container pkg="rclcpp_components" exec="$(var container_type)" name="parking_container" namespace="" output="screen"
<node_container
pkg="rclcpp_components"
exec="$(var container_type)"
name="parking_container"
namespace=""
output="screen"
ros_args="--log-level planning.scenario_planning.parking.parking_container:=$(var log_level) \
--log-level planning.scenario_planning.parking.costmap_generator:=$(var log_level) \
--log-level planning.scenario_planning.parking.freespace_planner:=$(var log_level)">
--log-level planning.scenario_planning.parking.freespace_planner:=$(var log_level)"
>
<composable_node pkg="autoware_costmap_generator" plugin="autoware::costmap_generator::CostmapGenerator" name="costmap_generator" namespace="">
<!-- topic remap -->
<remap from="~/input/objects" to="/perception/object_recognition/objects"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@
</group>
<!-- motion velocity smoother -->
<group>
<node_container pkg="rclcpp_components" exec="component_container" name="velocity_smoother_container" namespace=""
<node_container
pkg="rclcpp_components"
exec="component_container"
name="velocity_smoother_container"
namespace=""
ros_args="--log-level planning.scenario_planning.velocity_smoother_container:=$(var log_level) \
--log-level planning.scenario_planning.velocity_smoother:=$(var log_level)">
--log-level planning.scenario_planning.velocity_smoother:=$(var log_level)"
>
<composable_node pkg="autoware_velocity_smoother" plugin="autoware::velocity_smoother::VelocitySmootherNode" name="velocity_smoother" namespace="">
<param name="algorithm_type" value="$(var velocity_smoother_type)"/>
<param from="$(var common_param_path)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,14 @@ def launch_setup(context, *args, **kwargs):
composable_node_descriptions=composable_nodes,
condition=UnlessCondition(LaunchConfiguration("use_pointcloud_container")),
output="screen",
ros_arguments=["--log-level", ["occupancy_grid_map.occupancy_grid_map_container:=", LaunchConfiguration("log_level")],
"--log-level", ["occupancy_grid_map.occupancy_grid_map_node:=", LaunchConfiguration("log_level")],
"--log-level", ["occupancy_grid_map.pointcloud_to_laserscan_node:=", LaunchConfiguration("log_level")],]
ros_arguments=[
"--log-level",
["occupancy_grid_map.occupancy_grid_map_container:=", LaunchConfiguration("log_level")],
"--log-level",
["occupancy_grid_map.occupancy_grid_map_node:=", LaunchConfiguration("log_level")],
"--log-level",
["occupancy_grid_map.pointcloud_to_laserscan_node:=", LaunchConfiguration("log_level")],
],

Check warning on line 132 in perception/probabilistic_occupancy_grid_map/launch/laserscan_based_occupancy_grid_map.launch.py

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Large Method

launch_setup increases from 94 to 102 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.
)

load_composable_nodes = LoadComposableNodes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
<arg name="log_level" default="WARN"/>

<push-ros-namespace namespace="traffic_light_arbiter"/>
<node_container pkg="rclcpp_components" exec="component_container" name="container" namespace=""
<node_container
pkg="rclcpp_components"
exec="component_container"
name="container"
namespace=""
ros_args="--log-level perception.traffic_light_recognition.traffic_light_arbiter.container:=$(var log_level) \
--log-level perception.traffic_light_recognition.traffic_light_arbiter.arbiter:=$(var log_level)">
--log-level perception.traffic_light_recognition.traffic_light_arbiter.arbiter:=$(var log_level)"
>
<composable_node pkg="traffic_light_arbiter" plugin="TrafficLightArbiter" name="arbiter">
<remap from="~/sub/vector_map" to="/map/vector_map"/>
<remap from="~/sub/perception_traffic_signals" to="$(var perception_traffic_signals)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
<arg name="mission_planner_param_path" default="$(find-pkg-share autoware_mission_planner)/config/mission_planner.param.yaml"/>
<arg name="log_level" default="WARN"/>

<node_container pkg="rclcpp_components" exec="component_container_mt" name="mission_planner_container" namespace=""
<node_container
pkg="rclcpp_components"
exec="component_container_mt"
name="mission_planner_container"
namespace=""
ros_args="--log-level planning.mission_planning.mission_planner_container:=$(var log_level) \
--log-level planning.mission_planning.mission_planner:=$(var log_level) \
--log-level planning.mission_planning.route_selector:=$(var log_level)">
--log-level planning.mission_planning.route_selector:=$(var log_level)"
>
<composable_node pkg="autoware_mission_planner" plugin="autoware::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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
<arg name="input_route" default="/planning/mission_planning/route"/>
<arg name="log_level" default="WARN"/>

<node pkg="autoware_remaining_distance_time_calculator" exec="autoware_remaining_distance_time_calculator_node" name="remaining_distance_time_calculator" output="screen" ros_args="--log-level $(var log_level)">
<node
pkg="autoware_remaining_distance_time_calculator"
exec="autoware_remaining_distance_time_calculator_node"
name="remaining_distance_time_calculator"
output="screen"
ros_args="--log-level $(var log_level)"
>
<!-- param -->
<param from="$(var remaining_distance_time_calculator_param_path)"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</include>
</group>
<group unless="$(var real)">
<node pkg="dummy_perception_publisher" exec="dummy_perception_publisher_node" name="dummy_perception_publisher" output="screen" ros_args="--log-level $(var log_level)">
<node pkg="dummy_perception_publisher" exec="dummy_perception_publisher_node" name="dummy_perception_publisher" output="screen" ros_args="--log-level $(var log_level)">
<remap from="output/dynamic_object" to="/perception/object_recognition/detection/objects_with_feature"/>
<remap from="output/objects_pose" to="debug/object_pose"/>
<remap from="output/points_raw" to="/perception/obstacle_segmentation/pointcloud"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<launch>
<arg name="log_level" default="WARN"/>

<node pkg="vehicle_door_simulator" exec="dummy_doors" name="dummy_doors" ros_args="--log-level $(var log_level)">
<node pkg="vehicle_door_simulator" exec="dummy_doors" name="dummy_doors" ros_args="--log-level $(var log_level)">
<remap from="~/doors/command" to="/vehicle/doors/command"/>
<remap from="~/doors/layout" to="/vehicle/doors/layout"/>
<remap from="~/doors/status" to="/vehicle/doors/status"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ def launch_setup(context, *args, **kwargs):
package="rclcpp_components",
executable="component_container",
composable_node_descriptions=[component],
ros_arguments=["--log-level", ["system.component_state_monitor.container:=" , LaunchConfiguration("log_level")],
"--log-level", ["system.component_state_monitor.component:=" , LaunchConfiguration("log_level")],],
ros_arguments=[
"--log-level",
["system.component_state_monitor.container:=", LaunchConfiguration("log_level")],
"--log-level",
["system.component_state_monitor.component:=", LaunchConfiguration("log_level")],
],
)
return [container, *topic_monitor_nodes]

Expand Down
Loading

0 comments on commit cc227c9

Please sign in to comment.