Browse Source

Plane: Prevent FS action overiding VTOL land

copter407
Gone4Dirt 5 years ago committed by Randy Mackay
parent
commit
ce963c8f0f
  1. 2
      ArduPlane/events.cpp
  2. 8
      ArduPlane/quadplane.cpp
  3. 5
      ArduPlane/quadplane.h

2
ArduPlane/events.cpp

@ -171,7 +171,7 @@ void Plane::handle_battery_failsafe(const char *type_str, const int8_t action) @@ -171,7 +171,7 @@ void Plane::handle_battery_failsafe(const char *type_str, const int8_t action)
}
FALLTHROUGH;
case Failsafe_Action_RTL:
if (flight_stage != AP_Vehicle::FixedWing::FLIGHT_LAND && control_mode != &mode_qland ) {
if (flight_stage != AP_Vehicle::FixedWing::FLIGHT_LAND && control_mode != &mode_qland && !quadplane.in_vtol_land_sequence()) {
// never stop a landing if we were already committed
set_mode(mode_rtl, ModeReason::BATTERY_FAILSAFE);
aparm.throttle_cruise.load();

8
ArduPlane/quadplane.cpp

@ -3172,3 +3172,11 @@ bool QuadPlane::in_vtol_land_final(void) const @@ -3172,3 +3172,11 @@ bool QuadPlane::in_vtol_land_final(void) const
{
return in_vtol_land_descent() && poscontrol.state == QPOS_LAND_FINAL;
}
/*
see if we are in any of the phases of a VTOL landing
*/
bool QuadPlane::in_vtol_land_sequence(void) const
{
return in_vtol_land_approach() || in_vtol_land_descent() || in_vtol_land_final();
}

5
ArduPlane/quadplane.h

@ -553,6 +553,11 @@ private: @@ -553,6 +553,11 @@ private:
are we in the final landing phase of a VTOL landing?
*/
bool in_vtol_land_final(void) const;
/*
are we in any of the phases of a VTOL landing?
*/
bool in_vtol_land_sequence(void) const;
public:
void motor_test_output();

Loading…
Cancel
Save