Archived: Object Avoidance

Rover supports two forms of object avoidance which can be enabled separately or simultaneously

“Dodge” Avoidance



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. ATC_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.

This “dodge” method of avoidance can only be activated in Steering, RTL, SmartRTL, Guided and Auto modes.

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 RNGFNDx_ORIENT (for example RNGFND1_ORIENT ) to “0” for forward facing lidar and “4” for backwards facing lidar

    • set PRX_TYPE = “4” to enable using range finders as “proximity sensors”

    • set AVOID_ENABLE to “7” to enable avoidance using proximity sensors (and fences)

This “simple” method of avoidance can only be activated in Acro, Steering, Loiter and Guided modes.