Simple Object Avoidance¶
Copter supports simple object avoidance horizontally and upward, while Rover avoids simple objects by only stopping. Both use rangefinders such as:
- 360 degree lidar including the Lightware SF40C, TeraRanger Tower or RPLidarA2/A3
- Any of the other supported lidars .As of ArduPilot firmware versions 4.0 and higher, up to 9 rangefinders can be used for object avoidance. See RangeFinders Setup Overview for more information.
- Sensors capable of providing MAVLink Distance Sensor messages (like OpenKai with a 3D camera)
In addition, Simple Object Avoidance can use Geo-Fences and Fence Beacons as proximity sensors as detemined by the setting of the AVOID_ENABLE parameter.
See RangeFinders Setup Overview for general rangefinder setup information.
Simple Object Avoidance Algorithms¶
Only one proximity sensor source can be enabled, using either a 360 degree lidar or up to 9 rangefinders. While a second proximity sensor appears in the parameters list, it is not currently functional
Details on how simple object avoidance is implemented for Copter in ALTHOLD and LOITER mode can be found here in the developer wiki and involves assessing all the objects detected, in all reported quadrants, and adds control input to the pilot’s,trying to move away from the aggregate threat or stop.
In ALTHOLD mode, the aggregate threat is translated into an attempt to add lean input into the pilot’s commands to move the Copter away from the aggregate obstructions. The pilot can still overcome these additions to his command inputs and fly into a object, if determined to do so.
In LOITER, either stopping in front of the object or a “sliding” algorithm is used to avoid it. “Sliding” involves slowing and slightly yawing as the vehicle approaches the object. For example, if Copter approaches a fence line at an angle, it will “slide along” the fence as the operator pushes the Copter toward the fence. Head-on approaches would stop, even if the pilot continues to “pushes” it forward.
Setup the Proximity Sensor¶
For 360 lidar follow the instructions corresponding to the lidar on the vehicle
For other rangefinders follow the instructions found in there individual setup pages here
Be sure to read the RangeFinders Setup Overview page
Configuring Simple Avoidance for Copter¶
- set AVOID_ENABLE = 7 (“All”) to use all sources of barrier information including “Proximity” sensors
- set PRX_TYPE to a 360 deg Lidar type being used or = 4, to enable using range finders as “proximity sensors”
- in Loiter
- in AltHold
Configuring Simple Avoidance for Rover¶
- set AVOID_ENABLE = 7 (“All”) to use all sources of barrier information including “Proximity” sensors.
- set PRX_TYPE = “4” to enable using range finders as “proximity sensors”
- Rover attempts to stop the vehicle before it hits objects in all modes except MANUAL.
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.
Simple Object Avoidance feature has the following limitations. Future versions will likely resolve these.
- 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.