MissionPlanner icon indicating copy to clipboard operation
MissionPlanner copied to clipboard

Refactor ADS-B input support in Mission Planner

Open MUSTARDTIGERFPV opened this issue 2 years ago • 1 comments

What this PR accomplishes

This PR refactors a significant portion of ADS-B support in Mission Planner. In the process of developing MavADSB I ran into a good number of bugs and quirks in the Mission Planner support for ADS-B input data. As I found these issues, I sought to resolve them and improve the operation of the whole component.

Changes

  • [Feature] Built-in ADS-B API support - just add an HTTP base URL after enabling in Planner settings. I've spoken with @iakat about this and she's offered to let us make https://api.adsb.lol the default; I've set it to that for now.
    • Note: This links to https://ardupilot.org/planner/docs/common-adsb.html (nonexistent) where we should add other available API endpoints)
  • [Feature] ADSB_VEHICLE MAVLink uplink is limited to 1Hz, round-robin closest 10 planes within 10km. This keeps ADS-B in on the ground station from overwhelming your telemetry link. The previous approach sent known vehicles every time there was an update - enough to completely fill a telemetry link's bandwidth many times over. This approach sends only the amount necessary for up-to-date collision avoidance.
  • [Feature] ADSB tooltip values follow Mission Planner preferred unit settings; unit labels are shown as well.
  • [Feature] ADSB tooltip includes distance to MAV
  • [Feature] ADSB tooltip includes MAV's collision threat level if enabled
  • [Fix] ADSB_VEHICLES sent to the MAV, then sent back down are now ignored
  • [Fix] Corrected unit scaling for altitude. Previous math had a 7% error.
  • [Fix] ADSB vehicles work at all zoom levels. Previously, certain zoom levels wouldn't work if connected to a MAV with avoidance enabled due to a divide-by-0 bug with the zoom level.
  • [Fix] Sped up HTTP load times; defaults to 1Hz update rate and respects HTTP 429 responses for rate limiting.
  • [Fix] Resolved multi-write issues in collision threat level field
  • [Minor] If MAV home location is unset, we'll pull ADS-B info over HTTP for the viewport location. Nice for checking functionality before connecting a MAV
  • [Minor] Fixed unit consistency in ADS-B parsing between different input sources; all sources are now normalized to the standard Ardupilot units then transformed into display units

MUSTARDTIGERFPV avatar Dec 02 '23 23:12 MUSTARDTIGERFPV

@meee1 would you be willing to review this PR?

MUSTARDTIGERFPV avatar Jun 25 '24 16:06 MUSTARDTIGERFPV

@meee1 this PR should be all good to go. Can you please take a look and merge if everything looks good?

MUSTARDTIGERFPV avatar Jul 25 '24 07:07 MUSTARDTIGERFPV

@meee1 is there any reason not to merge this PR?

MUSTARDTIGERFPV avatar Jul 28 '24 18:07 MUSTARDTIGERFPV