Rover supports two forms of object avoidance which can be enabled separately or simultaneously
- “dodge” avoidance attempts to steer around obstacles in Steering, RTL, SmartRTL, Guided and Auto modes
- “simple” object avoidance attempts to stop the vehicle before it hits objects in Acro, Steering, Loiter and Guided modes
Dodge only works with forward facing range finders (sonar/lidar). 360 degree lidar cannot be used for this method of avoidance
- One or two range finders should be mounted facing forward as described on the range finder wiki pages
- RNGFND_TRIGGR_CM specifies the distance in cm at which the vehicle will begin turning. I.e. 100 will mean the vehicle will begin turning 1m from the object. Set this value to 0 if you want the vehicle to stop instead of going around the obstacle.
- RNGFND_TURN_ANGL controls the direction and aggressiveness of the turn. Large positive or negative values (i.e. -450 or 450) cause turns up to the vehicle’s maximum lateral acceleration (i.e. TURN_MAX_G) while values near zero cause gentle turns. Negative values cause the vehicle to turn left, positive causes a turn right.
- RNGFND_TURN_TIME controls how many seconds the vehicle will continue turning after the object has gone out of view.
- RNGFND_DEBOUNCE specifies how many consecutive readings are required to trigger the turn response. A higher number reduces false positives but also adds a small lag in the response.
Simple Avoidance (Stopping)¶
This form of avoidance attempts to stop the vehicle before hitting objects.
follow the normal instructions for setting up rangefinders
if using regular lidar or sonar (i.e. not 360 degree lidar):
set AVOID_ENABLE to “7” to enable avoidance using proximity sensors (and fences)