-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Conversation
🔎 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 |
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.
23dc319
to
2816e01
Compare
Do this even when GNSS altitude fusion is disabled.
2816e01
to
bfd909c
Compare
@sfuhrer Thanks for the review, I added a comment in |
I have a question about this change. is the BARO bias mentioned above a different name for entering the barometric pressure similar to how we will calibrate the altimeter on a real aircraft prior to takeoff or landing? |
It's close, but not exactly the same. The "bias" we're talking about here is a height offset (in meters). The baro calibration done on altimeters is on the QNH, which is used in the equation to convert the measured pressure to an altitude. We also have this parameter available in PX4. |
Thanks for that - definitely one part I was missing, and not obvious to search for. If the GPS is providing QFE before takeoff then is it fair to say that this calibration is providing the altitude of the takeoff point? I don't mind trying to provide some additional documentation so the details are more obvious to the next person who looks for it |
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