Copter: ekf failsafe first enforces landing with no GPS

thanks to khancyr for spotting this
This commit is contained in:
Randy Mackay 2018-04-21 10:07:43 +09:00
parent 656892cd88
commit 6f138ddcfa

View File

@ -136,14 +136,14 @@ void Copter::failsafe_ekf_event()
failsafe.ekf = true;
Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_EKFINAV, ERROR_CODE_FAILSAFE_OCCURRED);
// does this mode require position?
if (!copter.flightmode->requires_GPS() && (g.fs_ekf_action != FS_EKF_ACTION_LAND_EVEN_STABILIZE)) {
// sometimes LAND *does* require GPS so ensure we are in non-GPS land
if (control_mode == LAND && landing_with_GPS()) {
mode_land.do_not_use_GPS();
return;
}
// sometimes LAND *does* require GPS:
if (control_mode == LAND && landing_with_GPS()) {
mode_land.do_not_use_GPS();
// does this mode require position?
if (!copter.flightmode->requires_GPS() && (g.fs_ekf_action != FS_EKF_ACTION_LAND_EVEN_STABILIZE)) {
return;
}