Copter 3.5 (and higher) supports object avoidance horizontally and upwards using:
- 360 degree lidar including the Lightware SF40C, TeraRanger Tower or RPLidarA2/A3
- Any two of the other supported lidars (up to 4 lidar can be used if you are comfortable compiling the code yourself after changing this definition to “4”)
- Sensors capable of providing MAVLink Distance Sensor messages (like OpenKai with a 3D camera)
Details on how object avoidance is implemented can be found here in the developer wiki
Setup the Lidar¶
For 360 lidar follow the instructions corresponding to the lidar on the vehicle
For other lidar follow the instructions found here
- set AVOID_ENABLE = 7 (“All”) to use all sources of barrier information including “Proximity” sensors
- in Loiter
- in AltHold
Real-time distances can be seen in the Mission Planner’s proximity viewer
This window can be opened by moving to the MP’s Flight Data screen, press Ctrl-F and push the Proximity button.
Upward and downward facing range finder distances can be seen in the DataFlash Log’s RFND message.
The distance to the nearest object in 8 quadrants around the vehicle is recorded in the DataFlash log’s PRX messages.
Copter’s object avoidance feature has the following limitations. Future versions will likely resolve these.
- Object avoidance only works in Loiter and AltHold modes
- The vehicle should stop before hitting objects but will never back away from objects that approach the vehicle (a slow backing away will be added in future firmware versions)
- Avoidance is “sensor based” meaning it is not building up a 3D map and thus has no “memory” of where barriers were once they are out of view of the lidar