PX4 can use ADS-B or FLARM transponders to support simple air traffic avoidance in missions. If a potential collision is detected, PX4 can warn, immediately land, or return (depending on the value of NAV_TRAFF_AVOID).
PX4 traffic avoidance works with ADS-B or FLARM products that supply transponder data using the MAVLink ADSB_VEHICLE message.
It has been tested with the following devices:
Either device can can be connected to any free/unused serial port on the flight controller. Most commonly it they are connected to TELEM2 (if this is not being use for some other purpose).
The PingRX MAVLink port uses a JST ZHR-4 mating connector with pinout as shown below.
|+4 to 6V
The PingRX comes with connector cable that can be attached directly to the TELEM2 port (DF13-6P) on an mRo Pixhawk. For other ports or boards, you will need to obtain your own cable.
FLARM has an on-board DF-13 6 Pin connector that has an identical pinout to the mRo Pixhawk.
|+4V to +36V
The TX and RX on the flight controller must be connected to the RX and TX on the FLARM, respectively.
Flarm/PingRX are configured in the same way as any other MAVLink Peripheral.
The only specific setup is that the port baud rate must be set to 57600 and the a low-bandwidth profile (
Assuming you have connected the device to the TELEM2 port, set the parameters as shown:
- MAV_1_CONFIG = TELEM 2
- MAV_1_MODE = Normal
- MAV_1_RATE = 0 (default sending rate for port).
- MAV_1_FORWARD = Enabled
Then reboot the vehicle.
You will now find a new parameter called SER_TEL2_BAUD, which must be set to 57600.
Prior to PX4 v1.9 you can set up the port using the deprecated parameter:
Configure the action when there is a potential collision using the parameter below:
|Enable traffic avoidance mode specify avoidance response. 0: Disable, 1: Warn only, 2: Return mode, 3: Land mode.
|Set traffic avoidance distance for manned aviation
|Set traffic avoidance distance for unmanned aviation
PX4 listens for valid transponder reports during missions.
If a valid transponder report is received, PX4 first uses the transponder position and heading information to estimate whether the vehicles will share a similar altitude before they pass each other. If they may then PX4 it estimates how the closest distance between the path to the next waypoint and the other vehicles predicted path. If the crossing point is less than the configured distance for altitude and path, the Traffic Avoidance Failsafe action is started, and the vehicle will either warn, land, or return. The detection distance can be configured separately for manned and unmanned aviation.
The code can be found in
PX4 will also forward the transponder data to a GCS if this has been configured for the MAVLink instance (this is recommended). The last 10 Digits of the GUID is displayed as Drone identification.