mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-15 10:50:34 +08:00
commander: prevent setting nav_state to takeoff after disarming (#25735)
* commander: prevent setting nav_state after disarming to takeoff * wrap in function
This commit is contained in:
@@ -77,7 +77,8 @@ bool UserModeIntention::change(uint8_t user_intended_nav_state, ModeChangeSource
|
||||
|
||||
// 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)
|
||||
if ((!_health_and_arming_checks.modePreventsArming(user_intended_nav_state)
|
||||
&& !isTakeOffIntended(user_intended_nav_state))
|
||||
|| user_intended_nav_state == vehicle_status_s::NAVIGATION_STATE_TERMINATION) {
|
||||
_nav_state_after_disarming = user_intended_nav_state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user