Skip to content

Commit

Permalink
Commander: do not switch out of Terminte after disarm
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 0b1eba9 commit ee8030d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/modules/commander/UserModeIntention.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ bool UserModeIntention::change(uint8_t user_intended_nav_state, ModeChangeSource
_had_mode_change = true;
_user_intented_nav_state = user_intended_nav_state;

if (!_health_and_arming_checks.modePreventsArming(user_intended_nav_state)) {
// Special case termination state: even though this mode prevents arming,
// still don't switch out of it after disarm and thus store it in _nav_state_after_disarming.
if (!_health_and_arming_checks.modePreventsArming(user_intended_nav_state)
|| user_intended_nav_state == vehicle_status_s::NAVIGATION_STATE_TERMINATION) {
_nav_state_after_disarming = user_intended_nav_state;
}

Expand Down

0 comments on commit ee8030d

Please sign in to comment.