Skip to content

Commit

Permalink
feat(shift_decider): add config file (autowarefoundation#1857)
Browse files Browse the repository at this point in the history
* feat(shift_decider): add config file

Signed-off-by: lilyildiz <y.yzk61@gmail.com>

* feat(tier4_control_launch): add shift_decider.param.yaml

Signed-off-by: lilyildiz <y.yzk61@gmail.com>

* ci(pre-commit): autofix

Signed-off-by: lilyildiz <y.yzk61@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and boyali committed Oct 3, 2022
1 parent c44202e commit d8db49c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions control/shift_decider/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ rclcpp_components_register_node(shift_decider_node
ament_auto_package(
INSTALL_TO_SHARE
launch
config
)
3 changes: 3 additions & 0 deletions control/shift_decider/config/shift_decider.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**:
ros__parameters:
park_on_goal: true
4 changes: 3 additions & 1 deletion control/shift_decider/launch/shift_decider.launch.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<launch>
<arg name="config_file" default="$(find-pkg-share shift_decider)/config/shift_decider.param.yaml"/>

<node pkg="shift_decider" exec="shift_decider" name="shift_decider" output="screen">
<remap from="input/control_cmd" to="/control/trajectory_follower/control_cmd"/>
<remap from="input/state" to="/autoware/state"/>
<remap from="output/gear_cmd" to="/control/shift_decider/gear_cmd"/>
<param name="park_on_goal" value="true"/>
<param from="$(var config_file)"/>
</node>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**:
ros__parameters:
park_on_goal: true
12 changes: 9 additions & 3 deletions launch/tier4_control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ def launch_setup(context, *args, **kwargs):
with open(operation_mode_transition_manager_param_path, "r") as f:
operation_mode_transition_manager_param = yaml.safe_load(f)["/**"]["ros__parameters"]

shift_decider_param_path = os.path.join(
LaunchConfiguration("tier4_control_launch_param_path").perform(context),
"shift_decider",
"shift_decider.param.yaml",
)
with open(shift_decider_param_path, "r") as f:
shift_decider_param = yaml.safe_load(f)["/**"]["ros__parameters"]

controller_component = ComposableNode(
package="trajectory_follower_nodes",
plugin="autoware::motion::control::trajectory_follower_nodes::Controller",
Expand Down Expand Up @@ -141,9 +149,7 @@ def launch_setup(context, *args, **kwargs):
("output/gear_cmd", "/control/shift_decider/gear_cmd"),
],
parameters=[
{
"park_on_goal": True,
}
shift_decider_param,
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)
Expand Down

0 comments on commit d8db49c

Please sign in to comment.