add and activate circuit breaker for gps failure detection

This commit is contained in:
Thomas Gubler
2014-09-30 11:20:30 +02:00
parent 1072a3380c
commit d4c0dc2ba0
3 changed files with 18 additions and 2 deletions
+3 -2
View File
@@ -1417,8 +1417,9 @@ int commander_thread_main(int argc, char *argv[])
}
/* check if GPS fix is ok */
if (gps_position.fix_type >= 3 && //XXX check eph and epv ?
hrt_elapsed_time(&gps_position.timestamp_position) < FAILSAFE_DEFAULT_TIMEOUT) {
if (circuit_breaker_enabled("CBRK_GPSFAIL", CBRK_GPSFAIL_KEY) ||
(gps_position.fix_type >= 3 &&
hrt_elapsed_time(&gps_position.timestamp_position) < FAILSAFE_DEFAULT_TIMEOUT)) {
/* handle the case where gps was regained */
if (status.gps_failure) {
status.gps_failure = false;