From b817eb0370d2389a764dace7c58e899107dc790a Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 25 Sep 2023 10:04:14 -0400 Subject: [PATCH] ekf2: collect_gps() don't throttle updates until WMM set initially --- src/modules/ekf2/EKF/gps_checks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF/gps_checks.cpp b/src/modules/ekf2/EKF/gps_checks.cpp index e98b08365d..0b45b1bd78 100644 --- a/src/modules/ekf2/EKF/gps_checks.cpp +++ b/src/modules/ekf2/EKF/gps_checks.cpp @@ -92,7 +92,7 @@ bool Ekf::collect_gps(const gpsMessage &gps) ECL_INFO("GPS checks passed"); } - if (isTimedOut(_wmm_gps_time_last_checked, 1e6)) { + if ((isTimedOut(_wmm_gps_time_last_checked, 1e6)) || (_wmm_gps_time_last_set == 0)) { // a rough 2D fix is sufficient to lookup declination const bool gps_rough_2d_fix = (gps.fix_type >= 2) && (gps.eph < 1000);