Skip to content

Commit

Permalink
Commander: never allow to switch out of Terminate state with user intend
Browse files Browse the repository at this point in the history
Signed-off-by: Silvan Fuhrer <[email protected]>
  • Loading branch information
sfuhrer committed Jul 26, 2024
1 parent ee8030d commit 97561d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/commander/UserModeIntention.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 97561d7

Please sign in to comment.