Skip to content

Position estimator GPS origin altitude improvement for poor initial GPS epv#11355

Open
breadoven wants to merge 1 commit intoiNavFlight:maintenance-9.xfrom
breadoven:abo_gps_alt_origin_fix
Open

Position estimator GPS origin altitude improvement for poor initial GPS epv#11355
breadoven wants to merge 1 commit intoiNavFlight:maintenance-9.xfrom
breadoven:abo_gps_alt_origin_fix

Conversation

@breadoven
Copy link
Collaborator

@breadoven breadoven commented Feb 22, 2026

PR improves handling of GPS origin altitude setting in position estimator. With the Baro providing a valid altitude estimation it is possible to arm with a poor GPS epv that exceeds the max epv limit resulting in a GPS origin altitude value being set that can be wildly inaccurate (10's meters out). When/if the GPS epv subsequently improves and falls below the max limit the GPS will start being used for altitude estimation causing a significant altitude error.

This PR mitigates the problem by continuing to set the GPS origin altitude after arming up until GPS epv falls below the max allowed limit at which point no further correction occurs until disarm (if altitude reset is used on disarming) or reboot. The GPS origin altitude is set relative to takeoff altitude by correcting with estimated altitude.

Tested OK by reducing max epv limit to value slightly below first fix value then waiting for it to improve ...

@Jetrell
Copy link

Jetrell commented Feb 28, 2026

I forgot to mention that I ran a test with this last week. Because it got overshadowed by the other jittering issue I raised.

But as far as this went. I lowered inav_max_eph_epv = 600 to get a better idea of how well it would work.
And for the first part of the flight when the satellite accuracy was worse. I did a bit of climbing and diving to try and get the altitude position to mess-up... And I never experienced any wild drift in altitude position as the EPV become better, which is good.

The weather has been poor here.. When I get some better conditions. I'd like to go out and push a quad through some freestyle straight after acquiring a GNSS fix.. Then switch to Poshold after a couple of minutes. That will really tell if it has worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants