๐Ÿฆพ Robotics Institute
Educational Resources

Motion Planning

Finding collision-free paths through complex environments. From graph search to sampling-based algorithms to trajectory optimization โ€” the algorithms that give robots autonomy.

What is Motion Planning?

Motion planning is the problem of finding a feasible (and ideally optimal) path or trajectory for a robot from a start configuration to a goal configuration, avoiding collisions with obstacles and respecting kinematic and dynamic constraints. It is also known as the "piano mover's problem" โ€” coined by Schwartz and Sharir (1983) โ€” because it generalizes to moving any rigid body through a cluttered environment.

Path vs Trajectory

Inputs to the Planning Problem

Computational Complexity

The general motion planning problem is PSPACE-hard (Reif, 1979). For a robot with n DOFs, the configuration space is n-dimensional. The obstacle region in C-space (C-obstacle) has complex geometry that is expensive to compute explicitly. This complexity motivates the use of sampling-based methods that avoid explicit C-obstacle computation.

🗺️ Motion planning is like GPS for robots. You know where you are and where you want to go. A* finds the shortest path, like Google Maps. RRT explores randomly, like a vine growing toward light โ€” messy but it works even in complicated spaces!

Configuration Space

The configuration space (C-space), introduced by Tomas Lozano-Perez (1983), is the space of all possible configurations of the robot. Each point in C-space represents a complete specification of the robot's position โ€” typically the vector of joint angles for a manipulator or (x, y, theta) for a planar mobile robot.

Workspace (Physical)
Robot + obstacles in 3D
C-Space (Abstract)
start → C-free → goal

C-Space Decomposition

Examples

RobotC-SpaceDimension
Point robot in 2DR^22
Rigid body in 2DR^2 x SO(1) = SE(2)3
Rigid body in 3DR^3 x SO(3) = SE(3)6
2-link planar armT^2 (torus)2
6-DOF industrial armT^66
7-DOF arm (KUKA iiwa)T^77
Humanoid (30 DOF)SE(3) x T^2430

Collision Checking

The most computationally expensive part of motion planning. Given a configuration q, determine whether the robot at q intersects any obstacle. Methods:

Completeness & Optimality

Different planning algorithms offer different guarantees:

Completeness

Optimality

Graph Search Methods

Discretize C-space into a graph (grid, lattice, or visibility graph), then search for the shortest path.

Breadth-First Search (BFS)

Explores all nodes at the current depth before moving to the next depth level. Guaranteed to find the shortest path in an unweighted graph. Time and space complexity: O(V + E). Used for simple grid-based planning when all movements have equal cost.

Dijkstra's Algorithm

Finds the shortest path in a weighted graph. Maintains a priority queue of nodes ordered by distance from the start. Explores the nearest unexplored node at each step. Optimal but explores in all directions uniformly โ€” inefficient when the goal location is known. Time complexity: O((V + E) log V) with a binary heap.

A* Search

The most important search algorithm in robotics. Combines Dijkstra's actual cost g(n) with a heuristic estimate h(n) of the remaining cost to the goal:

f(n) = g(n) + h(n)

A* expands the node with the lowest f(n). If h(n) is admissible (never overestimates the true cost) and consistent (satisfies the triangle inequality), A* is optimal and explores the minimum number of nodes among admissible algorithms. Published by Hart, Nilsson, and Raphael (1968) at SRI International.

Common Heuristics

Weighted A*

Use f(n) = g(n) + w * h(n) with w > 1. This inflates the heuristic, making the search more greedy (faster) at the cost of optimality. The solution cost is at most w times the optimal cost. In practice, w = 1.5-3 gives a good speed/quality trade-off.

D* and D* Lite

Incremental search algorithms for dynamic environments. When the environment changes (new obstacle detected), D* Lite (Koenig & Likhachev, 2002) efficiently repairs the existing search tree rather than replanning from scratch. Used in Mars rovers (Spirit and Opportunity used a variant of D*) and autonomous vehicles.

Lattice-Based Planning

