feat(simulation): add sensor_adsb_sim for simulated ADS-B traffic#27409
Draft
anilkir wants to merge 3 commits into
Draft
feat(simulation): add sensor_adsb_sim for simulated ADS-B traffic#27409anilkir wants to merge 3 commits into
anilkir wants to merge 3 commits into
Conversation
Contributor
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 2180 byte (0.11 %)]px4_fmu-v6x [Total VM Diff: 0 byte (0 %)]Updated: 2026-05-21T09:41:36 |
Member
Claudio-Chies
left a comment
There was a problem hiding this comment.
Thanks alot for takling this, this will be a huge improvement over the current implementation! added a few comments, and i would make sure to also add it to the docs, and remove the run_fake_traffic
| max: 100000.0 | ||
| SIM_ADSB_ALT: | ||
| description: | ||
| short: Altitude of simulated ADSB aircraft (MSL) |
Member
There was a problem hiding this comment.
thats just the start altitude of the simulated airfracts, right, i would write this more clearly
| parameters: | ||
| - group: Sensors | ||
| definitions: | ||
| SENS_EN_ADSBSIM: |
Member
There was a problem hiding this comment.
this param is not mentioned in the PR
| report.icao_address = v.icao_address; | ||
| report.lat = v.lat; | ||
| report.lon = v.lon; | ||
| report.altitude_type = 0; |
Member
There was a problem hiding this comment.
i think we are simulating GPS altitude, and not Pressure adjusted altitude
report.altitude_type = 1;
aa850de to
6619bf6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds an ADS-B simulator with a very rudimentary multi-aircraft simulation model, similar to the implementation in ArduPilot. The module runs at 1 Hz (matching real ADS-B squitter rate) and integrates aircraft positions using a flat-earth approximation. Each aircraft is spawned at a random bearing and distance within the configured radius, flies a constant random heading and speed, and is re-spawned when it exits the radius, descends below ground, or climbs more than 1000 m above the configured altitude.
This works in POSIX SITL and SIH on real hardware.
New parameters:
SIM_ADSB_COUNT: Number of simulated aircraft (max 10)SIM_ADSB_RADIUS: Spawn/despawn radius around ownshipSIM_ADSB_ALT: Target cruise altitude (AMSL) for simulated trafficKnown limitation: MAVLink heartbeat not simulated
A real ADS-B receiver is a MAVLink component that sends
ADSB_VEHICLEmessages and aHEARTBEATmessage. The MAVLink module tracks that heartbeat intelemetry_status.heartbeat_type_adsb, andCommanderuses it to settraffic_avoidance_system_present.The proposed
sensor_adsb_simpublishestransponder_reportdirectly over uORB, bypassing the MAVLink receive path. As a result,traffic_avoidance_system_presentis never set during simulation, even though traffic reports are flowing.The simulation of an ADS-B receiver with a full MAVLink interface to simulate the
HEARTBEATmessages as well is deferred to a follow-up.Changelog Entry
For release notes:
Test coverage
This was tested in SITL and the ADS-B emitter positions were verified on GCS.