Copter: only disable fences when in landing phase

This commit is contained in:
Andy Piper 2024-06-25 17:06:56 +01:00 committed by Peter Barker
parent b7ce3ff286
commit 8c0c84b7ab

View File

@ -10,10 +10,7 @@ void Copter::fence_check()
{
const uint8_t orig_breaches = fence.get_breaches();
bool is_in_landing = flightmode->mode_number() == Mode::Number::LAND
|| flightmode->mode_number() == Mode::Number::RTL
|| flightmode->mode_number() == Mode::Number::SMART_RTL
|| ap.land_complete || !motors->armed();
bool is_in_landing = flightmode->is_landing() || ap.land_complete || !motors->armed();
// check for new breaches; new_breaches is bitmask of fence types breached
const uint8_t new_breaches = fence.check(is_in_landing);