TactivergeLite

Lite / Discovering How the World Works / Week 26

Planning a route before you move

Rover drivers on Earth plan a whole day of driving in one go, then hit send. How do they make sure it doesn't end in a crater?

About 25 min · 3 goals · Reviewed by the founders' mentors · Full interactive version

Why should I care?

Planning is how intelligent machines look ahead. Delivery robots, warehouse vehicles and rovers all plan routes before moving, then use sensors to check the plan is still working. It's sequences, decisions and feedback all working together.

Predict

You plan a 10-step route for a rover and send it. Halfway along, a wheel slips and the rover is one square off. What happens if it just keeps following the plan?

  1. It reaches the goal anyway
  2. It ends one square off, or hits something
  3. It notices and re-plans
Guess first, then reveal

It ends up off target, or worse, because every later step starts from the wrong place. A plan is open-loop. That's why real rovers stop at checkpoints, photograph landmarks, and correct their position before carrying on.

Discover

Plan the entire route to the flag before you press anything, writing it on paper. Then enter it and press Run all. Did it work first time? Find the shortest safe route you can.

What the interactive shows (text version)

The grid robot can be replaced by squared paper: draw a 6-by-6 grid with walls at (1, 1), (2, 1), (3, 1), (3, 3) and (2, 4), start at (0, 0) facing north and the flag at (4, 4). The shortest safe route goes up 2, east 4, up 2: Forward, Forward, Turn right, Forward ×4, Turn left, Forward, Forward.

You can also open the interactive on the full site when you have a faster connection.

Watch (optional)

Watch for: Watch for how a robot combines a plan with what its sensors tell it as it goes.

Explains why moving through the real world is hard for a robot, and how sensing and planning work together.

“Robotics: Crash Course AI #11” by CrashCourse (opens YouTube; streaming video uses a lot of data)

The video is optional. Everything you need is in this lesson's text.

Understand

A plan is a sequence

A route plan is a list of moves from start to goal that avoids every obstacle on the map. Writing it is like writing an algorithm, except the 'bugs' are walls and craters.

Comparing routes

Several routes may work. Engineers compare them: shorter (fewer moves, less energy), safer (further from hazards), or easier to check (passing landmarks the robot can see). The shortest route isn't always the best.

Plans need checkpoints

Real wheels slip and maps are imperfect, so a plan alone is open-loop. Robots add checkpoints: stop, measure where you really are, correct, continue. Planning ahead plus checking along the way combines the best of both.

Explain it another way

Intuitive

Planning a walk to a friend's house: you choose the route at home, but you still look at street signs as you go, in case you took a wrong turn.

Technical

Path planning searches a map for a sequence of moves from start to goal. On a grid, the shortest path length (in moves, ignoring turns) is at least the number of rows plus columns between start and goal; walls can make it longer.

Mathematical

From (0, 0) to (4, 4) on an open grid you need at least 4 moves east and 4 moves north: 8 Forward moves, plus the turns to change direction. Walls can force detours that add moves.

Applied

Mars rover drivers plan each day's route on 3D maps from the rover's photos, then the rover drives itself, checking for hazards and stopping if something doesn't match. On Earth, warehouse robots replan in a fraction of a second when someone steps into an aisle.

Worked example 1

On the grid robot, compare route A (up 2, east 4, up 2) with route B (east 1 first). Which is valid?

Route B: Turn right, Forward → (1, 0). Then up: Turn left, Forward → (1, 1), which is a wall. So B fails. Route A: Forward ×2 to (0, 2), Turn right, Forward ×4 to (4, 2), Turn left, Forward ×2 to (4, 4). Valid: 8 Forward moves, 2 turns.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

Practice 3. Why do rovers stop at checkpoints along a planned route?
Practice 4. Route A is 10 moves and passes right beside a crater. Route B is 12 moves and stays well clear. Which would a careful engineer pick?

Apply it

Draw a 6×6 map of your classroom or bedroom with furniture as walls. Plan a robot route from the door to a chosen spot, then choose two checkpoints where it should confirm its position. Explain why you picked them.

Reflect

Do you plan your route before you move, or work it out as you go? When is each better?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Joints and arms: placing a robot handDesign challenge 1: define the problem →