Skip to content

Commit

Permalink
refactor(tier4_planning_launch): organize parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 committed Jul 11, 2022
1 parent 9375358 commit 5c49090
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 13 deletions.
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: 300.0
backward_length_buffer_for_end_of_lane: 5.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**:
ros__parameters:
enable_slow_down: False

stop_planner:
stop_margin: 5.0 # stop margin distance from obstacle on the path [m]
min_behavior_stop_margin: 5.0 # stop margin distance when any other stop point is inserted in stop margin [m]
Expand Down
8 changes: 8 additions & 0 deletions launch/tier4_planning_launch/launch/planning.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<!-- pointcloud container -->
<arg name="use_pointcloud_container" default="false"/>
<arg name="pointcloud_container_name" default="pointcloud_container"/>
<arg name="bt_tree_config_file" default="$(find-pkg-share behavior_path_planner)/config/behavior_path_planner_tree.xml"/>
<arg name="use_surround_obstacle_check" default="true"/>
<arg name="cruise_planner" default="obstacle_stop_planner" description="cruise planner type. options: obstacle_stop_planner, obstacle_cruise_planner, none"/>
<arg name="smoother_type" default="JerkFiltered" description="options: JerkFiltered, L2, Analytical, Linf(Unstable)"/>

<group>
<push-ros-namespace namespace="planning"/>
Expand All @@ -22,6 +26,10 @@
<arg name="vehicle_info_param_file" value="$(var vehicle_info_param_file)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
<arg name="bt_tree_config_file" value="$(var bt_tree_config_file)"/>
<arg name="use_surround_obstacle_check" value="$(var use_surround_obstacle_check)"/>
<arg name="cruise_planner" value="$(var cruise_planner)"/>
<arg name="smoother_type" value="$(var smoother_type)"/>
</include>
</group>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<!-- pointcloud container -->
<arg name="use_pointcloud_container"/>
<arg name="pointcloud_container_name"/>
<arg name="bt_tree_config_file"/>
<arg name="use_surround_obstacle_check"/>
<arg name="cruise_planner"/>

<!-- lane_driving scenario -->
<group>
Expand All @@ -18,6 +21,7 @@
<arg name="use_multithread" value="true"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="container_name" value="$(var pointcloud_container_name)"/>
<arg name="bt_tree_config_file" value="$(var bt_tree_config_file)"/>
</include>

<arg
Expand All @@ -35,6 +39,8 @@
<include file="$(find-pkg-share tier4_planning_launch)/launch/scenario_planning/lane_driving/motion_planning/motion_planning.launch.py">
<arg name="vehicle_info_param_file" value="$(var vehicle_info_param_file)"/>
<arg name="use_multithread" value="true"/>
<arg name="use_surround_obstacle_check" value="$(var use_surround_obstacle_check)"/>
<arg name="cruise_planner" value="$(var cruise_planner)"/>
</include>
</group>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def launch_setup(context, *args, **kwargs):
vehicle_info_param = yaml.safe_load(f)["/**"]["ros__parameters"]

# behavior path planner
bt_tree_config_path = LaunchConfiguration("bt_tree_config_file").perform(context)

side_shift_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
Expand Down Expand Up @@ -180,13 +182,7 @@ def launch_setup(context, *args, **kwargs):
pull_out_param,
behavior_path_planner_param,
vehicle_info_param,
{
"bt_tree_config_path": [
FindPackageShare("behavior_path_planner"),
"/config/behavior_path_planner_tree.xml",
],
"planning_hz": 10.0,
},
{"bt_tree_config_path": bt_tree_config_path},
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ def launch_setup(context, *args, **kwargs):
parameters=[
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 @@ -168,7 +166,6 @@ def launch_setup(context, *args, **kwargs):
obstacle_stop_planner_param,
obstacle_stop_planner_acc_param,
vehicle_info_param,
{"enable_slow_down": False},
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)
Expand Down Expand Up @@ -291,9 +288,9 @@ def add_launch_arg(name: str, default_value=None, description=None):
)

# surround obstacle checker
add_launch_arg("use_surround_obstacle_check", "true", "launch surround_obstacle_checker or not")
add_launch_arg("use_surround_obstacle_check", None, "launch surround_obstacle_checker or not")
add_launch_arg(
"cruise_planner", "obstacle_stop_planner", "cruise planner type"
"cruise_planner", None, "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 @@ -6,6 +6,10 @@
<!-- pointcloud container -->
<arg name="use_pointcloud_container"/>
<arg name="pointcloud_container_name"/>
<arg name="bt_tree_config_file"/>
<arg name="use_surround_obstacle_check"/>
<arg name="cruise_planner"/>
<arg name="smoother_type"/>

<!-- scenario selector -->
<include file="$(find-pkg-share scenario_selector)/launch/scenario_selector.launch.xml">
Expand All @@ -28,7 +32,6 @@
<arg name="param_path" value="$(var param_path)"/>
</include>
<!-- motion velocity smoother -->
<arg name="smoother_type" default="JerkFiltered" description="options: JerkFiltered, L2, Analytical, Linf(Unstable)"/>
<set_remap from="~/input/trajectory" to="/planning/scenario_planning/scenario_selector/trajectory"/>
<set_remap from="~/output/trajectory" to="/planning/scenario_planning/trajectory"/>
<include file="$(find-pkg-share motion_velocity_smoother)/launch/motion_velocity_smoother.launch.xml">
Expand All @@ -47,6 +50,9 @@
<arg name="vehicle_info_param_file" value="$(var vehicle_info_param_file)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
<arg name="bt_tree_config_file" value="$(var bt_tree_config_file)"/>
<arg name="use_surround_obstacle_check" value="$(var use_surround_obstacle_check)"/>
<arg name="cruise_planner" value="$(var cruise_planner)"/>
</include>
<!-- parking -->
<include file="$(find-pkg-share tier4_planning_launch)/launch/scenario_planning/parking.launch.py">
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_lane: 5.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**:
ros__parameters:
enable_slow_down: False

stop_planner:
stop_margin: 5.0 # stop margin distance from obstacle on the path [m]
min_behavior_stop_margin: 2.0 # stop margin distance when any other stop point is inserted in stop margin [m]
Expand Down

0 comments on commit 5c49090

Please sign in to comment.