Skip to content

AP_NavEKF3: Don't reset to stale GPS data#32940

Merged
tridge merged 3 commits into
ArduPilot:masterfrom
priseborough:pr-ekf3_stale_gps_bugfix
Jun 8, 2026
Merged

AP_NavEKF3: Don't reset to stale GPS data#32940
tridge merged 3 commits into
ArduPilot:masterfrom
priseborough:pr-ekf3_stale_gps_bugfix

Conversation

@priseborough

Copy link
Copy Markdown
Contributor

This fixes a vulnerability where the last GPS fix, regardless of age, could be be used to reset the EKF position.

Summary

This fixes a bug found during testing of #31738.

The bug report is here #32868

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Description

This is a one lone change that requires the GPS to be no more than 1 sample old( assuming a nominal 5Hz rate with some allowance for jitter) regardless of reset source setting.

@rmackay9 rmackay9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@priseborough I think we should make the same change a few lines lower for the range beacon and external nav handling shouldn't we?

I've put a commit at the end of this branch that does this, I could push it over your branch if you like
https://github.com/rmackay9/rmackay9-ardupilot/commits/ekf3-reset-stale/

@priseborough

Copy link
Copy Markdown
Contributor Author

Thanks @rmackay9 . I've pulled your patch in.

@IamPete1 IamPete1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good. Don't we need the same changes in ResetVelocity?

@IamPete1 IamPete1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided on the call that we should include the ResetVelocity fix in this PR also.

@rmackay9

Copy link
Copy Markdown
Contributor

I'll make the changes for the similar ResetVelocity method

priseborough and others added 3 commits June 8, 2026 16:25
This fixes a vulnerability where the last GPS fix, regardless of age, could be be used to reset the EKF position.
@rmackay9 rmackay9 force-pushed the pr-ekf3_stale_gps_bugfix branch from 9ccc961 to 5f72656 Compare June 8, 2026 07:26
@rmackay9 rmackay9 dismissed stale reviews from IamPete1 and themself June 8, 2026 07:26

I've added the fix for reset velocity as well, txs!

@IamPete1 IamPete1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@tridge tridge merged commit 03df252 into ArduPilot:master Jun 8, 2026
120 of 123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants