From 7d2cb35609775e03fe107cbb79b2e99fe1e82511 Mon Sep 17 00:00:00 2001 From: Will Silva Date: Mon, 12 Sep 2016 10:38:15 -0700 Subject: [PATCH] ekf_check: if GPS glitch is active when GPS is regained, set gps glitch mode revert flag * should prevent vehicle from staying in ALT_HOLD after the following FS sequence: 1. GPS LOST 2. GPS DEGRADED 3. GPS REGAINED 4. GPS RECOVERED --- ArduCopter/ekf_check.pde | 4 +++- Tools/autotest/copter_params.parm | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ArduCopter/ekf_check.pde b/ArduCopter/ekf_check.pde index c502691427..e0a74c934a 100644 --- a/ArduCopter/ekf_check.pde +++ b/ArduCopter/ekf_check.pde @@ -176,7 +176,9 @@ static void failsafe_ekf_off_event(void) Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_EKFINAV, ERROR_CODE_FAILSAFE_RESOLVED); if (ekf_check_switch_mode_on_resolve) { - if (!mode_requires_RC(ekf_check_mode_before_fs_on)) { + if (failsafe.gps_glitch) { + gps_glitch_switch_mode_on_resolve = true; + } else if (!mode_requires_RC(ekf_check_mode_before_fs_on)) { set_mode_RTL_or_land_with_pause(); } else if (mode_requires_GPS(ekf_check_mode_before_fs_on)) { set_mode(LOITER); diff --git a/Tools/autotest/copter_params.parm b/Tools/autotest/copter_params.parm index 6adb37952a..bbbd718350 100644 --- a/Tools/autotest/copter_params.parm +++ b/Tools/autotest/copter_params.parm @@ -1,5 +1,6 @@ FRAME 0 MAG_ENABLE 1 +FS_EKF_ACTION 2 FS_THR_ENABLE 1 BATT_MONITOR 4 CH7_OPT 7