Discretize the C-space into a state lattice: a regular graph where edges correspond to dynamically feasible motion primitives (precomputed short trajectories that respect the robot's dynamics). Pivonka and Kelly (2005) introduced lattice planners for field robots. Used in the DARPA Urban Challenge (CMU's Boss) and many autonomous driving systems. Graph search (A* or ARA*) on the lattice guarantees feasible, dynamically consistent paths.

Potential Fields

Artificial potential field methods, introduced by Oussama Khatib (1986), treat the robot as a particle in a potential field. The goal generates an attractive potential that pulls the robot toward it; obstacles generate repulsive potentials that push the robot away. The robot follows the negative gradient of the total potential.

U(q) = U_att(q) + U_rep(q)
F(q) = -gradient(U(q))

Attractive Potential

Typically a quadratic function of distance to the goal: U_att(q) = 0.5 * k_att * ||q - q_goal||^2. The gradient is a constant force toward the goal. For large distances, a conic (linear) potential prevents excessive force.

Repulsive Potential

Active only within a threshold distance d_0 from obstacles: U_rep(q) = 0.5 * k_rep * (1/d(q) - 1/d_0)^2 when d(q) < d_0, and 0 otherwise. The force grows rapidly as the robot approaches an obstacle, creating a repulsive "force field."

Local Minima Problem

The fatal flaw of potential fields: the robot can get trapped in local minima where attractive and repulsive forces balance. Classic example: a U-shaped obstacle between the robot and goal. Solutions:

Practical Use

Despite the local minima problem, potential fields are widely used as a reactive layer for real-time obstacle avoidance, especially in mobile robotics. The Vector Field Histogram (VFH, Borenstein & Koren, 1991) and its successor VFH+ are practical implementations used in ROS's navigation stack.

Sampling-Based Planning

Instead of explicitly constructing C-free (computationally intractable for high-DOF robots), sampling-based methods probe C-space by randomly sampling configurations and checking them for collisions. This approach scales to high-dimensional C-spaces where grid-based methods are infeasible.

Why Sampling Works

Sampling Strategies

RRT and Variants

The Rapidly-exploring Random Tree (RRT), introduced by Steven LaValle (1998), is the most influential sampling-based planning algorithm. It incrementally builds a tree rooted at the start configuration, expanding toward random samples to explore C-free.

Basic RRT Algorithm

function RRT(q_start, q_goal, max_iter):
    T.init(q_start)
    for i = 1 to max_iter:
        q_rand = random_config()        // uniform random in C-space
        q_near = nearest(T, q_rand)     // nearest node in tree
        q_new = steer(q_near, q_rand, step_size)  // extend toward q_rand
        if collision_free(q_near, q_new):
            T.add_node(q_new)
            T.add_edge(q_near, q_new)
            if distance(q_new, q_goal) < threshold:
                return extract_path(T, q_start, q_new)
    return FAILURE
q_start
Root node
Random sample
q_rand
Nearest + Steer
q_new
Collision-free?
Add to tree
Goal reached?
Extract path

Key Properties

RRT-Connect

Kuffner & LaValle (2000) introduced bidirectional RRT: grow two trees, one from start and one from goal, and try to connect them. The CONNECT heuristic extends the tree greedily (multiple steps) toward the other tree's nearest node rather than taking a single step. RRT-Connect is typically 10-100x faster than basic RRT and is the default planner in MoveIt (the ROS manipulation planning framework).

RRT* (Asymptotically Optimal)

Karaman & Frazzoli (IJRR 2011) proved that basic RRT converges to a suboptimal path with probability 1. They introduced RRT*, which adds two operations to make the algorithm asymptotically optimal:

RRT* converges to the optimal path as the number of samples increases, but convergence is slow. In practice, it produces significantly better paths than RRT given enough time.

Other RRT Variants

