Visual explainer
Motion Planning
Navigate around obstacles by transforming robot geometry into configuration space, searching occupancy grids with A*, and timing kinodynamic trajectories.
1. The Goal Behind Obstacles
In an open workspace , moving between two points is trivial: simply drive along the straight line connecting start and goal . In real industrial facilities, warehouses, and homes, the direct line of sight is obstructed by walls, machines, and tables.
Consider a mobile base situated at start coordinate tasked with reaching target . Two rectangular physical barriers block direct line-of-sight travel:
- Obstacle 1 spans .
- Obstacle 2 spans .
The straight line connecting and intersects Obstacle 1, meaning an uninformed drive command results in an immediate crash. The robot must formulate a sequence of collision-free movements around physical obstacles.
2. The Robot Footprint Problem
Between Obstacle 1 () and Obstacle 2 () lies a gap of width:
If the robot were an infinitesimal mathematical point (), it could slip through this opening without difficulty. However, real robots occupy physical space. Our differential-drive mobile base has a circular chassis with radius , yielding an overall diameter of:
Because , the physical body cannot squeeze through the gap. Checking collisions only at the robot's center coordinate produces catastrophic failures where the wheels and bumper wedge violently into the barrier walls.
3. Configuration Space and Obstacle Dilation
Rather than testing complex geometry collisions at every microstep along a path, motion planning transforms the problem into Configuration Space (-space). In -space, every robot posture is mapped to a single mathematical point .
To preserve safety, all physical workspace obstacles are inflated outward by the robot's geometry through a Minkowski sum with a circular structuring element of radius :
When Obstacle 1 and Obstacle 2 are dilated by , their boundary boundaries expand:
- Obstacle 1 upper boundary extends from to .
- Obstacle 2 lower boundary extends from to .
Because , the dilated obstacle shells overlap by . The narrow gap vanishes entirely in , proving rigorously that the passage is impassable. The planning algorithm can now treat the robot as a single point navigating free space .
4. Discretizing into an Occupancy Grid
Continuous space contains an uncountably infinite number of coordinates. To perform systematic search, the planner overlays a discrete 2D occupancy grid onto -space.
Each square cell has a side length of . Cells intersecting are marked as blocked, while cells completely inside are marked as traversable.
Robot transitions are defined through an 8-connected graph:
- Orthogonal steps (North, South, East, West) have cost .
- Diagonal steps (Northeast, Northwest, Southeast, Southwest) have cost .
This graph topology translates spatial navigation into a classic shortest-path network search.
5. Scoring Cells with A*
Uninformed algorithms like Breadth-First Search or Dijkstra search blindly in all directions. The algorithm accelerates search by directing exploration toward the goal using a heuristic evaluation function:
Where:
- is the exact accumulated path cost from the start node to current node .
- is the estimated remaining distance from node to goal .
For a candidate node at with prior travel cost , the Euclidean distance heuristic to goal evaluates to:
The total priority score is:
Because Euclidean distance never overestimates true travel distance (), the heuristic is strictly admissible, guaranteeing that returns the mathematically optimal shortest path.
6. Frontier Expansion via Priority Queue
The algorithm maintains two sets:
- Open Set: A priority queue (min-heap) of discovered nodes awaiting evaluation, keyed on lowest .
- Closed Set: A registry of fully evaluated nodes whose optimal routes from start have already been established.
At each iteration, the planner extracts the top node from the min-heap (), examines its valid 8-connected neighbors in , updates tentative -costs, and inserts unvisited neighbors into the heap.
The search wavefront naturally elongates into a directed cone toward the goal. When the obstacle forces the wavefront sideways, explores around the perimeter without wasting compute searching empty rooms behind the start coordinate.
7. Sampling-Based Planning in High Dimensions
Grid search works well in 2D () or 3D (), but collapses on robotic arms. A 7-DoF manipulator requires 7 joint angles to define its configuration. Discretizing each joint into just 50 bins requires:
This astronomical memory footprint is the Curse of Dimensionality. To plan motions for high-DoF manipulators, roboticists use sampling-based algorithms such as Rapidly-exploring Random Trees (RRT) and Probabilistic Roadmaps (PRM).
RRT builds a search tree incrementally:
- Sample a random configuration .
- Find the nearest existing tree vertex .
- Extend a branch from toward by step size .
- Check whether the swept link volume intersects obstacles. If collision-free, add new node to the tree.
RRT provides probabilistic completeness: as sample count approaches infinity, the probability of finding a path (if one exists) approaches 1, without ever constructing a discrete global grid.
8. Geometric Path vs Kinodynamic Trajectory
A path found by or RRT is purely geometric: an ordered sequence of spatial points . It specifies where the robot should be, but says nothing about when it should arrive or how fast its motors should spin.
If a motor controller attempts to execute a piecewise linear path with sharp 90-degree corners, velocity along the initial axis must drop to zero instantaneously while lateral velocity spikes instantaneously. This requires infinite acceleration (), which triggers motor current limits, wheel skid, and severe tracking deviation.
A kinodynamic trajectory parameterizes the geometric path with respect to time:
Trajectory generators assign trapezoidal or S-curve velocity profiles subject to physical actuator limits:
9. Path Smoothing and Feedback Tracking
To bridge the gap between discrete search and physical actuators, the raw geometric path passes through two stages:
- Spline Smoothing: Fitting cubic B-splines or quintic polynomials through waypoints replaces jagged corners with continuous curvature ( continuity), ensuring that required steering rates remain smooth and bounded.
- Closed-Loop Trajectory Tracking: While executing the trajectory, external disturbances and wheel slip cause real-world position to drift from planned reference . Real-time controllers (Pure Pursuit, Model Predictive Control, or PID) continuously measure tracking error and adjust wheel speeds to steer back onto the reference path.
10. Where It Breaks
Classic motion planning algorithms operate under the simplifying assumption that the environment is static and completely known. Real operational deployments break these assumptions:
- Dynamic Moving Obstacles: A warehouse forklift or walking pedestrian moves into the planned path after computation completes. Because static assumed fixed geometry, the robot executes its trajectory into the newly occupied space unless protected by real-time reactive collision monitors.
- Heavy Replanning Latency: If an obstacle blocks the corridor, triggering a complete global re-search can consume of CPU time. At a travel speed of , the robot covers before the new path is computed.
- Kinodynamic Infeasibility: Non-holonomic vehicles (like cars with Ackermann steering or differential bases) cannot move sideways. If a geometric planner ignores differential drive kinematic constraints (), the resulting path cannot be physically followed.
The Quick Version
- Workspace obstacles block line-of-sight paths between start and goal coordinates.
- Dimensionless point assumptions fail because physical robot chassis collide with narrow gaps.
- Configuration space inflates obstacles by robot geometry so the robot becomes a point.
- Occupancy grids discretize continuous space into graph nodes with weighted transition costs.
- A* uses admissible heuristics to guarantee finding the shortest path without overestimation.
- Priority queues focus frontier expansion directly toward the goal without blind flooding.
- Sampling-based planners overcome the curse of dimensionality for multi-joint robotic arms.
- Geometric paths lack timing; kinodynamic trajectories assign feasible velocities and accelerations.
- Spline smoothing and closed-loop feedback controllers track reference trajectories on hardware.
- Dynamic moving obstacles and replanning latency invalidate precomputed static motion plans.