Skip to content

Commit

Permalink
refactor(tier4_planning_launch): organize arguments (autowarefoundati…
Browse files Browse the repository at this point in the history
…on#2666)

* refactor(tier4_planning_launch): organize arguments

Signed-off-by: Takayuki Murooka <[email protected]>

* update

Signed-off-by: Takayuki Murooka <[email protected]>

Signed-off-by: Takayuki Murooka <[email protected]>
  • Loading branch information
takayuki5168 authored and maxime-clem committed Jan 30, 2023
1 parent 3946167 commit f21fa9a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 33 deletions.
5 changes: 4 additions & 1 deletion launch/tier4_planning_launch/launch/planning.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<arg name="vehicle_param_file"/>
<arg name="use_pointcloud_container"/>
<arg name="pointcloud_container_name"/>
<arg name="smoother_type"/>
<arg name="use_surround_obstacle_check"/>

<!-- common -->
<arg name="common_param_path"/>
Expand Down Expand Up @@ -65,6 +65,9 @@
<arg name="vehicle_param_file" value="$(var vehicle_param_file)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
<arg name="use_surround_obstacle_check" value="$(var use_surround_obstacle_check)"/>
<arg name="cruise_planner_type" value="$(var cruise_planner_type)"/>
<arg name="use_experimental_lane_change_function" value="$(var use_experimental_lane_change_function)"/>
</include>
</group>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<include file="$(find-pkg-share tier4_planning_launch)/launch/scenario_planning/lane_driving/motion_planning/motion_planning.launch.py">
<arg name="vehicle_param_file" value="$(var vehicle_param_file)"/>
<arg name="use_multithread" value="true"/>
<arg name="use_surround_obstacle_check" value="$(var use_surround_obstacle_check)"/>
<arg name="cruise_planner_type" value="$(var cruise_planner_type)"/>
<arg name="use_experimental_lane_change_function" value="$(var use_experimental_lane_change_function)"/>
</include>
</group>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,19 @@ def launch_setup(context, *args, **kwargs):
behavior_path_planner_param,
vehicle_param,
{
"bt_tree_config_path": [
FindPackageShare("behavior_path_planner"),
"/config/behavior_path_planner_tree.xml",
],
"planning_hz": 10.0,
"lane_change.enable_abort_lane_change": LaunchConfiguration(
"use_experimental_lane_change_function"
),
"lane_change.enable_collision_check_at_prepare_phase": LaunchConfiguration(
"use_experimental_lane_change_function"
),
"lane_change.use_predicted_path_outside_lanelet": LaunchConfiguration(
"use_experimental_lane_change_function"
),
"lane_change.use_all_predicted_path": LaunchConfiguration(
"use_experimental_lane_change_function"
),
"bt_tree_config_path": LaunchConfiguration("behavior_path_planner_tree_param_path"),
},
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
Expand Down Expand Up @@ -280,15 +288,10 @@ def add_launch_arg(name: str, default_value=None, description=None):
DeclareLaunchArgument(name, default_value=default_value, description=description)
)

add_launch_arg(
"vehicle_param_file",
[
FindPackageShare("vehicle_info_util"),
"/config/vehicle_info.param.yaml",
],
"path to the parameter file of vehicle information",
)
# vehicle parameter
add_launch_arg("vehicle_param_file")

# interface parameter
add_launch_arg(
"input_route_topic_name", "/planning/mission_planning/route", "input topic of route"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from launch_ros.actions import ComposableNodeContainer
from launch_ros.actions import LoadComposableNodes
from launch_ros.descriptions import ComposableNode
from launch_ros.substitutions import FindPackageShare
import yaml


Expand Down Expand Up @@ -61,8 +60,6 @@ def launch_setup(context, *args, **kwargs):
nearest_search_param,
obstacle_avoidance_planner_param,
vehicle_info_param,
{"is_showing_debug_info": False},
{"is_stopping_if_outside_drivable_area": True},
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)
Expand Down Expand Up @@ -220,19 +217,19 @@ def launch_setup(context, *args, **kwargs):
obstacle_stop_planner_loader = LoadComposableNodes(
composable_node_descriptions=[obstacle_stop_planner_component],
target_container=container,
condition=LaunchConfigurationEquals("cruise_planner", "obstacle_stop_planner"),
condition=LaunchConfigurationEquals("cruise_planner_type", "obstacle_stop_planner"),
)

obstacle_cruise_planner_loader = LoadComposableNodes(
composable_node_descriptions=[obstacle_cruise_planner_component],
target_container=container,
condition=LaunchConfigurationEquals("cruise_planner", "obstacle_cruise_planner"),
condition=LaunchConfigurationEquals("cruise_planner_type", "obstacle_cruise_planner"),
)

obstacle_cruise_planner_relay_loader = LoadComposableNodes(
composable_node_descriptions=[obstacle_cruise_planner_relay_component],
target_container=container,
condition=LaunchConfigurationEquals("cruise_planner", "none"),
condition=LaunchConfigurationEquals("cruise_planner_type", "none"),
)

surround_obstacle_checker_loader = LoadComposableNodes(
Expand Down Expand Up @@ -261,27 +258,20 @@ def add_launch_arg(name: str, default_value=None, description=None):
DeclareLaunchArgument(name, default_value=default_value, description=description)
)

# vehicle information parameter file
add_launch_arg(
"vehicle_param_file",
[
FindPackageShare("vehicle_info_util"),
"/config/vehicle_info.param.yaml",
],
"path to the parameter file of vehicle information",
)
# vehicle parameter
add_launch_arg("vehicle_param_file")

# obstacle_avoidance_planner
# interface parameter
add_launch_arg(
"input_path_topic",
"/planning/scenario_planning/lane_driving/behavior_planning/path",
"input path topic of obstacle_avoidance_planner",
)

# surround obstacle checker
add_launch_arg("use_surround_obstacle_check", "true", "launch surround_obstacle_checker or not")
# package parameter
add_launch_arg("use_surround_obstacle_check") # launch surround_obstacle_checker or not
add_launch_arg(
"cruise_planner", "obstacle_stop_planner", "cruise planner type"
"cruise_planner_type"
) # select from "obstacle_stop_planner", "obstacle_cruise_planner", "none"

add_launch_arg("use_intra_process", "false", "use ROS2 component container communication")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<arg name="vehicle_param_file" value="$(var vehicle_param_file)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
<arg name="use_surround_obstacle_check" value="$(var use_surround_obstacle_check)"/>
<arg name="cruise_planner_type" value="$(var cruise_planner_type)"/>
<arg name="use_experimental_lane_change_function" value="$(var use_experimental_lane_change_function)"/>
</include>
</group>
<!-- parking -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**:
ros__parameters:
planning_hz: 10.0

backward_path_length: 5.0
forward_path_length: 200.0
backward_length_buffer_for_end_of_pull_over: 5.0
Expand Down

0 comments on commit f21fa9a

Please sign in to comment.