0

Line Robot - Basic lessons - Exercises - Wall following with 1 sensor

There will be no programming in this lesson. Instead, we will study the problems with wall following using a single distance sensor.

Naive theory

Wall is thick line on the right of the picture, robot's ideal position is dashed line (robot's longitudinal axis in the ideal position). Therefore, the robot is too far from the wall and it should go to the right. Red rectangle is distance sensor and red dashed line is distance.
It seems easy; just drive left motors faster, the robot will decrease the distance and it will be in this position, right? Not quite so. Let's see the details in the next paragraph.

Real life

Real life is more complex. Let's start the robot in the same initial position.
The problem is that the robot rotates as it tries to decrease distance to the wall. It depends on the sensor's field of view, but the distance will not decrease as much as we wanted as it doesn't measure orthogonally anymore.
The situation may deteriorate further. The distance could even start to increase. In that case the robot will hit the wall. Even if it finally decreases, the robot will be now too close the the wall and some oscillatory movement may start. This is no good way to follow a wall smoothly.

Task: smooth wall following with 1 sensor.

Change robot's construction in order to address the issue above. A hint: it is about the sensor.