-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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: set baro bias when GNSS is alt ref but fusion is disabled #24093
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 240 byte (0.01 %)]
px4_fmu-v6x [Total VM Diff: 224 byte (0.01 %)]
Updated: 2024-12-13T13:42:29 |
sfuhrer
previously approved these changes
Dec 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually drop a comment in the param descriptions of EKF2_GPS_CTRL and possibly EKF2_HGT_REF that GNSS is still used to initialize in this condition we cover here.
bresch
force-pushed
the
pr-ekf_gnss_alt_init
branch
from
December 13, 2024 13:36
23dc319
to
2816e01
Compare
Do this even when GNSS altitude fusion is disabled.
bresch
force-pushed
the
pr-ekf_gnss_alt_init
branch
from
December 13, 2024 13:36
2816e01
to
bfd909c
Compare
@sfuhrer Thanks for the review, I added a comment in |
sfuhrer
approved these changes
Dec 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Solved Problem
Before my global position rework, GNSS altitude was always used to initialise the origin of the local plane frame even when the GNSS altitude is disabled (in EKF2_GPS_CTRL). Some users actually liked this as it gives some sort of quick baro calibration using the GNSS altitude "for free".
Solution
Perform the baro bias correction if
EKF2_HGT_REF
is set to GNSS, even if altitude fusion is disabled inEKF2_GPS_CTRL
.The screenshot below shows a sitl test with
EKF2_HGT_REF
= GNSS andEKF2_GPS_CTRL
= 5 (lat/, on, 3D vel). We can see that the global altitude is correctly set using GNSS altitude.Alternatives
We could also automatically trigger a baro calibration when GNSS data is available (gated by some AUTOCAL parameter, as we do for IMU and mag)
Test coverage
unit test to cover this specific case
general SITL tests