Skip to content
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

AP_Airspeed: Allow setting of use-zero-offset in parameters #18617

Merged
merged 1 commit into from Sep 15, 2021

Conversation

peterbarker
Copy link
Contributor

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:

  • have the user set ARSPD_SKIP_CAL to 1 and ARSPD_OFFSET to 0.00001 and move on with life
  • stop sending RawAirData in AP_Periph for sensors which use zero offset. Instead, send IndicatedAirSpeed or TrueAirspeed 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.
  • have NMEA and SPD3X return a very, very small pressure all the time to avoid the calibration issue

@tridge
Copy link
Contributor

tridge commented Sep 14, 2021

easier to just accept zero value when skip cal is set

@peterbarker peterbarker self-assigned this Sep 14, 2021
@tridge tridge merged commit 16c11fc into ArduPilot:master Sep 15, 2021
@peterbarker peterbarker deleted the pr/airspeed-allow-zero branch September 16, 2021 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants