AP_ADSB: populate altitude via pressure for ADSB-Out

fixes https://github.com/ArduPilot/ardupilot/issues/5424
This commit is contained in:
Tom Pittenger 2017-02-20 23:29:34 -08:00 committed by Tom Pittenger
parent 1de198883d
commit 5adbf9b232

View File

@ -518,7 +518,12 @@ void AP_ADSB::send_dynamic_out(const mavlink_channel_t chan)
// --------------
// Unknowns
// TODO: implement http://www.srh.noaa.gov/images/epz/wxcalc/pressureAltitude.pdf
int32_t altPres = INT_MAX; //_ahrs.get_baro().get_altitude() relative to home, not MSL
AP_Baro baro = _ahrs.get_baro();
int32_t altPres = INT_MAX;
if (baro.healthy()) {
// Altitude difference between 101325 (Pascals) and current pressure. Result in millimeters
altPres = baro.get_altitude_difference(101325, baro.get_pressure()) * 1E3; // convert m to mm;
}