mirror of https://github.com/ArduPilot/ardupilot
Plane: ignore battery failsafe during landing
fixes https://github.com/ArduPilot/ardupilot/issues/10320
This commit is contained in:
parent
9ae5ada82f
commit
05bf329d81
|
@ -150,26 +150,28 @@ void Plane::handle_battery_failsafe(const char *type_str, const int8_t action)
|
|||
}
|
||||
FALLTHROUGH;
|
||||
case Failsafe_Action_Land:
|
||||
if (flight_stage != AP_Vehicle::FixedWing::FLIGHT_LAND || control_mode == QLAND) {
|
||||
if (flight_stage != AP_Vehicle::FixedWing::FLIGHT_LAND && control_mode != QLAND) {
|
||||
// never stop a landing if we were already committed
|
||||
if (plane.mission.jump_to_landing_sequence()) {
|
||||
plane.set_mode(AUTO, MODE_REASON_BATTERY_FAILSAFE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
FALLTHROUGH;
|
||||
case Failsafe_Action_RTL:
|
||||
if (flight_stage != AP_Vehicle::FixedWing::FLIGHT_LAND || control_mode == QLAND ) {
|
||||
if (flight_stage != AP_Vehicle::FixedWing::FLIGHT_LAND && control_mode != QLAND ) {
|
||||
// never stop a landing if we were already committed
|
||||
set_mode(RTL, MODE_REASON_BATTERY_FAILSAFE);
|
||||
aparm.throttle_cruise.load();
|
||||
}
|
||||
break;
|
||||
|
||||
case Failsafe_Action_Terminate:
|
||||
char battery_type_str[17];
|
||||
snprintf(battery_type_str, 17, "%s battery", type_str);
|
||||
afs.gcs_terminate(true, battery_type_str);
|
||||
break;
|
||||
|
||||
case Failsafe_Action_None:
|
||||
// don't actually do anything, however we should still flag the system as having hit a failsafe
|
||||
// and ensure all appropriate flags are going off to the user
|
||||
|
|
Loading…
Reference in New Issue