mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
AP_ADSB: populate altitude via pressure for ADSB-Out
fixes https://github.com/ArduPilot/ardupilot/issues/5424
This commit is contained in:
parent
1de198883d
commit
5adbf9b232
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user