Skip to content
RoboLearn
Not completed

Navigation and route planning

Control & autonomyIntermediate35 minSolve the maze ↓Before this: Autonomous decision making, Infrared distance sensors

What you’ll learn

  • Dead reckoning and why it drifts
  • The wall follower (right-hand rule) for mazes
  • How robots plan the shortest route: flood fill and A*

Dead reckoning

Work out position from movement: “I drove 50 cm and turned 90°, so I’m here.” It needs encoders or a gyro, and small errors add up, so robots correct it with landmarks, walls or lines.

Wall following (right-hand rule)

Keep your right hand on the wall and walk. In a maze whose walls are all connected, you’ll always reach the exit. It’s easy to code with a side distance sensor:

Situation Action
Wall ahead Turn left
No wall on the right (gap) Turn right gently, into the gap
Too close to the right wall Steer left a little
Otherwise Go straight

It isn’t the shortest route, though.

Shortest routes

  • Flood fill: used by Micromouse robots. Number each square by its distance from the goal (goal = 0, neighbours = 1, …). Then always move to a neighbouring square with a lower number.
  • A* (A-star): explores the most promising squares first, using distance-so-far plus an estimate of distance-to-go. Used in games, warehouse robots and sat-navs.
  • Both need a map: the robot explores first, then plans.

Finished this lesson?