Skip to content

Commit

Permalink
Copter: only disable fences when in landing phase
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per committed Jun 25, 2024
1 parent 5cb38e4 commit 61491e0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ArduCopter/fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 61491e0

Please sign in to comment.