Skip to content

Commit

Permalink
Plane: Support added for DO_LAND_START FS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKear committed Feb 17, 2020
1 parent ded5caf commit 3e2f6a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ArduPlane/events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ void Plane::handle_battery_failsafe(const char *type_str, const int8_t action)
case Failsafe_Action_Land:
if (flight_stage != AP_Vehicle::FixedWing::FLIGHT_LAND && control_mode != &mode_qland) {
// never stop a landing if we were already committed
if(plane.mission.is_best_land_sequence()){
// continue mission as it will reach a landing in less distance
plane.mission.set_in_landing_sequence_flag(true);
break;
}
if (plane.mission.jump_to_landing_sequence()) {
plane.set_mode(mode_auto, ModeReason::BATTERY_FAILSAFE);
break;
Expand All @@ -173,6 +178,11 @@ void Plane::handle_battery_failsafe(const char *type_str, const int8_t action)
case Failsafe_Action_RTL:
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
if (g.rtl_autoland == 2 && plane.mission.is_best_land_sequence()) {
// continue mission as it will reach a landing in less distance
plane.mission.set_in_landing_sequence_flag(true);
break;
}
set_mode(mode_rtl, ModeReason::BATTERY_FAILSAFE);
aparm.throttle_cruise.load();
}
Expand Down

0 comments on commit 3e2f6a1

Please sign in to comment.