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

Incorrect Altitude being reported in ADS-B Mavlink Msg's #5424

Closed
jwuavionix opened this issue Dec 20, 2016 · 9 comments · Fixed by #5761
Closed

Incorrect Altitude being reported in ADS-B Mavlink Msg's #5424

jwuavionix opened this issue Dec 20, 2016 · 9 comments · Fixed by #5761
Assignees

Comments

@jwuavionix
Copy link

In mavlink 2's ADS-B send_dynamic_out msg, the GNSS Altitude is being reported in decimeters instead of the correct mm's.

Also, the pressure Altitude isn't implemented and is always being sent as invalid.

Arduplane V3.7.1 and Arducopter 3.4.3 on a pixhawk

@magicrub
Copy link
Contributor

Hi Jeff,

Here's the problem code:
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_ADSB/AP_ADSB.cpp#L472

And
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_ADSB/AP_ADSB.cpp#L519

The GPS alt unit is an easy fix, my bad! The pressure alt one is less obvious. I did not implement it because it wasn't clear what the data was.

I can fix the GPS alt right away, would you be able to supply the description of the pressure sensor data?

@magicrub
Copy link
Contributor

GPS alt is fixed via 372837b

@jwuavionix
Copy link
Author

The pressureAltitude reported should be calculated using a standard reference pressure of 1013.25mbar. I've attached a little doc that describes the calculation which is already referenced to this reference.
pressureAltitude.pdf

@magicrub
Copy link
Contributor

@jwuavionix I just noticed this is still lingering. Please assist on what the data is supposed to be, I want to make sure it's correct.

per the mavlink packet note: Barometric pressure altitude relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX

So is it feet above sea level?

@jwuavionix
Copy link
Author

I left a comment on Dec 20th that attached an equation that is used to calculate the standard pressure altitude from the compensated(temp) baro pressure. This isn't AGL or MSL and should be calculated using the equation attached and just the baro pressure.

@magicrub
Copy link
Contributor

is it OK if it is temperature compensated?

@jwuavionix
Copy link
Author

yes, the equation needs to use temperature compensated baro pressure as the input.

@magicrub
Copy link
Contributor

great! Then I think this ends up being easier than we thought. I was thinking into it too much. Thanks @jwuavionix !

@magicrub
Copy link
Contributor

See PR #5761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants