Planning a Path
Getting from point A to point B sounds easy until there are walls, furniture, other robots, and moving people in the way. Path planning is the branch of robotics that answers the question: given where I am and where I want to be, what sequence of moves should I take? It is one of the oldest and most studied problems in robotics, and the algorithms used today power everything from warehouse robots to self-driving cars to the Mars rovers.
Representing the World as a Map
Before a robot can plan a path, it needs a map. A map in robotics is not just a picture — it is a data structure that the planning algorithm can search through. One common approach is an occupancy grid, a map divided into a grid of cells where each cell is marked either free (the robot can go there) or occupied (something is in the way). Think of it like a graph paper drawing of a room: you shade in the squares that are blocked by walls or furniture and leave the rest blank. Another approach is a topological map, which represents the environment as a network of nodes (key locations like intersections or rooms) connected by edges (passable paths between them). Topological maps are faster to search but less precise than occupancy grids.
In many real deployments, a robot does not start with a pre-built map. It must build one while simultaneously figuring out where it is — a technique called SLAM, short for Simultaneous Localization and Mapping. SLAM algorithms combine sensor data over time to gradually construct a map of an unknown environment.
Searching for a Path: Graph Search Algorithms
Once the world is represented as a searchable structure, the robot needs to find the best path through it. One of the most widely used algorithms is A* (pronounced A-star). A* works by exploring the map from the start position outward, always expanding the most promising location next — the one that seems closest to the goal based on a combination of how far the robot has already traveled and an estimate of how far it still needs to go. This estimate of remaining distance is called a heuristic. A heuristic is a smart shortcut: instead of exploring every possible path, A* uses the heuristic to focus its search on directions that look useful. A well-chosen heuristic makes A* dramatically faster than exhaustive search.
A common heuristic for grid-based maps is straight-line distance to the goal. It is never an overestimate of the true distance (since the straight line is the shortest possible path), so A* is guaranteed to find the optimal path when this heuristic is used.
Dealing with Dynamic Obstacles
Static obstacles — fixed walls, permanent furniture — are the easy case. Real environments include dynamic obstacles: people walking, other robots moving, doors opening and closing. A path that was valid one second ago may be blocked now. Robots handle dynamic obstacles through replanning: continuously or periodically recalculating the path as new perception data arrives. Some planners, like D* Lite (dynamic A*), are specifically designed to update an existing path efficiently when small changes occur, rather than recalculating from scratch every time.
Match each path planning concept to its correct description.
Terms
Definitions
Drag terms onto their definitions, or click a term then click a definition to match.
From Plan to Motion
A path planner outputs a sequence of waypoints — positions the robot should pass through. But the robot must also translate those waypoints into smooth motor commands. This is the job of motion planning, which takes the high-level path and produces a continuous trajectory that respects the robot's physical limits: maximum speed, turning radius, and acceleration. A robot cannot teleport from waypoint to waypoint; it must accelerate gradually, curve instead of turning on a dime, and slow down before tight corners.
A robot using an occupancy grid has marked a hallway cell as 'occupied' because a trash can is there. The trash can is moved away. What must happen for the robot to plan a path through that cell?
What is the key advantage of A* over an algorithm that simply tries every possible path?
Human A* Simulation
- Step 1: On graph paper, draw a 10x10 grid. Mark the top-left corner as START and the bottom-right corner as GOAL.
- Step 2: Draw five or six 'walls' by shading in groups of connected cells anywhere on the grid.
- Step 3: Work with a partner. One person plays the A* algorithm: always move to the open neighbor cell that has the smallest value of (steps taken so far) + (straight-line distance to goal). The other person records each step.
- Step 4: Highlight the path you found. Then try to find a shorter path by hand. Did A* find the optimal route?
- Step 5: Now add one new wall that blocks part of your path. How many steps did you have to back up and replan? Discuss: what would a dynamic replanning algorithm need to do differently from running A* from scratch?