# EKF waiting for GPS config data Ardusub 4.1

**URL:** <https://discuss.bluerobotics.com/t/ekf-waiting-for-gps-config-data-ardusub-4-1/13378>\
**Category:** ArduSub\
**Created:** [December 15, 2022, 4:10am UTC](https://discuss.bluerobotics.com/t/ekf-waiting-for-gps-config-data-ardusub-4-1/13378 "2022-12-15T04:10:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tautala](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tautala](https://discuss.bluerobotics.com/u/Tautala)\
**Post date:** [December 15, 2022, 4:10am UTC](https://discuss.bluerobotics.com/t/ekf-waiting-for-gps-config-data-ardusub-4-1/13378/1 "2022-12-15T04:10:21Z")

</div>

I am getting this message in qgroundcontrol and it look like it comes from this bit of code in AP\_NavEKF2\_core.cpp

```cpp
    // GPS sensing can have large delays and should not be included if disabled
    if (frontend->sources.usingGPS()) {
        // Wait for the configuration of all GPS units to be confirmed. Until this has occurred the GPS driver cannot provide a correct time delay
        float gps_delay_sec = 0;
        if (!dal.gps().get_lag(selected_gps, gps_delay_sec)) {
#if HAL_GCS_ENABLED
            const uint32_t now = dal.millis();
            if (now - lastInitFailReport_ms > 10000) {
                lastInitFailReport_ms = now;
                // provide an escalating series of messages
                MAV_SEVERITY severity = MAV_SEVERITY_INFO;
                if (now > 30000) {
                    severity = MAV_SEVERITY_ERROR;
                } else if (now > 15000) {
                    severity = MAV_SEVERITY_WARNING;
                }
                GCS_SEND_TEXT(severity, "EKF3 waiting for GPS config data");
            }
#endif
            return false;
        }

```

I’ve tried to implement a Sublocus GPS like the AP\_GPS\_MAV. I can see the position is correct. I’m guessing the problem is with the **get \_lag()** call. I’m not sure what that does or what I need to do to get that not to fail. Could I be missing something in my model?

I also don’t understand the test for **now \> 30000**. **now** is always increasing.

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [December 15, 2022, 1:39pm UTC](https://discuss.bluerobotics.com/t/ekf-waiting-for-gps-config-data-ardusub-4-1/13378/2 "2022-12-15T13:39:00Z")

</div>

> [@Tautala](#):
>
> I also don’t understand the test for **now \> 30000**. **now** is always increasing.

I think that means “It’s been 30 seconds after boot and we still haven’t properly identified the GPS!”

It is hard to tell exactly what is wrong without having the code and hardware to debug.  
Have you overridden the [get\_lag()](https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_GPS/GPS_Backend.h#L73) function?

You can also try setting the parameter GPS\_DELAY\_MS manually

---

<div class="post-metadata">

**Author:** ![Tautala](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tautala](https://discuss.bluerobotics.com/u/Tautala)\
**Post date:** [December 15, 2022, 6:22pm UTC](https://discuss.bluerobotics.com/t/ekf-waiting-for-gps-config-data-ardusub-4-1/13378/3 "2022-12-15T18:22:48Z")

</div>

That makes sense about the now test.

I saw the GPS\_DELAY\_MS after I made a fool of myself for posting this.

Thanks
