mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 08:38:53 +08:00
commander/failsafe: fix user takeover not possible in fallback Land action when configured RTL is not possible
This commit is contained in:
@@ -499,9 +499,9 @@ void FailsafeBase::getSelectedAction(const State &state, const failsafe_flags_s
|
||||
allow_user_takeover = UserTakeoverAllowed::AlwaysModeSwitchOnly;
|
||||
}
|
||||
|
||||
// User takeover is activated on user intented mode update (w/o action change, so takeover is not immediately
|
||||
// requested when entering failsafe) or rc stick movements
|
||||
bool want_user_takeover_mode_switch = user_intended_mode_updated && _selected_action == selected_action;
|
||||
// User takeover interrupting a failsafe is triggered by a change of the user-intended mode
|
||||
// (only if a failsafe action is already active otherwise there can be immediate takeover when entering a failsafe) or by stick movement
|
||||
bool want_user_takeover_mode_switch = user_intended_mode_updated && (_selected_action > Action::Warn);
|
||||
bool want_user_takeover = want_user_takeover_mode_switch || rc_sticks_takeover_request;
|
||||
bool takeover_allowed =
|
||||
(allow_user_takeover == UserTakeoverAllowed::Always && (_user_takeover_active || want_user_takeover))
|
||||
|
||||
Reference in New Issue
Block a user