Skip to content

Commit

Permalink
Rover: Perform an arm check first
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed May 8, 2024
1 parent 4320063 commit 1f7ba38
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Rover/fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
void Rover::fence_check()
{
#if AP_FENCE_ENABLED
uint8_t new_breaches; // the type of fence that has been breached
const uint8_t orig_breaches = fence.get_breaches();

// check for a breach
new_breaches = fence.check();

// return immediately if motors are not armed
if (!arming.is_armed()) {
return;
}

const uint8_t orig_breaches = fence.get_breaches();

// check for a breach
uint8_t new_breaches = fence.check();

// if there is a new breach take action
if (new_breaches) {
// if the user wants some kind of response and motors are armed
Expand Down

0 comments on commit 1f7ba38

Please sign in to comment.