Sensors:Exercise 4:IR & Sonar wall-following
Setup
This exercise will use both the sonar and infra-red sensors from the previous two exercises. Make sure you have calibrated both. The only remaining setup factor is to attach both sensors to the robot. To make things easier, consider only following a left or right wall. Specifically think about the formation of typical walls, and how you will need to position the sensors in order to prevent collisions.
Wall Following
Wall following is the process of moving parallel to a wall. Think of touching a wall with you right hand, and walking so that you hand never leaves the wall. The robot should follow a similar pattern, just without touching the wall. Use you experience from obstacle avoidance to read in sensor values in order to control the robot properly.
- Start with a simple straight wall.
- Place a right angle in the wall, both concave and convex.
- Follow a long path that has straight sections, curves, and right angles.
Note: Two sensors is pretty minimal for wall following. You will have to do some tuning of parameters.
Solution
Here is one solution.
![[LOGO]](/workbook/skins/workbook/create_small2.png)



