Commander: never allow to switch out of Terminate state with user intend

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2024-07-19 17:11:59 +02:00
parent ee8030de56
commit 97561d7802
@@ -69,6 +69,9 @@ bool UserModeIntention::change(uint8_t user_intended_nav_state, ModeChangeSource
}
}
// never allow to change out of termination state
allow_change &= _vehicle_status.nav_state != vehicle_status_s::NAVIGATION_STATE_TERMINATION;
if (allow_change) {
_had_mode_change = true;
_user_intented_nav_state = user_intended_nav_state;