diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-09-30 11:20:30 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-09-30 11:20:30 +0200 |
commit | d4c0dc2ba0271f4d9c8044fd2a3a178cbb9987e3 (patch) | |
tree | 207df1dee8933351a7c41aac49baf0e2eaeed48f /src/modules/commander | |
parent | 1072a3380c2d6bdea010bb5091c6d0b23fe6f224 (diff) | |
download | px4-firmware-d4c0dc2ba0271f4d9c8044fd2a3a178cbb9987e3.tar.gz px4-firmware-d4c0dc2ba0271f4d9c8044fd2a3a178cbb9987e3.tar.bz2 px4-firmware-d4c0dc2ba0271f4d9c8044fd2a3a178cbb9987e3.zip |
add and activate circuit breaker for gps failure detection
Diffstat (limited to 'src/modules/commander')
-rw-r--r-- | src/modules/commander/commander.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index bf15bbeb6..b86f3678b 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -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; |