I’m trying to get Plane to land reliably in automatic mode and I’ve noticed that it is getting a consisent altitude estimation error and thus sometimes tries to flare way too early. After checking the logs I’m noticing that the altitude estimate (with Baro as an absolute source) is off by several meters. I do have a rangefinder, but in this specific scenario the error is so big that the flare starts before the operational limit of the rangefinder.
My hypothesis is that due to long-ish missions I fly the ground pressure changes quite a lot resulting in such an error. My ground tracker has no GPS and thus no VELZ
source and this is how the mostly immobile flight controller on the ground sees the changes in barometric altitude:
I was under impression that somewhere in the Tracker documentation I saw it being used as a ground pressure source, but I can’t seem to find that functionality. The closest I did find are:
- Ground calibration in Tracker which is very odd to me as it seems to assume that the baro is mounted externally on a non-insignificant height and thus assumes the antenna itself is always at the ground level which is probably not where it is going to be for long range.
- Altitude offset in AP_Baro which seems to be doing precisely what I want, but is ArduPilot specific.
I would like to make a PR which adds automatic ground pressure corrections from the Tracker and thus I’m out for advice and want to know if I haven’t missed anything.
The way I see it:
- The tracker’s offset should rather mean the altitude of the antenna assembly above the ground and thus should not be used for angular calculations. It would be still captured by the same logic of comparing against the landed aircraft during the calibration step.
- We still calculate the difference of pressures in baro mode but we do not add the offset.
- If the barometer is mounted not where the antenna is located this can be made into a parameter instead. Since it is unlikely to change during operation.
AP_Baro
gets a MavLink handler that filters packets coming from an Antenna Tracker frame type and updates the altitude offset parameter based on the pressure and navigation status packets coming from the ground station. This way the operation should be transparent to non ArduPilot flight stacks because the parameter manipulation happens inside the AP code and we don’t rely on the parameter name in the Tracker-UAV communication.- The Tracker already does send its global position packets therefore by passing the altitude offset from step 1 (in case of a stationary tracker of course) the UAV would be able to extrapolate what the current ground level pressure is and adjust accordingly.
I would be glad if someone gave me feedback on whether this all makes sense. Thanks!