Skip to content

Commit

Permalink
Copter: address minor review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per committed Jul 21, 2024
1 parent 2b15f10 commit fb8ae12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ArduCopter/fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ void Copter::fence_check()
{
const uint8_t orig_breaches = fence.get_breaches();

bool is_in_landing = flightmode->is_landing() || ap.land_complete || !motors->armed();
bool is_landing_or_landed = 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);
const uint8_t new_breaches = fence.check(is_landing_or_landed);

// we still don't do anything when disarmed, but we do check for fence breaches.
// fence pre-arm check actually checks if any fence has been breached
Expand Down
1 change: 1 addition & 0 deletions ArduCopter/mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ bool Copter::set_mode(Mode::Number mode, ModeReason reason)
fence.option_enabled(AC_Fence::OPTIONS::DISABLE_MODE_CHANGE) &&
fence.get_breaches() &&
!flightmode->is_landing() &&
motors->armed() &&
get_control_mode_reason() == ModeReason::FENCE_BREACHED &&
!ap.land_complete) {
mode_change_failed(new_flightmode, "in fence recovery");
Expand Down

0 comments on commit fb8ae12

Please sign in to comment.