Avoid Behaviour.

OverviewEscapeTrappedAvoidStallMappingCruise

Input Sensors: 7x Sonar Sensors, 4 x IR Range Finders.

The avoid behaviour tries to ensure the robot stays away from objects and steers the robots out of the way. It takes its input from both the sonar and IR range finders.

The sonar sensors are good for distances between 27cm to >200cm, and have a very reliable response and accurate resolution.

As the IR range finders have a reliable range from 10cm to 100cm.

The avoid behaviour bases its decisions on two parameters:

  1. SonarTracingLimit - At this distance the robot becomes more aware of objects in the area - (Default 60cm)
  2. SonarObjectNear - This distance at which the robot turns away from an object - (Default 35cm)

The purpose of the SonarTracingLimit is so the avoid behaviour, although whilst not changing the direction of the robot, can slow the robots speed down. This means that it has more time to accurately detect and obstacle.

Once the distance between the robot and an object has fallen below the SonarObjectNear threshold it will arc the robot away from that object until there is enough room to clear the object.

In the case of the front sonar detecting and object, instead of just turning in a predefined way it will calculate the average free space to both left and right of the front sonar. Which ever is greater it will then turn in that direction.

Whilst the IRRF data is always sent onto the HCS for mapping processing they are only using by the avoid behaviour when the value of a specific IRRF sensor is:

  1. Within its valid measurable range (10cm to 100cm)
  2. And the sonar, which which it is paired it reading a value <= SonarTracingLimit. This enforces the reliability of the sensors and allows the robot to be used outside/sunlight with out it incorrectly detecting objects all the time.