AP_Airspeed: Allow setting of use-zero-offset in parameters #18617
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.
If a NMEA or SPD3X airspeed sensor is used as part of an AP_Periph node then the airspeed data returned to the autopilot is already calibrated. When used directly both of these sensors flag that a zero-offset should be used, but when the data is returned via uavcan's
RawAirData
packet we do not have this information.Problems arise when these sensors return perfect-zeroes as readings for the entire calibration routine, as we then set
offset
to zero - and at that point the sensor is considered unhealthy and is not used.This PR allows a user to set a bit indicating the data is already compensated - forcing
SET_USE_ZERO
There are three other approaches I've considered:
ARSPD_SKIP_CAL
to 1 andARSPD_OFFSET
to 0.00001 and move on with lifeRawAirData
in AP_Periph for sensors which use zero offset. Instead, sendIndicatedAirSpeed
orTrueAirspeed
if we have a baro. This would also involve wrangling the airspeed values in ArduPilot somehow, and that is a difficult story to tell; AP_Airspeed would probably have to fake things up.