Reactive:Exercise1-Safety and Obstacle Avoidance
Contents |
Setup
This exercise involves using range sensors from the Sensors section. Make sure that they are calibrated correctly. At this point you should have a working IR sensor. The first thing we will use this new sensor for is obstacle avoidance which is one of the most important features of a robot. The Roomba and Create robots were designed to be harmless when they bump into objects. However, we will now consider these collisions to be extremely bad. Fortunately, the IR sensor provides range data to objects before an actual collision. The purpose of this exercise is to create a robot controller that responds to the IR sensor data in a manner that prevents all collisions.
In order to prevent all collisions IR sensors should be placed in a ring around the robot. We will assume for the purposes of this exercise that there are a number of sensors arranged facing the front, left, and right sides of the robot. This will allow the robot to react to observed obstacles on all sides. A possible setup is shown in the following image:
Strategy
Obstacle avoidance consists of two problems:
- Stopping the robot before it runs in to an obstacle
- Turning the robot as it approaces an obstacle
The obstacle avoidance exercise in the sensors section combines these two steps into one action, turning the robot 90 degrees after it stops in front of an obstacle. In order to create a more flexible obstacle avoidance strategy, more complexity can be added to this controller.
Execution
FLBR (pronnounced Flubber)
First, determine what the sensor readings mean. For the purposes of obstacle avoidance, sensor readings can be classified as:
- FRONT
- LEFT
- BACK
- RIGHT
or FLBR. See picture below:
Notice that this is not a perfect representation of the obstacles around the robot. In the back, a wall is inside of the "free" space and on the left side, there is free space that is not in the represented free space. However, this is a rather simple representation of the obstacles around the robot, and is good enough for maneuvering.
Decision
Then, actions can be taken based on the closest values of each region. For example, stopping the robot before it hits an obstacle can be done using the FRONT region. Turning the robot can be effectively done using the LEFT and RIGHT regions.
Evaluation
The system can be evaluated using various obstacles in a scene. The first test of whether or not the system works should be a simple, 4-walled room. From there obstacles can be added to the room to better test the robot's skills at avoiding obstacles. If the robot starts running into things, begin by making sure that your sensor placements were able to see the obstacle, if so, then determine if your algorithm is capable of avoiding that situation.
![[LOGO]](/workbook/skins/workbook/create_small2.png)



