Skip to content

Commit

Permalink
feat(tier4_planning_launch): declare param path argument (#1337)
Browse files Browse the repository at this point in the history
* feat(tier4_planning_launch): declare param path argument

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* Update launch/tier4_planning_launch/launch/planning.launch.xml

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update launch/tier4_planning_launch/launch/planning.launch.xml

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
  • Loading branch information
takayuki5168 and kenji-miyake authored Jul 25, 2022
1 parent 5e09191 commit 34a74ab
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 62 deletions.
4 changes: 4 additions & 0 deletions launch/tier4_planning_launch/launch/planning.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

<arg name="vehicle_info_param_file"/>

<!-- parameter path -->
<arg name="tier4_planning_launch_param_path" default="$(find-pkg-share tier4_planning_launch)/config" description="tier4_planning_launch parameter path"/>

<!-- pointcloud container -->
<arg name="use_pointcloud_container" default="false"/>
<arg name="pointcloud_container_name" default="pointcloud_container"/>
Expand All @@ -22,6 +25,7 @@
<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="tier4_planning_launch_param_path" value="$(var tier4_planning_launch_param_path)"/>
</include>
</group>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<launch>
<!-- common param -->
<arg name="tier4_planning_launch_param_path"/>
<arg name="common_param_path"/>
<arg name="vehicle_info_param_file"/>

Expand All @@ -17,6 +18,7 @@
<include file="$(find-pkg-share tier4_planning_launch)/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.py">
<arg name="vehicle_info_param_file" value="$(var vehicle_info_param_file)"/>
<arg name="use_multithread" value="true"/>
<arg name="tier4_planning_launch_param_path" value="$(var tier4_planning_launch_param_path)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="container_name" value="$(var pointcloud_container_name)"/>
</include>
Expand All @@ -37,6 +39,7 @@
<push-ros-namespace namespace="motion_planning"/>
<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="tier4_planning_launch_param_path" value="$(var tier4_planning_launch_param_path)"/>
<arg name="use_multithread" value="true"/>
</include>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import os

from ament_index_python.packages import get_package_share_directory
import launch
from launch.actions import DeclareLaunchArgument
from launch.actions import GroupAction
Expand All @@ -41,8 +40,7 @@ def launch_setup(context, *args, **kwargs):

# behavior path planner
side_shift_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -54,8 +52,7 @@ def launch_setup(context, *args, **kwargs):
side_shift_param = yaml.safe_load(f)["/**"]["ros__parameters"]

avoidance_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -67,8 +64,7 @@ def launch_setup(context, *args, **kwargs):
avoidance_param = yaml.safe_load(f)["/**"]["ros__parameters"]

lane_change_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -80,8 +76,7 @@ def launch_setup(context, *args, **kwargs):
lane_change_param = yaml.safe_load(f)["/**"]["ros__parameters"]

lane_following_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -93,8 +88,7 @@ def launch_setup(context, *args, **kwargs):
lane_following_param = yaml.safe_load(f)["/**"]["ros__parameters"]

pull_over_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -106,8 +100,7 @@ def launch_setup(context, *args, **kwargs):
pull_over_param = yaml.safe_load(f)["/**"]["ros__parameters"]

pull_out_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -119,8 +112,7 @@ def launch_setup(context, *args, **kwargs):
pull_out_param = yaml.safe_load(f)["/**"]["ros__parameters"]

behavior_path_planner_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand Down Expand Up @@ -167,8 +159,7 @@ def launch_setup(context, *args, **kwargs):

# smoother param
common_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"common",
"common.param.yaml",
Expand All @@ -177,8 +168,7 @@ def launch_setup(context, *args, **kwargs):
common_param = yaml.safe_load(f)["/**"]["ros__parameters"]

motion_velocity_smoother_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"common",
"motion_velocity_smoother",
Expand All @@ -188,8 +178,7 @@ def launch_setup(context, *args, **kwargs):
motion_velocity_smoother_param = yaml.safe_load(f)["/**"]["ros__parameters"]

smoother_type_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"common",
"motion_velocity_smoother",
Expand All @@ -200,8 +189,7 @@ def launch_setup(context, *args, **kwargs):

# behavior velocity planner
blind_spot_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -212,8 +200,7 @@ def launch_setup(context, *args, **kwargs):
blind_spot_param = yaml.safe_load(f)["/**"]["ros__parameters"]

crosswalk_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -224,8 +211,7 @@ def launch_setup(context, *args, **kwargs):
crosswalk_param = yaml.safe_load(f)["/**"]["ros__parameters"]

detection_area_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -236,8 +222,7 @@ def launch_setup(context, *args, **kwargs):
detection_area_param = yaml.safe_load(f)["/**"]["ros__parameters"]

intersection_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -248,8 +233,7 @@ def launch_setup(context, *args, **kwargs):
intersection_param = yaml.safe_load(f)["/**"]["ros__parameters"]

stop_line_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -260,8 +244,7 @@ def launch_setup(context, *args, **kwargs):
stop_line_param = yaml.safe_load(f)["/**"]["ros__parameters"]

traffic_light_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -272,8 +255,7 @@ def launch_setup(context, *args, **kwargs):
traffic_light_param = yaml.safe_load(f)["/**"]["ros__parameters"]

virtual_traffic_light_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -284,8 +266,7 @@ def launch_setup(context, *args, **kwargs):
virtual_traffic_light_param = yaml.safe_load(f)["/**"]["ros__parameters"]

occlusion_spot_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -296,8 +277,7 @@ def launch_setup(context, *args, **kwargs):
occlusion_spot_param = yaml.safe_load(f)["/**"]["ros__parameters"]

no_stopping_area_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -308,8 +288,7 @@ def launch_setup(context, *args, **kwargs):
no_stopping_area_param = yaml.safe_load(f)["/**"]["ros__parameters"]

run_out_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand All @@ -320,8 +299,7 @@ def launch_setup(context, *args, **kwargs):
run_out_param = yaml.safe_load(f)["/**"]["ros__parameters"]

behavior_velocity_planner_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"behavior_planning",
Expand Down Expand Up @@ -467,6 +445,8 @@ def add_launch_arg(name: str, default_value=None, description=None):
)
add_launch_arg("map_topic_name", "/map/vector_map", "input topic of map")

