Back to all posts
Tutorial

Part 7: Planning and The Generative Shift

Ensemble AI
June 20, 2026
6 min read

Welcome to Part 7 of "Robotics Zero to Hero." We can model geometry, compute kinematics, and stabilize dynamics. The next step is autonomy: getting from Point A to Point B without crashing. This is Motion Planning — and it is the clearest example in all of robotics of how high dimensionality changes the kind of algorithm you must use.

The Math: Configuration Space and the Curse of Dimensionality

Humans plan in the 3D world (task space). Robots must plan in Configuration Space (C-space) Q\mathcal Q, the nn-dimensional manifold from Part 1 where each point is a complete posture. Obstacles in the world map to complicated, warped C-obstacles Qobs\mathcal Q_{obs}, and planning means finding a continuous path through the free space Qfree=QQobs\mathcal Q_{free} = \mathcal Q \setminus \mathcal Q_{obs} from qstart\mathbf q_{start} to qgoal\mathbf q_{goal}.

Why not just lay down a grid and run A*? Because of the curse of dimensionality. A grid with resolution rr per axis has

Ncells=rnN_{cells} = r^{\,n}

cells. At a modest r=100r=100: a 2-DOF planar robot needs 10410^4 cells (trivial), a 6-DOF arm needs 101210^{12} (already infeasible), and a 20-DOF hand needs 104010^{40} (more cells than atoms in your body). Grid and exact methods die exponentially in nn. This single fact is why high-dimensional robotics looks nothing like low-dimensional robotics.

Sampling-based planning: trading completeness for tractability

The escape is to sample C-space rather than enumerate it. Rapidly-exploring Random Trees (RRT) grow a tree by repeatedly shooting toward random configurations:

  1. Initialize a tree at qstart\mathbf q_{start}.
  2. Sample a random configuration qrand\mathbf q_{rand}.
  3. Find the nearest tree node qnear\mathbf q_{near}.
  4. Step from qnear\mathbf q_{near} toward qrand\mathbf q_{rand} to get qnew\mathbf q_{new}.
  5. If the edge is collision-free, add qnew\mathbf q_{new}.
  6. Repeat until the tree reaches qgoal\mathbf q_{goal}.

RRT is probabilistically complete (probability of finding a solution → 1 as samples → ∞) but its paths are jagged and not optimal. RRT* (Karaman & Frazzoli, arXiv:1105.1186) adds a rewiring step and is asymptotically optimal — the path cost converges almost surely to the minimum. The crucial property: sampling cost scales with problem difficulty, not with rnr^n, which is why it survives in high dimensions where grids cannot.

Python Implementation: A Simple Path Planner

Loading Interactive Python Environment...

The planner zoo and its trade-offs

PlannerGuaranteeStrengthsShortcomings
Grid + A* / DijkstraResolution-complete, optimal-on-gridSimple, optimal in low-dimO(rn)O(r^n) — dies above ~4–5 DOF
PRMProbabilistically completeReusable roadmap for multi-queryPoor in narrow passages; build cost
RRTProbabilistically completeFast single-query, high-dim friendlyJagged, sub-optimal paths
RRT*Asymptotically optimalConverges to optimumSlow convergence; memory grows
Trajectory optimization (CHOMP/TrajOpt)Locally optimalSmooth, respects dynamics/costsLocal minima; needs a seed
MPPI (sampling MPC)Stochastic, real-timeHandles nonlinear dynamics, GPU-parallelNo global guarantee; tuning-sensitive
Diffusion plannersLearned, multimodalCaptures complex constraints from dataNeeds demonstrations; inference cost

The Generative Shift: Diffusion Models

For cluttered scenes or nuanced contact-rich tasks (grasping an irregular object), classical planners struggle: the cost landscape is riddled with local minima and the "right" behavior is multimodal (many equally-good ways to act). The modern answer is generative planning with diffusion models.

A diffusion model corrupts data with Gaussian noise until it is pure static, then trains a network to reverse that process. In robotics the "data" is a trajectory τRH×D\boldsymbol\tau \in \mathbb{R}^{H\times D} (HH time steps, DD degrees of freedom). The forward (noising) process is a stochastic differential equation

dτ=f(τ,t)dt+g(t)dwd\boldsymbol\tau = \mathbf f(\boldsymbol\tau, t)\,dt + g(t)\,d\mathbf w

and planning runs the reverse SDE, which depends on the learned score τlogpt(τ)\nabla_{\boldsymbol\tau}\log p_t(\boldsymbol\tau):

dτ=[f(τ,t)g(t)2τlogpt(τ)]dt+g(t)dwˉd\boldsymbol\tau = \big[\mathbf f(\boldsymbol\tau,t) - g(t)^2 \nabla_{\boldsymbol\tau}\log p_t(\boldsymbol\tau)\big]dt + g(t)\,d\bar{\mathbf w}

Starting from pure noise and denoising, we generate a feasible trajectory; conditioning the reverse process on the current scene (a camera image) or on a cost (classifier guidance) steers the sample to avoid obstacles and reach the goal. Two foundational works: Diffuser (Janner et al., arXiv:2205.09991) folds planning into sampling, and Diffusion Policy (Chi et al., arXiv:2303.04137) shows this excels precisely in high-dimensional, multimodal action spaces — the exact regime where RRT and trajectory optimization strain.

High-Dimensional vs. Low-Dimensional, Summarized

Low-dim (≤ ~4 DOF)High-dim (arms, hands, tentacles)
Best toolGrid/A*, analyticSampling (RRT*), optimization, learned/diffusion
WhyEnumeration is cheaprnr^n enumeration impossible
OptimalityAchievableAsymptotic or local only
BottleneckAlmost noneNearest-neighbor queries, collision checks, local minima

The throughline of this entire series lands here: dimension dictates the algorithm. What is a solved problem at 2 DOF is a research frontier at 20.

Focus on the Octopus: Imagining Grasping Motions

For our metallic continuum octopus, grasping is a nonlinear nightmare. A rigid robot pinches with a two-finger gripper; an octopus wraps its whole tentacle around an object, conforming to its shape — a contact-rich, hyper-redundant motion (Part 3) with an enormous configuration dimension.

Computing such a conforming wrap with RRT is hopeless: the C-space is too high-dimensional and the contact constraints too intricate. Instead we collect thousands of teleoperated demonstrations of successful wraps across many shapes and train a diffusion policy on those trajectories. Faced with a new, unseen object, the model effectively imagines how to wrap — denoising a random trajectory conditioned on the live camera feed until a feasible grasp emerges. This is the generative shift made physical: where enumeration fails, we learn the distribution of good behavior and sample from it.

In Part 8 we look at the hardware needed to run these heavy models on the robot itself.

Further reading: LaValle, "Planning Algorithms" (2006); Karaman & Frazzoli (arXiv:1105.1186); Janner et al. (arXiv:2205.09991); Chi et al. (arXiv:2303.04137); Williams et al. on MPPI (arXiv:1707.02342).

Interested in the research?

We collaborate with researchers, engineers, and institutions pushing Physical AI into extreme environments. Get in touch to explore working with the lab.

Collaborate with us

Ensemble Assistant

Ready

Quick Actions: