Skip to content

Commit e5f9584

Browse files
authored
fix(vehicle_cmd_gate): auto mode check (#4333)
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
1 parent eaf0d10 commit e5f9584

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,9 @@ AckermannControlCommand VehicleCmdGate::filterControlCommand(const AckermannCont
527527
// set prev value for both to keep consistency over switching:
528528
// Actual steer, vel, acc should be considered in manual mode to prevent sudden motion when
529529
// switching from manual to autonomous
530-
auto prev_values = (mode.mode == OperationModeState::AUTONOMOUS) ? out : current_status_cmd;
530+
const auto in_autonomous =
531+
(mode.mode == OperationModeState::AUTONOMOUS && mode.is_autoware_control_enabled);
532+
auto prev_values = in_autonomous ? out : current_status_cmd;
531533

532534
if (ego_is_stopped) {
533535
prev_values.longitudinal = out.longitudinal;

0 commit comments

Comments
 (0)