|
30 | 30 | from launch_ros.substitutions import FindPackageShare
|
31 | 31 | import yaml
|
32 | 32 |
|
| 33 | +def get_control_cmd_topic(context): |
| 34 | + is_redundant = LaunchConfiguration('launch_redundancy_system_components').perform(context) |
| 35 | + system_run_mode = LaunchConfiguration('system_run_mode').perform(context) |
| 36 | + |
| 37 | + if is_redundant.lower() == 'true' and system_run_mode.lower() == 'planning_simulation': |
| 38 | + return '/main/control/command/control_cmd' |
| 39 | + return '/control/command/control_cmd' |
33 | 40 |
|
34 | 41 | def launch_setup(context, *args, **kwargs):
|
35 | 42 | with open(LaunchConfiguration("vehicle_param_file").perform(context), "r") as f:
|
@@ -218,7 +225,7 @@ def launch_setup(context, *args, **kwargs):
|
218 | 225 | ("input/kinematics", "/localization/kinematic_state"),
|
219 | 226 | ("input/acceleration", "/localization/acceleration"),
|
220 | 227 | ("output/vehicle_cmd_emergency", "/control/command/emergency_cmd"),
|
221 |
| - ("output/control_cmd", "/control/command/control_cmd"), |
| 228 | + ("output/control_cmd", get_control_cmd_topic(context)), |
222 | 229 | ("output/gear_cmd", "/control/command/gear_cmd"),
|
223 | 230 | ("output/turn_indicators_cmd", "/control/command/turn_indicators_cmd"),
|
224 | 231 | ("output/hazard_lights_cmd", "/control/command/hazard_lights_cmd"),
|
|
0 commit comments