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

Improve/Fix SBS-1 ADS-B Parsing #3218

Merged
merged 2 commits into from
Nov 28, 2023
Merged

Conversation

MUSTARDTIGERFPV
Copy link
Contributor

tl;dr: add ground track, speed, callsign, squawk codes, fix math error causing altitude discrepancy.

While writing https://github.com/MUSTARDTIGERFPV/MavADSB I discovered a few quirks about the ADS-B SBS-1 processing in Mission Planner. This PR addresses those quirks.

  1. Ground track, speed, callsign, are parsed in SBS-1 message types one and four, but UpdatePlanePosition is called only in type 3. Its ground speed was fixed to -1, and the callsign wasn't set at all. This changes that behavior so all fields get updated as soon as a type 3 is seen using the values stored from the type 1 and type 4 messages.
  2. Squawk codes were not interpreted at all - they've been added.
  3. Previously, the altitude value sent OTA was divided by a factor which represents the number of meters in 10ft. Given that ADS-B Mode C altitudes are given in feet, and the PointLatLngAltHdg's internal representation is in meters, the correct conversion factor is approximately 3.28, the number of feet in a meter. This change makes Mission Planner's altitudes match those of https://globe.adsb-exchange.com and https://globe.adsb.one. The previous math would look correct for lower altitudes, but would skew more and more the higher a plane got. For example, at 32000 ft, it's a difference between 9753m and 10499m, 746m off.

There's a chance other protocols will need their altitude math looked at also, but I've not taken a look at it just yet.

@meee1 meee1 merged commit 0068db5 into ArduPilot:master Nov 28, 2023
1 check passed
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.

2 participants