From b9736e400d514fa9c105f0c1cf4bf8b1c30d7855 Mon Sep 17 00:00:00 2001 From: Dmytro Yarosh Date: Sat, 30 Mar 2024 07:10:18 +0200 Subject: [PATCH] Test: GPS off by numsats < 10 && hdop > 1.2 --- libraries/AP_GPS/AP_GPS.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index 99b705fdccdaf..468eb16857690 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -866,6 +866,10 @@ void AP_GPS::update_instance(uint8_t instance) // we have an active driver for this instance bool result = drivers[instance]->read(); uint32_t tnow = AP_HAL::millis(); + + if ((state[instance].num_sats < 10) && (state[instance].hdop > 120)) { + state[instance].status = NO_FIX; + } // if we did not get a message, and the idle timer of 2 seconds // has expired, re-initialise the GPS. This will cause GPS