Give the robot enough room to fit

A route must leave room for the whole robot, not only its center. Making the robot wider rules out the narrow doorway and forces a detour.

Browser walkthrough·Beginner·About 10 min

Try the room planner

Change the robot size, then run the route.

Robot navigation room

6 moves remaining

More controls

Robot (2, 4), goal (8, 4). 6 moves remaining. Click a cell to set the goal. The green square is the modeled robot footprint.

2D reference and fallback
Room occupancy map and planned routeRobot at 2,4, goal at 8,4. A route exists with 6 moves. Gray cells are obstacles. Brown cells are excluded by the footprint. White is the planned center route.012345678910012345678

Inspect route and obstacle coordinates

Route in travel order: (2, 4) → (3, 4) → (4, 4) → (5, 4) → (6, 4) → (7, 4) → (8, 4)

Occupied cells: (5,3), (5,5), (5,6), (5,7).

Excluded robot-center cells: (5,3), (5,5), (5,6), (5,7).

Planner assumptions

Every cardinal move costs one. Breadth-first search finds a shortest route on this fixed grid. The robot is a square aligned with the grid. For footprint width 2r + 1 cells, centers within r cells horizontally and vertically of an occupied cell are excluded. Centers whose footprint crosses a room edge are also excluded. Routes move only the center. There is no turning radius, acceleration, uncertain localization, or moving obstacle prediction. The movement button advances a discrete simulation state, not a physical robot.

Optional reasoning check

Requirements and learning goals

Before you start

  • A browser with JavaScript enabled
  • No robot, installation, or coding required

You will be able to

  • Read occupied and free cells on a map
  • Explain obstacle inflation using a robot footprint
  • Recognize a doorway that fits a point but not a larger robot

A line drawn through an empty gap is not enough to prove a robot can pass. The robot has width. Its center can miss a wall while its body still hits it. This lesson turns that problem into a map of where the robot's center is allowed to go.

Our room has 11 columns and 9 rows. Cell coordinates begin at (0,0) in the top left: x increases to the right, and y increases downward. Gray cells are occupied. The robot starts at (2,4), and the goal is (8,4). Each cell is an abstract unit of space; the example does not assign a real-world meter scale.

The robot is a square aligned with the grid. We will compare a one-cell with a 3-by-3-cell footprint. These are deliberately coarse shapes so you can inspect the collision rule. Allow about 10 minutes.

Try it

Use Robot size beside the room. More controls contains the alternate goal and obstacle switches.

  1. Reset. Leave the one-cell footprint and both obstacle checkboxes off.
  2. Follow the white route across row 4. It passes through the narrow doorway at (5,4), between occupied cells at (5,3) and (5,5).
  3. Predict whether a 3-by-3-cell robot can follow that same center route. Select that footprint and inspect the new route.
  4. Look at the brown excluded cells around obstacles and room edges. They are not new walls; they mark robot-center positions that would put part of the body into a wall or outside the room.
  5. Try the 5-by-5-cell footprint. Read the no-route message instead of assuming the planner should always find a path.

The planner recomputes when a setting changes. The green outline shows the full footprint at the robot's current position, while the white route shows future center positions.

Work through one collision

A 3-by-3 footprint extends one cell left, right, above, and below its center. If its center were at (5,4), its body would cover (5,3) and (5,5), both occupied. That center position must therefore be excluded.

This is obstacle inflation. For a footprint width of 2r + 1 cells, exclude centers within r cells horizontally and vertically of each occupied cell. Also exclude centers whose footprint would extend beyond the room boundary. We can then plan a center route through the remaining cells.

Checkpoint 1 of 2

The 3-by-3 robot's center is at (4,4), one cell left of the doorway. Cell (4,4) is free, and so is (5,4) beside it. Cells (5,3) and (5,5) are occupied. Is (4,4) an allowed center position?

Commit to an answer. Every choice explains itself.

Our rule uses a square footprint and cardinal cell moves. It is not a circular-radius clearance calculation, and it does not model a robot turning between orientations.

Check the expected results

The one-cell footprint has a direct route of 6 moves. The 3-by-3 footprint needs 12 moves and crosses column 5 through the wider upper passage, on row 1. The 5-by-5 footprint has no route between these endpoints.

A route contains the starting cell as well as each destination cell. Six moves therefore visit seven cell centers. Use the move count, not the number of drawn points, when comparing path lengths.

Explain the change

Why does increasing the footprint block some centers near the room's outer edges even when no gray obstacle is nearby?

Checkpoint 2 of 2

With the 3-by-3 footprint, the center position (0,4) on the room's left edge is excluded. No gray obstacle is within one cell of it. Why is it excluded?

Commit to an answer. Every choice explains itself.

Explain why the three-cell-wide robot cannot use the one-cell doorway. The reasoning check below the workspace is optional.

You are done when you can distinguish an occupied cell from an excluded center position and predict which doorway is too narrow.

Troubleshooting

Reset if a previous obstacle checkbox or changed goal is still active. If the route disappears, read the status: an invalid start, an invalid goal, and disconnected free space are different problems. On small screens, use the text route details to inspect coordinates. JavaScript is needed to change the model.

The route-planning lesson explains how the route is chosen among the remaining cells.

Can you do each of these?

  • Read occupied and free cells on a map
  • Explain obstacle inflation using a robot footprint
  • Recognize a doorway that fits a point but not a larger robot

0 of 2 checkpoints solved. Try checkpoint 1

Find a way through a room
All lessons in this topic
  1. 1. Give the robot enough room to fit
  2. 2. Find a shortest route through free cells
  3. 3. Keep more than one possible robot position
  4. 4. Replan from where the robot is now
  5. 5. How LiDAR sees a room
  6. 6. Map a room and navigate to a goal

Ask Wendy

Answers about Wendy and WendyOS

What would you like to know?

Ask about devices, development, and deployment.

Check linked docs for technical details.