From 6f138ddcfa55b5e2546c9e4c93fcd250098487ea Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Sat, 21 Apr 2018 10:07:43 +0900 Subject: [PATCH] Copter: ekf failsafe first enforces landing with no GPS thanks to khancyr for spotting this --- ArduCopter/ekf_check.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ArduCopter/ekf_check.cpp b/ArduCopter/ekf_check.cpp index 3c7f7d7b90..df6374ea37 100644 --- a/ArduCopter/ekf_check.cpp +++ b/ArduCopter/ekf_check.cpp @@ -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; }