As a direct application to my GP2D12 distance sensor, I built this wall follower. Its base is the Constructopedia RoverBot, I only added a turret bearing the sensor. The trick here is to direct sensor beam 45° away to also detect walls in front of vehicle. A simple program that maintains constant distance between wall and sensor creates a wall-following behaviour.
The program is written with , it must be compiled
and downloaded in RCX before using it. I use RCX
command center shell to edit the source files.
This vehicle is a Constructopedia RoverBot equipped with a turret enabling rotation of sensor in the right direction. For the sake of completeness, here is how to build this turret:
Wall follower in action: QuickTime movies