Copter: fully honour FENCE_OPTION to disable mode changes

when the user has chosen to disallow mode change during fence breach
it should be fully implemented, without a landing exception.

as requested by Pete, and discussed on dev call
This commit is contained in:
Andrew Tridgell 2024-07-23 09:59:50 +10:00 committed by Peter Barker
parent f8e5c7c1c4
commit a371a3eb89
1 changed files with 0 additions and 1 deletions

View File

@ -353,7 +353,6 @@ bool Copter::set_mode(Mode::Number mode, ModeReason reason)
fence.enabled() && fence.enabled() &&
fence.option_enabled(AC_Fence::OPTIONS::DISABLE_MODE_CHANGE) && fence.option_enabled(AC_Fence::OPTIONS::DISABLE_MODE_CHANGE) &&
fence.get_breaches() && fence.get_breaches() &&
!flightmode->is_landing() &&
motors->armed() && motors->armed() &&
get_control_mode_reason() == ModeReason::FENCE_BREACHED && get_control_mode_reason() == ModeReason::FENCE_BREACHED &&
!ap.land_complete) { !ap.land_complete) {