VariantKey IdeaReference
Informed RRT*Restrict sampling to ellipsoidal region after initial solutionGammell et al. (2014)
BIT* (Batch Informed Trees)Combines RRT* and PRM*; processes samples in batchesGammell et al. (2015)
AIT* (Adaptively Informed Trees)Adapts between RRT*-like and FMT*-like processingStrub & Gammell (2020)
Kinodynamic RRTAccounts for dynamic constraints (velocity, acceleration limits)LaValle & Kuffner (2001)
RRT-XRewiring for dynamic environments; repairs tree when obstacles moveOtte & Frazzoli (2016)
🌱 RRT (Rapidly-exploring Random Tree) is like growing a vine! It starts at one point and randomly sprouts branches in all directions. Some branches hit walls (obstacles) and stop, but others keep growing until one finally reaches the goal. It's messy compared to A*, but it works in crazy complicated spaces where A* would get stuck.

PRM and Roadmaps

The Probabilistic Roadmap Method (PRM), introduced by Kavraki, Svestka, Latombe, and Overmars (1996), takes a different approach: build a reusable graph (roadmap) of C-free in a preprocessing phase, then query it for any start-goal pair.

Two-Phase Approach

Construction phase (offline):

Query phase (online):

PRM Strengths and Weaknesses

Visibility PRM

Simeon et al. (2000) proposed keeping only "guard" and "connector" nodes: a new sample becomes a guard if it sees no existing guards, or a connector if it connects two guards. This produces a much sparser roadmap with the same coverage.

Lazy PRM

Bohlin & Kavraki (2000): delay collision checking of edges until they are needed for a query. Assume all edges are valid, find the shortest path, then check edges along that path for collisions. If a collision is found, remove the edge and replan. Saves enormous computation when most edges are never used.

Trajectory Optimization

Instead of searching through discrete samples or graph nodes, trajectory optimization treats motion planning as a continuous optimization problem: find the trajectory q(t) that minimizes a cost functional subject to constraints.

General Formulation

