5.5.1.2. Avoid Obstacles¶
Here, we give up on the objective of going towards a goal and simply move in a direction away from obstacles. We switch to this mode when the robot would run into an obstacle otherwise. We will also use data from the obstacle avoidance algorithms to veer away and around from obstacles.
5.5.1.2.1. Summing the Obstacle Detection Vectors¶
A common way to identify a robot heading to avoid obstacles is to configure the robot with distance sensors around the robot. Using the distance to obstacle measurements as vectors, the sum of the vectors is calculated to yield the avoid obstacle heading, (). Due to the symmetry of the measurement angles when no obstacles are detected, shorter vectors in the direction of obstacles cause the sum of vectors to deflect away from obstacles.
The simple sum of vectors is a good start, but the resulting heading will likely not be adequate enough.
- It will detect objects to the side that pose no collision threat. A solution is to limit the lengths of the distance measurements so that forward measurements have greater range than side measurements.
- The sum of the vectors will always point forward and likely not adequately deflect away from obstacles. A solution is to shift each vector in the opposite direction. Thus, detected obstacles can result in negative vectors. A panic element to the shift was also adopted to give larger negative vectors in the event of a near collision.
The absolute value of is an indicator of the need to switch to this behavior. We switch to this behavior when . We can return to other behaviors when falls bellow a threshold, .
In a panic situation where the robot needs to back out of a tight spot before proceeding, it is desired for the robot to go in reverse at a slight angle. One shortcoming of the Summing the Obstacle Detection Vectors algorithm is dealing with head on obstacles. If an obstacle, such as a wall, is directly in front of the robot, then the lack of object detection from the sides can cause our to stay near zero until the robot is near the obstacle and then switch to a value close to . In fact, it is possible that the robot will oscillate between the two and just move back and forth in front of the obstacle. Thus, it is desired to limit so that the robot backs up at an angle to begin turning away from the obstacle.