Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EKF2: fix range height altitude drift on ground #24166

Merged
merged 2 commits into from
Jan 3, 2025
Merged

Conversation

bresch
Copy link
Member

@bresch bresch commented Jan 3, 2025

Solved Problem

replaces #24161
fixes #24160

Terrain was continuously reset using the current altitude estimate because the terrain state is not updated when EKF2_HGT_REF is set to range finder. Since the terrain state is used to update the height through range fusion, the height is not constrained and can freely drift away.

Solution

Do not run the "fake terrain fusion" (i.e.: reset terrain) if the terrain is the height reference is the range finder.

Test coverage

unit test

@dakejahl Could you please try this fix?

@bresch bresch added the EKF2 label Jan 3, 2025
@bresch bresch requested a review from dakejahl January 3, 2025 09:40
@bresch bresch self-assigned this Jan 3, 2025
@dakejahl
Copy link
Contributor

dakejahl commented Jan 3, 2025

Awesome thank you! Tested in sim and it solves that issue.

Next thing to figure out is why do we lose altitude while moving. Another easy to reproduce thing in sim, if you just roll the vehicle back and forth it will eventually sink to the ground.

dakejahl
dakejahl previously approved these changes Jan 3, 2025
dakejahl and others added 2 commits January 3, 2025 11:18
When the height reference datum is ground level (range finder height
ref), the terrain state is not updated through fusion and should stay at
a constant altitude.
@bresch
Copy link
Member Author

bresch commented Jan 3, 2025

Next thing to figure out is why do we lose altitude while moving. Another easy to reproduce thing in sim, if you just roll the vehicle back and forth it will eventually sink to the ground.

Could you please make another issue for that and post a log so we don't lose track of it?

@bresch bresch merged commit c1589dd into main Jan 3, 2025
60 of 61 checks passed
@bresch bresch deleted the pr-ekf2_rng_hgt_reset branch January 3, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[Bug] Local Z diverges
2 participants