Skip to content

Commit

Permalink
ekf_check: only use gps glitch mode reversion when ekf_failsafe attem…
Browse files Browse the repository at this point in the history
…pts reversion
  • Loading branch information
wsilva32 committed Sep 14, 2016
1 parent 9b46d34 commit b930c80
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ArduCopter/ekf_check.pde
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,14 @@ 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 (failsafe.gps_glitch) {
gps_glitch_switch_mode_on_resolve = true;
} else if (!mode_requires_RC(ekf_check_mode_before_fs_on)) {
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);
if (failsafe.gps_glitch) {
gps_glitch_switch_mode_on_resolve = true;
} else {
set_mode(LOITER);
}
}
}
}

0 comments on commit b930c80

Please sign in to comment.