Skip to content

Commit

Permalink
Plane: cope with quadplane
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per committed May 31, 2024
1 parent 07a0f09 commit 4263ca5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ArduPlane/fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ void Plane::fence_check()
const uint8_t orig_breaches = fence.get_breaches();

uint16_t mission_id = plane.mission.get_current_nav_cmd().id;
bool is_in_landing = (plane.flight_stage == AP_FixedWing::FlightStage::LAND)
|| (plane.is_land_command(mission_id) && plane.mission.state() == AP_Mission::MISSION_RUNNING)
bool is_in_landing = plane.flight_stage == AP_FixedWing::FlightStage::LAND
#if HAL_QUADPLANE_ENABLED
|| control_mode->mode_number() == Mode::Number::QLAND
|| control_mode->mode_number() == Mode::Number::QRTL;
#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);
Expand Down

0 comments on commit 4263ca5

Please sign in to comment.