A proximity sensor is not sending distances
What ArduPilot says:
- PRXN: Not Connected
- PRXN: No Data
A proximity sensor (a 360° lidar, or rangefinders that look sideways) is enabled with PRXn_TYPE, and ArduPilot gets no distances from it. “No Data”: the driver runs, but nothing valid came within its time limit (0.2 to 0.5 s, by sensor type). “Not Connected”: there is no driver for that sensor: a DroneCAN sensor that has not appeared on the bus, or a slot whose driver did not start while a later one did.
What to do, most likely first
The lidar has no power or is not spinning: on USB alone it is usually off.
CheckA spinning lidar is easy to see and hear. An RPLidar also announces itself: “RPLidar A2 hw=… fw=…”.
FixConnect the battery (props off) and give the lidar a 5 V supply that can carry its motor.
A serial lidar is on another UART than the one set to the lidar protocol, or TX and RX are swapped.
CheckThe port the wires go to must have
SERIALn_PROTOCOL11 (Lidar360); the Board & Wiring Planner shows which pad is which UART.FixSet the lidar's port to
SERIALn_PROTOCOL11 with the lidar's baud rate, correct the wiring, reboot.PRXn_TYPEis 4 (RangeFinder), and no rangefinder that looks sideways or up is giving readings.CheckOnly rangefinders with
RNGFNDn_ORIENT0 to 7 (forward, right, back, left and between) or 24 (up) count; one that looks down (25) does not.FixSet the orientation of the sideways rangefinders, or fix the rangefinder that is silent.
PRXn_TYPEis 2 (MAVLink) or 14 (DroneCAN), and the companion computer or CAN node is not sending.CheckMAVLink distances (
DISTANCE_SENSORorOBSTACLE_DISTANCE) must arrive at least every 0.5 s. A DroneCAN sensor is taken only when its address equalsPRXn_ADDR.FixStart the sender; for DroneCAN, match
PRXn_ADDRto the address the sensor reports.No proximity sensor is fitted: the parameter is left over.
FixSet
PRXn_TYPEto 0 and reboot.
A serial lidar with no port set to 11 gets no driver at all; if it is the only proximity sensor, nothing is reported and the copter flies without obstacle data. Check that the sensor shows distances in the ground station before relying on avoidance.
Parameters to look at
| Parameter | What it is |
|---|---|
PRX1_TYPE | Proximity type |
PRX2_TYPE | Proximity type |
PRX1_ADDR | Bus address of sensor |
RNGFND1_ORIENT | Rangefinder orientation |
SERIAL1_PROTOCOL | Telem1 protocol selection |
SERIAL2_PROTOCOL | Telemetry 2 protocol selection |
SERIAL3_PROTOCOL | Serial 3 (GPS) protocol selection |
SERIAL4_PROTOCOL | Serial4 protocol selection |
Where to do it:Board & Wiring Planner
The code that sends it
PRXN: Not Connected
libraries/AP_Proximity/AP_Proximity.cpp AP_Proximity::prearm_healthy() · Open in ArduPilot Copter-4.7.1
PRXN: No Data
libraries/AP_Proximity/AP_Proximity.cpp AP_Proximity::prearm_healthy() · Open in ArduPilot Copter-4.7.1