Skip to content

Commit

Permalink
Plane: 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 fb8ae12 commit 961e47e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ArduPlane/fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
void Plane::fence_check()
{
const uint8_t orig_breaches = fence.get_breaches();
const bool armed = arming.is_armed();

uint16_t mission_id = plane.mission.get_current_nav_cmd().id;
bool is_in_landing = plane.flight_stage == AP_FixedWing::FlightStage::LAND
bool landing_or_landed = plane.flight_stage == AP_FixedWing::FlightStage::LAND
|| !armed
#if HAL_QUADPLANE_ENABLED
|| control_mode->mode_number() == Mode::Number::QLAND
|| quadplane.in_vtol_land_descent()
#endif
|| (plane.is_land_command(mission_id) && plane.mission.state() == AP_Mission::MISSION_RUNNING);

// check for new breaches; new_breaches is bitmask of fence types breached
const uint8_t new_breaches = fence.check(is_in_landing);

const bool armed = arming.is_armed();
const uint8_t new_breaches = fence.check(landing_or_landed);

/*
if we are either disarmed or we are currently not in breach and
Expand Down

0 comments on commit 961e47e

Please sign in to comment.