Closed
Conversation
🔎 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
Member
dagar
left a comment
There was a problem hiding this comment.
I like the idea, but how about...
- Doing it from
sensors/vehicle_air_datawhere 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.
Contributor
Author
|
Contributor
Author
This file contains hidden or 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
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?