EKF: add baro bias estimator using GNSS altitude #17944
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe problem solved by this pull request
Barometers develop a bias over time, mainly due to a temperature or a weather change. This can be compensated by estimating the change in offset between another height source that is not affected by the same noise.
Describe your solution
In this PR, the GNSS altitude is used to estimate the bias of the magnetometer using a simple single-state KF.
Additional benefit: this is a requirement for multiple height source fusion (e.g.: GNSS alt + baro)
Test data / coverage
Used for ~1 year on many different drones without issues.
Example SITL test with drifting baro:
![DeepinScreenshot_select-area_20210719155037](https://user-images.githubusercontent.com/14822839/126170643-84823ca3-4ccc-4172-899c-304f9966862e.png)
EKF2 is using baro as the primary height source but the drift is compensated by the bias estimator introduced in this PR.
https://logs.px4.io/plot_app?log=6a4b836d-6bb8-420d-aceb-ccee324f3f4d