Robotics from zero · Chapter 5
Planning and autonomy
Planning chooses a route or sequence of actions that respects constraints. Control then tries to execute it, while observation checks whether the plan still fits the world.
After this chapter
Separate goal, robot footprint, free space and route; explain why a plan may need to change.
Try the large body, or toggle the selected opening cell.
- Obstacle
- Invalid center
- Goal
Route found · 1 / 8
Start: (2, 4) · Goal: (9, 4)
This is a model. Its numbers explain an idea. They are not safety settings for a real robot.
Which actions can reach the goal?
A robot must cross a room through a narrow opening. Change its footprint from one cell to a 3×3 square. Use row and column selectors to add or remove obstacles. The route is recalculated for the current map; play moves the robot along it.
1 Goal and representation
A planner needs a start, a goal and a representation of the world. A grid is one choice. It leaves out detail smaller than a cell, so choosing a map also chooses which facts the planner can use.
2 Body and free space
The whole robot takes up space. A center is allowed only when the entire footprint clears walls and map boundaries. Expanding obstacles by the footprint lets the planner reason about valid center positions.
3 Plan, execute, replan
A route is a proposal. Control follows it, sensors check progress, and new obstacles may require another plan. Autonomy depends on this connection, not simply running a search algorithm once.
Apply the idea
Why is checking only a robot arm’s gripper insufficient for avoiding a shelf?
Show the answer
The links, joints, payload and swept motion also occupy space. A gripper can clear a shelf while an elbow hits it. The planner needs configurations of the whole arm and its constraints, not just a line drawn by its tip.
Under the hood
Open the model assumptions and calculations
This 10×8 grid permits four-neighbor moves with equal cost. Breadth-first search (BFS) finds a shortest route in number of moves if one exists in this grid. Footprints are axis-aligned squares of one cell or 3×3 cells. Gray cells are invalid center positions after accounting for body size and boundaries.
grid = 10 × 8; moves = up, down, left, right
footprint = 1 × 1 or 3 × 3 cells
free(center) = entire footprint inside map and outside obstacles
BFS minimizes number of moves on this unweighted gridqueue = [start]
while queue is not empty:
cell = queue.pop_front()
for neighbor in free_unvisited_neighbors(cell):
parent[neighbor] = cell
queue.push_back(neighbor)Real-world catch
This is a geometric path, not a timed trajectory. It ignores turning radius, acceleration, moving obstacles and localization error. “No route” means none exists under this map and footprint, not that every real-world solution is impossible. A found path is not a safety guarantee.
Next, place AI inside this larger system: it may interpret a request or observation, but planning, control and verification still need explicit roles.