Minimize: integral(L(q(t), q'(t), u(t)) dt) + Phi(q(T))
Subject to: q''(t) = f(q, q', u) (dynamics)
g(q(t)) >= 0 (obstacle avoidance)
q(0) = q_start, q(T) = q_goal (boundary conditions)
joint limits, velocity limits, torque limits

CHOMP (Covariant Hamiltonian Optimization for Motion Planning)

Ratliff et al. (2009, CMU) proposed CHOMP: represent the trajectory as a sequence of waypoints and optimize using functional gradient descent. The cost combines a smoothness term (penalizes acceleration) and an obstacle cost (based on signed distance to obstacles). CHOMP uses precomputed signed distance fields for fast gradient computation. Available in MoveIt.

STOMP (Stochastic Trajectory Optimization for Motion Planning)

Kalakrishnan et al. (2011, USC) introduced STOMP: generate noisy trajectory samples around the current trajectory, evaluate their costs, and update the trajectory as a cost-weighted average. Unlike CHOMP, STOMP does not require gradient information โ€” it works with arbitrary cost functions (useful when the cost is non-differentiable). Also available in MoveIt.

TrajOpt

Schulman et al. (2014, UC Berkeley) formulated motion planning as sequential convex optimization. Obstacle avoidance is a constraint (not a cost term), using signed distances and their linear approximations. Supports continuous-time collision checking (swept volumes). Fast convergence. Used in planning for manipulation and autonomous driving.

Direct Collocation and Direct Transcription

Transcribe the continuous-time optimal control problem into a finite-dimensional nonlinear program (NLP) by discretizing the trajectory into N time steps. Decision variables: states and controls at each knot point. Dynamics are enforced as equality constraints (collocation = using polynomial interpolation between knot points). Solved with NLP solvers (IPOPT, SNOPT). This is the standard approach in Drake (MIT) for kinodynamic planning.

Trajectory Optimization vs Sampling-Based Planning

AspectSampling-Based (RRT/PRM)Trajectory Optimization
CompletenessProbabilistically completeLocal optimizer โ€” needs good initialization
OptimalityRRT* is asymptotically optimalFinds local optimum
Narrow passagesHandles well (eventually)May fail if initialization is on wrong side
Solution qualityJagged without smoothingSmooth by construction
SpeedFast first solution, slow to optimizeFast if initialized well
Dynamic constraintsHard to incorporateNatural via constrained optimization

In practice, the best systems combine both: use RRT/PRM for an initial feasible path, then refine with trajectory optimization for smoothness and dynamic feasibility.

Real-Time Replanning

Static planning assumes a known, fixed environment. Real robots operate in dynamic environments where obstacles move, new obstacles appear, and the environment is only partially known. Real-time replanning adapts the plan as new information arrives.

Approaches

Dynamic Obstacle Handling

Global Planner — 1-10 Hz — A*, RRT
Local Planner — 10-50 Hz — DWA, TEB
Reactive Layer — 100-1000 Hz — E-stop, potential fields

Planning Frequency Hierarchy

Applications

Robotic Manipulation

MoveIt (ROS) uses RRT-Connect, PRM, CHOMP, and STOMP for arm motion planning in cluttered environments. Pick-and-place, assembly, and bin picking all require collision-free arm trajectories planned in joint space or Cartesian space.

MoveIt 2 | Open-source | 5k+ GitHub stars

Autonomous Driving

Self-driving cars plan in structured environments (lanes, intersections). Lattice planners, optimization-based planners (CasADi), and RL-based planners generate trajectories that respect traffic rules, comfort, and safety. Waymo, Cruise, and Motional all use trajectory optimization variants.

Structured environments | Real-time | Safety-critical

Drone Navigation

UAV planning requires fast 3D path planning with dynamic constraints. Minimum-snap trajectory optimization (Mellinger & Kumar, 2011) produces smooth polynomial trajectories for quadrotors. EGO-Planner (Zhou et al., 2020) enables aggressive autonomous flight through unknown environments.

3D planning | Dynamic obstacles | 30+ Hz replanning

Multi-Robot Coordination

Planning for multiple robots simultaneously. Conflict-Based Search (CBS, Sharon et al., 2015) finds optimal collision-free paths for teams of agents. Priority-based planning assigns robot priorities and plans sequentially. Used in Amazon warehouse robots (Kiva/Amazon Robotics) coordinating hundreds of agents.

MAPF | Warehouse logistics | Combinatorial complexity

Surgical Robotics

Motion planning for surgical robots must avoid sensitive anatomy, pass through small incisions (remote center of motion constraint), and handle deformable tissue. Special-purpose planners for needle steering, catheter navigation, and instrument insertion.

Constrained planning | Sub-mm accuracy

Legged Locomotion

Footstep planning and whole-body motion planning for humanoids and quadrupeds. The footstep planning problem is a discrete search over contact locations. Whole-body planning then generates dynamically feasible trajectories between contacts. Mixed-integer programming and graph search on contact sequences.

Contact planning | Dynamic feasibility | Real-time

References & Further Reading

LaValle: Planning Algorithms (2006)

THE definitive textbook on motion planning. Covers C-space, combinatorial planning, sampling-based planning, differential constraints, and decision-theoretic planning. Free online.

Cambridge University Press | Free PDF

Karaman & Frazzoli: Sampling-based Algorithms for Optimal Motion Planning (2011)

Introduced RRT* and PRM*. Proved that basic RRT almost surely converges to a suboptimal path. The paper that made asymptotic optimality a standard requirement.

IJRR | 5000+ citations

Kavraki et al: Probabilistic Roadmaps for Path Planning (1996)

The original PRM paper. Demonstrated that sampling-based planning scales to high-dimensional C-spaces where deterministic methods fail.

IEEE T-RO | 6000+ citations

MoveIt 2

The most widely used open-source motion planning framework for robot arms. Integrates OMPL (sampling-based planners), CHOMP, STOMP, and Pilz industrial trajectory generator.

ROS 2 | C++ / Python | BSD

OMPL (Open Motion Planning Library)

Library of sampling-based planners: RRT, RRT*, RRT-Connect, PRM, PRM*, BIT*, EST, KPIECE, and more. Backend for MoveIt. Created at Rice University (Kavraki Lab).

C++ / Python | Rice University | BSD

Schulman et al: Finding Locally Optimal, Collision-Free Trajectories with Sequential Convex Optimization (2014)

TrajOpt paper. Sequential convex optimization for motion planning with continuous-time collision checking. Fast and practical for manipulation planning.

IJRR | UC Berkeley