Skip to content

Commit

Permalink
refactor(control_launch): organize trajectory_follower_node's param (a…
Browse files Browse the repository at this point in the history
…utowarefoundation#661)

* refactor(control_launch): organize trajectory_follower_node's param

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

* fix

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

Signed-off-by: Takayuki Murooka <[email protected]>
  • Loading branch information
takayuki5168 authored Dec 28, 2022
1 parent 0302028 commit 094e11d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**:
ros__parameters:
ctrl_period: 0.03
timeout_thr_sec: 0.5
32 changes: 29 additions & 3 deletions control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def launch_setup(context, *args, **kwargs):
lon_controller_param_path = LaunchConfiguration("lon_controller_param_path").perform(context)
with open(lon_controller_param_path, "r") as f:
lon_controller_param = yaml.safe_load(f)["/**"]["ros__parameters"]
trajectory_follower_node_param_path = LaunchConfiguration(
"trajectory_follower_node_param_path"
).perform(context)
with open(trajectory_follower_node_param_path, "r") as f:
trajectory_follower_node_param = yaml.safe_load(f)["/**"]["ros__parameters"]
vehicle_cmd_gate_param_path = LaunchConfiguration("vehicle_cmd_gate_param_path").perform(
context
)
Expand Down Expand Up @@ -83,6 +88,7 @@ def launch_setup(context, *args, **kwargs):
"longitudinal_controller_mode": LaunchConfiguration("longitudinal_controller_mode"),
},
nearest_search_param,
trajectory_follower_node_param,
lon_controller_param,
lat_controller_param,
],
Expand Down Expand Up @@ -208,7 +214,12 @@ def launch_setup(context, *args, **kwargs):
launch_arguments=[
("use_intra_process", LaunchConfiguration("use_intra_process")),
("target_container", "/control/control_container"),
("initial_selector_mode", LaunchConfiguration("initial_selector_mode")),
# This is temporary uncomment. I will replace control_launch with tier4_control_launch soon.
# ("initial_selector_mode", LaunchConfiguration("initial_selector_mode")),
(
"external_cmd_selector_param_path",
LaunchConfiguration("external_cmd_selector_param_path"),
),
],
)

Expand Down Expand Up @@ -284,15 +295,23 @@ def add_launch_arg(name: str, default_value=None, description=None):
"lat_controller_param_path",
[
FindPackageShare("control_launch"),
"/config/mpc_lateral_controller/mpc_lateral_controller.param.yaml",
"/config/trajectory_follower/lateral/mpc.param.yaml",
],
"path to the parameter file of lateral controller. default is `mpc_follower`",
)
add_launch_arg(
"lon_controller_param_path",
[
FindPackageShare("control_launch"),
"/config/pid_longitudinal_controller/pid_longitudinal_controller.param.yaml",
"/config/trajectory_follower/longitudinal/pid.param.yaml",
],
"path to the parameter file of longitudinal controller",
)
add_launch_arg(
"trajectory_follower_node_param_path",
[
FindPackageShare("control_launch"),
"/config/trajectory_follower/trajectory_follower_node.param.yaml",
],
"path to the parameter file of longitudinal controller",
)
Expand Down Expand Up @@ -332,6 +351,13 @@ def add_launch_arg(name: str, default_value=None, description=None):

# external cmd selector
add_launch_arg("initial_selector_mode", "remote", "local or remote")
add_launch_arg(
"external_cmd_selector_param_path",
[
FindPackageShare("external_cmd_selector"),
"/config/external_cmd_selector.param.yaml",
],
)

# component
add_launch_arg("use_intra_process", "false", "use ROS2 component container communication")
Expand Down

0 comments on commit 094e11d

Please sign in to comment.