Professional Documents
Culture Documents
Project
Wall Following Algorithm, 1st Attempt
● Cell by cell general process:
○ If there is no right wall, turn right and go forward
○ If there is a wall to the right, go forward
○ If there is a wall to the right, and a wall in front, turn left until there is no wall in front anymore
● Issues:
○ Analyzing cell by cell is impossible if maze cannot be split into evenly spaced parts
○ Error can build up over time moving cell by cell until you get stuck
○ If the wall to the right of the robot
Wall Following Algorithm, 2nd Attempt
● State programming method:
○ Initialize robot, determine surroundings, decide best course of action
■ If (no right wall) → arc forwards and to the right until a wall is found
■ If (no right wall and no front wall) → follow the wall until it is no longer detected, or there is an
obstacle in front
■ If (right wall and front wall) → turn left until there is no longer a front wall
○ After the best course of action is taken, reinitialize and repeat
● Added methods for robustness
○ Follow right wall: if robot gets too far away from the wall, but still detects it, slight arc towards the wall, and
vice versa
○ Turning left: back away first if the robot is too close, to avoid getting stuck on the wall
○ General slowness in order to avoid motor drift
Tremaux’s Algorithm
General Process:
● Move Forward until at a Junction
○ Marks where it came from
○ Goes down path with least marks
○ Marks path it goes down
● Two marks is considered a Wall
Characteristics
● Tremaux explores all squares that can be reached till the exit
● Can be used to extract ideal path
● Can work on all mazes
● Code needs to remember where it has been before
Comparison