From 97561d7802eddb899f1c4f0a3a3ae9aa4c26bb73 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Fri, 19 Jul 2024 17:11:59 +0200 Subject: [PATCH] Commander: never allow to switch out of Terminate state with user intend Signed-off-by: Silvan Fuhrer --- src/modules/commander/UserModeIntention.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/commander/UserModeIntention.cpp b/src/modules/commander/UserModeIntention.cpp index ac56b9f782..02b4a7f3f7 100644 --- a/src/modules/commander/UserModeIntention.cpp +++ b/src/modules/commander/UserModeIntention.cpp @@ -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;