add_launch_arg("tier4_planning_launch_param_path", None, "tier4_planning_launch parameter path")

# component
add_launch_arg("use_intra_process", "false", "use ROS2 component container communication")
add_launch_arg("use_multithread", "false", "use multithread")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import os

from ament_index_python.packages import get_package_share_directory
import launch
from launch.actions import DeclareLaunchArgument
from launch.actions import GroupAction
Expand All @@ -39,8 +38,7 @@ def launch_setup(context, *args, **kwargs):

# planning common param path
common_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"common",
"common.param.yaml",
Expand All @@ -50,8 +48,7 @@ def launch_setup(context, *args, **kwargs):

# obstacle avoidance planner
obstacle_avoidance_planner_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"motion_planning",
Expand Down Expand Up @@ -81,8 +78,7 @@ def launch_setup(context, *args, **kwargs):

# surround obstacle checker
surround_obstacle_checker_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"motion_planning",
Expand Down Expand Up @@ -120,17 +116,15 @@ def launch_setup(context, *args, **kwargs):

# obstacle stop planner
obstacle_stop_planner_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"motion_planning",
"obstacle_stop_planner",
"obstacle_stop_planner.param.yaml",
)
obstacle_stop_planner_acc_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"motion_planning",
Expand Down Expand Up @@ -175,8 +169,7 @@ def launch_setup(context, *args, **kwargs):

# obstacle cruise planner
obstacle_cruise_planner_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"lane_driving",
"motion_planning",
Expand Down Expand Up @@ -296,6 +289,8 @@ def add_launch_arg(name: str, default_value=None, description=None):
"cruise_planner", "obstacle_stop_planner", "cruise planner type"
) # select from "obstacle_stop_planner", "obstacle_cruise_planner", "none"

add_launch_arg("tier4_planning_launch_param_path", None, "tier4_planning_launch parameter path")

add_launch_arg("use_intra_process", "false", "use ROS2 component container communication")
add_launch_arg("use_multithread", "false", "use multithread")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import os

from ament_index_python.packages import get_package_share_directory
import launch
from launch.actions import DeclareLaunchArgument
from launch.actions import GroupAction
Expand All @@ -37,8 +36,7 @@ def launch_setup(context, *args, **kwargs):
vehicle_info_param = yaml.safe_load(f)["/**"]["ros__parameters"]

freespace_planner_param_path = os.path.join(
get_package_share_directory("tier4_planning_launch"),
"config",
LaunchConfiguration("tier4_planning_launch_param_path").perform(context),
"scenario_planning",
"parking",
"freespace_planner",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<launch>
<!-- common param -->
<arg name="common_param_path" default="$(find-pkg-share tier4_planning_launch)/config/scenario_planning/common/common.param.yaml"/>
<arg name="tier4_planning_launch_param_path"/>
<arg name="common_param_path" default="$(var tier4_planning_launch_param_path)/scenario_planning/common/common.param.yaml"/>
<arg name="vehicle_info_param_file"/>

<!-- pointcloud container -->
Expand All @@ -23,7 +24,7 @@

<!-- velocity planning with max velocity, acceleration, jerk, stop point constraint -->
<group>
<arg name="param_path" default="$(find-pkg-share tier4_planning_launch)/config/scenario_planning/common/motion_velocity_smoother/motion_velocity_smoother.param.yaml"/>
<arg name="param_path" default="$(var tier4_planning_launch_param_path)/scenario_planning/common/motion_velocity_smoother/motion_velocity_smoother.param.yaml"/>
<!-- external velocity limit selector -->
<group>
<include file="$(find-pkg-share external_velocity_limit_selector)/launch/external_velocity_limit_selector.launch.xml">
Expand All @@ -40,7 +41,7 @@
<arg name="smoother_type" value="$(var smoother_type)"/>
<arg name="common_param_path" value="$(var common_param_path)"/>
<arg name="param_path" value="$(var param_path)"/>
<arg name="smoother_param_path" value="$(find-pkg-share tier4_planning_launch)/config/scenario_planning/common/motion_velocity_smoother/$(var smoother_type).param.yaml"/>
<arg name="smoother_param_path" value="$(var tier4_planning_launch_param_path)/scenario_planning/common/motion_velocity_smoother/$(var smoother_type).param.yaml"/>
</include>
</group>
</group>
Expand All @@ -54,6 +55,7 @@
<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="tier4_planning_launch_param_path" value="$(var tier4_planning_launch_param_path)"/>
</include>
</group>
<!-- parking -->
Expand Down

0 comments on commit 34a74ab

Please sign in to comment.