Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tier4_control_launch): switch control cmd topic #1685

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion launch/tier4_control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
from launch_ros.substitutions import FindPackageShare
import yaml

def get_control_cmd_topic(context):
is_redundant = LaunchConfiguration('launch_redundancy_system_components').perform(context)
system_run_mode = LaunchConfiguration('system_run_mode').perform(context)

if is_redundant.lower() == 'true' and system_run_mode.lower() == 'planning_simulation':
return '/main/control/command/control_cmd'
return '/control/command/control_cmd'

def launch_setup(context, *args, **kwargs):
with open(LaunchConfiguration("vehicle_param_file").perform(context), "r") as f:
Expand Down Expand Up @@ -218,7 +225,7 @@ def launch_setup(context, *args, **kwargs):
("input/kinematics", "/localization/kinematic_state"),
("input/acceleration", "/localization/acceleration"),
("output/vehicle_cmd_emergency", "/control/command/emergency_cmd"),
("output/control_cmd", "/control/command/control_cmd"),
("output/control_cmd", get_control_cmd_topic(context)),
("output/gear_cmd", "/control/command/gear_cmd"),
("output/turn_indicators_cmd", "/control/command/turn_indicators_cmd"),
("output/hazard_lights_cmd", "/control/command/hazard_lights_cmd"),
Expand Down
Loading