Robotics From Zero
Module: Plan A Path

What Is Path Planning?

How robots find their way from point A to point B without hitting obstacles, and why path planning is harder than it looks.

8 min read

What Is Path Planning?

A Waymo self-driving car with visible LiDAR sensor on the roof, driving on a city street
A Waymo self-driving car navigating city streets. The LiDAR dome on the roof scans the environment, and onboard computers run path planning algorithms to navigate safely through traffic — the same algorithms we'll learn in this module.

You tell your robot: "Go to the kitchen." It's 10 meters away, around a corner, past a chair. How does the robot figure out which way to go?

This is path planning — the art of finding a safe, efficient route through space.

The Core Problem

Path planning answers one question: Given where I am and where I want to be, how do I get there without crashing?

Sounds simple. But consider what a robot needs to handle:

  • Static obstacles: walls, furniture, trees
  • Dynamic obstacles: people, other robots, pets
  • Narrow passages: doorways, gaps between tables
  • Constraints: the robot can't turn in place, or can only reverse slowly
  • Efficiency: the path should be short, smooth, and fast to compute

A human brain solves this effortlessly. For a robot, it's a hard computational problem.

Greedy vs planned approach — greedy robot drives straight into wall while planned robot takes a longer successful route
A greedy robot heads straight for the goal and gets stuck. A planner finds a route that actually works.

Configuration Space (C-Space)

Here's a key insight: instead of planning in physical space, robots plan in configuration space — the space of all possible robot poses.

For a simple 2D robot at position (x, y) with heading θ, the configuration space is 3D: (x, y, θ). Every point in this space represents a possible robot state.

ConfigurationExample
(x, y)Position on a map (for robots that can spin in place)
(x, y, θ)Position + heading (for robots that can't spin freely)
(x, y, z, roll, pitch, yaw)Full 3D pose (for drones, robot arms)
Joint anglesFor manipulator arms (6-7 dimensions or more)
Workspace vs configuration space — obstacles inflate by robot radius, robot shrinks to a point
In C-space, obstacles grow by the robot's radius and the robot becomes a point — simplifying collision checks.

The beautiful thing: obstacles in physical space become "forbidden regions" in C-space. A path planner's job is to find a collision-free path through C-space.

Note

Why bother with C-space? It simplifies the problem. Instead of checking "does this 2m-wide robot fit through this gap?" you ask "is this C-space point inside an obstacle?" The robot's geometry is baked into the C-space representation.

Obstacles: The Inflation Trick

Imagine a circular robot with radius 0.3m trying to navigate around a wall. The robot's center must stay at least 0.3m away from the wall, or it'll collide.

Instead of constantly checking "is my circle touching the wall?", we inflate the obstacle by the robot's radius. Now the robot is a point, and we check "is my point inside the inflated obstacle?"

Real space:                 C-space (inflated):
 
    Wall                        Inflated wall
    ████                        ████████
    ████                        ████████
    ████                        ████████
 
  O (robot)                     · (point)

This trick turns collision checking into a simple point-in-polygon test. Much faster.

Obstacle inflation — original obstacle boundary inflated by robot radius with rounded corners
Inflate obstacles by the robot's radius — now collision checking is just a point-in-region test.
Warning

The inflation approach assumes the robot is a circle (or can be bounded by one). For oddly-shaped robots, you need more sophisticated collision checking — but the principle is the same: simplify the geometry to speed up planning.

Types of Path Planning

Different scenarios need different approaches:

Grid-Based Planning

Divide the world into a grid (like graph paper). Mark cells as "free" or "occupied." Search for a path through free cells using algorithms like A* or Dijkstra's.

Pros: Simple, reliable, works well for 2D maps. Cons: Grid resolution trades off accuracy vs. speed. Struggles in high dimensions (6D arm planning).

Sampling-Based Planning

Randomly sample robot configurations, check if they're collision-free, and build a graph connecting nearby samples. Algorithms like RRT (Rapidly-exploring Random Tree) use this approach.

Pros: Works in high dimensions (robot arms, complex spaces). Cons: Paths are often jagged and suboptimal without post-processing.

Optimization-Based Planning

Treat the path as a curve, then optimize it to minimize cost (length, smoothness, time) while avoiding obstacles. Used for smooth, natural-looking motion.

Pros: Beautiful, smooth paths. Cons: Computationally expensive, requires good initial guess.

Collision-free path through configuration space — valid path winds between obstacles while invalid paths cross through them
A valid path threads through free C-space. Any path that enters an obstacle region means a collision.

We'll dive deeper into grid-based and sampling-based approaches in the next lessons.

The Two-Stage Pipeline

Most robots use a two-stage approach:

  1. Global planning: Compute a high-level path from start to goal using a map. This path might be 100 waypoints over 50 meters. Updated infrequently (1-10 Hz).

  2. Local planning: Follow the global path while avoiding immediate obstacles (people, chairs that weren't on the map). Updated frequently (10-50 Hz).

Think of it like driving: your GPS gives you a global plan ("turn left in 200m"), but you steer and brake to avoid cars and pedestrians.

What's Next?

You now understand what path planning is and why it's hard. Next, we'll implement the most popular global planning algorithm: A* search on occupancy grids — the workhorse of 2D robot navigation.

Got questions? Join the community

Discuss this lesson, get help, and connect with other learners on r/softwarerobotics.

Join r/softwarerobotics

Frequently Asked Questions

What is path planning in robotics?

Path planning is the process of finding a collision-free route from a start position to a goal position. It considers obstacles, terrain costs, and robot constraints. Path planning algorithms include grid-based methods (A*, Dijkstra), sampling-based methods (RRT, PRM), and potential field methods.

What is the difference between global and local planning?

Global planning finds an overall route using a map of the full environment — it runs infrequently and produces a path of waypoints. Local planning generates moment-to-moment velocity commands to follow the global path while avoiding newly detected obstacles — it runs at high frequency (10-20 Hz).

What is A* (A-star) algorithm?

A* is a graph search algorithm that finds the shortest path by combining the actual cost from the start with a heuristic estimate of remaining cost to the goal. It explores promising directions first, making it more efficient than Dijkstra's algorithm. A* is widely used for grid-based robot path planning.

Further Reading

Related Lessons

Discussion

Sign in to join the discussion.