-
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
PR: baro auto calibration #24220
Open
haumarco
wants to merge
3
commits into
main
Choose a base branch
from
pr-ekf2_baro_auto_rel_calib
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PR: baro auto calibration #24220
+113
−36
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: 360 byte (0.02 %)]
px4_fmu-v6x [Total VM Diff: 376 byte (0.02 %)]
Updated: 2025-01-15T17:06:36 |
dagar
requested changes
Jan 15, 2025
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 like the idea, but how about...
- Doing it from
sensors/vehicle_air_data
where you already have access to all sensor_baro subscriptions, calibrations, and vehicle_air_data output. https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/sensors/vehicle_air_data/VehicleAirData.cpp - Use vehicle_gps_position (or even all sensor_gps publications) rather than depend on an EKF2 dependency.
|
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
When we have multiple barometers, we currently do not perform any calibration. There already exists a do_baro_calibration function, but I guess nobody used it since the function call of getAltitudeFromPressure had the wrong arguments.
This fix adds a calibration procedure for handling relative offsets between multiple baros, avoiding vertical position jumps when one switches between baros mid-flight.
When GNSS is set as the height reference, the calibration offset is calculated in respect to the absolute height (currently in baro-bias).
The offset is now stored in the offset parameter since it's static and not a changing bias.
I checked various flight logs with durations of more than 3000s and could not observe non systematic drifts between baros. Therefore frequent recalibration does not make any sense.
with GNSS, calibration triggered at t=34:
Switch from baro0 to baro1:
Feedback needed:
I now trigger the calibration 1s after the first baro measurement. At this point in time the GNSS is not sending any data yet. Therefore a manual trigger from the user is necessary to perform an absolute calibration. This wouldnt be a problem though, since the baro bias would still handle this case... Should I change something about this?