Problemcore
Trajectory optimization
Also called optimal trajectory planning.
Find a state and control trajectory that minimizes a cost subject to the dynamics, limits, contacts and obstacles.
Trajectory optimization chooses how a system should move over time so that a cost is as small as possible. The system can be a robot arm, a car, an aircraft or a walking robot. Its motion obeys equations of motion, its controls such as motor torques have limits, and it must avoid obstacles or make and break contact with the ground. The cost measures what we want to save: time, energy, effort, or the roughness of the motion. The answer is a full trajectory: the state at every time and the control that produces it. Unlike the trajectory generation problem for a given path, trajectory optimization chooses the path and the timing together, and it uses a model of the dynamics. It is the optimal control problem in the form robotics meets it: finite horizon, nonlinear dynamics, many constraints, and an answer needed as numbers on a time grid. Obstacles and nonlinear dynamics make the problem nonconvex, so the practical methods are local: they start from an initial guess and improve it until no small change helps. They can stop in a poor local minimum, and the result depends on the guess.
In plain words
Imagine planning how to throw a ball into a basket, or how to swing a robot arm around a table to a shelf. There are endless ways to do it. Some are fast, some use little force, some hit the table. We write down a score for each motion, such as the total effort plus a big penalty for touching the table, and search for the motion with the best score that the arm can really do. The search usually starts with a rough guess, such as a straight move that goes through the table, and bends it step by step into a better one. This works well, but it finds the best motion near the guess, not always the best motion of all.
Definition
Input.
- Dynamics , or in discrete time , for states and controls . Kinematic problems use , so the control is the velocity.
- A horizon , fixed or free, or a number of steps .
- Boundary conditions: the initial state , and a goal state or goal set.
- Path constraints : joint and torque limits, obstacle distances, contact conditions.
- A cost , or its sum over steps.
Output. A pair that meets the dynamics, the boundary conditions and the path constraints, and minimizes . Because the problem is nonconvex in general, the methods return a local minimum or a stationary point, and some return only a feasible trajectory that is better than the guess.
Single-letter quantities used on this page. is the state dimension, the control dimension, the number of time steps, and the dimension of the configuration space.
Variants
- Kinematic, with obstacles. The variables are configurations with fixed ends. The cost is a smoothness term, such as the sum of , plus a term that penalizes closeness to obstacles. CHOMP, STOMP, sequential convex optimization, GPMP2 and elastic bands solve this form.
- Dynamic, with control limits. Nonlinear dynamics and box limits on the controls, with a smooth cost. Control-limited DDP solves it by a backward pass of quadratic models and a forward rollout.
- Through contact. The trajectory may make and break contact, and the contact forces are variables with complementarity conditions; see contact-implicit trajectory optimization.
- Fixed path, free timing. With the geometry fixed, the problem reduces to time-optimal path parameterization, which is convex after a change of variables.
- Linear and quadratic. Linear dynamics, a quadratic cost and no inequality constraints give the LQR problem, solved exactly by a Riccati recursion.
- Receding horizon. Solve a short problem from the current state at every control cycle and apply the first control: nonlinear model predictive control, often with one iteration per cycle as in the real-time iteration.
- Direct and indirect. Direct methods discretize the trajectory and solve the resulting finite nonlinear program; indirect methods solve the necessary conditions of the Pontryagin maximum principle as a boundary value problem (indirect method). Betts (1998) surveys both.
Examples
A point around a disc. A point moves in the plane from to and must stay outside the disc of radius at the origin; the cost is the length. The straight line crosses the disc. There are two optimal paths, one above and one below the disc, each made of two tangent segments of length and an arc of angle , for a total length
The feasible set is not convex: the two optimal paths are feasible, but their average, the straight line, is not. A local method started from the straight line sees a cost gradient that is symmetric about the axis and can stay on it; a small push to one side decides which of the two optima it finds. This is the typical behavior of the obstacle variants.
A scalar linear system. For with the cost over an infinite horizon, the Riccati equation gives , so , and the optimal control is . Here the problem is convex and the answer is global and in closed form.
One axis, minimum time. Moving one joint over with and in the least time gives the trapezoidal velocity profile with . As a trajectory optimization problem the control is , the cost is , and the answer is bang-bang with a cruise phase.
Known algorithms
- Smoothness plus obstacle cost, gradient based: CHOMP, a covariant gradient method that uses the smoothness metric. Elastic bands, which deform a path by internal and external forces and keep collision-free bubbles around it.
- Sampling based, gradient free: STOMP, which samples noisy trajectories and averages them by their costs. The cross-entropy method is a related general optimizer.
- Sequential convex programming: TrajOpt, which convexifies the collision constraints, solves a quadratic program in a box around the current trajectory, and enlarges or shrinks the box.
- Probabilistic inference: GPMP2, which sets a Gaussian process prior on trajectories and solves the resulting factor graph by Gauss-Newton or Levenberg-Marquardt steps.
- Dynamic programming in the neighborhood of a trajectory: control-limited DDP, with a box-constrained quadratic program for each step of the backward pass.
- Through contact: contact-implicit trajectory optimization, which keeps contact forces and complementarity conditions as constraints of one nonlinear program.
- Convex special cases: the LQR problem by the Riccati recursion; time-optimal path parameterization by the convex formulation.
- General constrained optimization: penalty and augmented Lagrangian methods applied to the transcribed problem.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| CHOMP | O(I n (d + m)) worst | O(n d) extra | deterministicnot exactofflinenot randomized | 1 language |
| Contact-implicit trajectory optimization | O(T N^3) worst | O(N^2) extra | deterministicnot exactofflinenot randomized | 1 language |
| Control-limited differential dynamic programming | O(I N (n^3 + p m^3 + F)) worst | O(N n m + n^2) extra | deterministicnot exactofflinenot randomized | 1 language |
| Gaussian process motion planning | O(I N ((k + 1) m d + d^3)) worst | O(N d^2) extra | deterministicnot exactofflinenot randomized | 1 language |
| Sequential convex trajectory optimization | O(I N n m) worst | O(n m) extra | deterministicnot exactofflinenot randomized | 1 language |
| STOMP | O(I (K n (d + C) + n^2 d)) worst | O(K n d + n^2) extra | randomizednot exactofflinerandomized | 1 language |
Bounds
- No global guarantee in general. Deciding whether any collision-free path exists for a robot with many degrees of freedom among obstacles is PSPACE-hard in the generalized form of the piano movers' problem. A method that always found a global optimum would also decide this question, so the practical methods aim at local minima.
- Convergence of the local methods. The methods on the pages of this group come with local results of different strengths: a decrease of the cost at each step, convergence to a stationary point under assumptions, or no guarantee at all. Each page states the result separately from its cost per iteration.
- Cost per iteration. The trajectory structure makes the linear algebra banded. A Newton or Gauss-Newton step on steps with states costs by a block tridiagonal or Riccati solve, instead of for a dense solve. CHOMP with a finite-difference smoothness metric solves a banded system in per iteration.
Reductions
- To a finite nonlinear program. Discretizing the states and controls on a time grid, and imposing the dynamics as equality constraints between neighboring steps, turns the problem into a nonlinear program with a sparse, banded structure. This is direct transcription in Betts (1998).
- To LQR locally. A second-order model of the cost and a first-order model of the dynamics in the neighborhood of a trajectory give an LQR problem for the correction. DDP and its relatives solve one such problem per iteration.
- From motion planning. A motion planning algorithm such as a rapidly-exploring random tree gives a feasible but rough path; trajectory optimization then smooths and shortens it. This combination covers the weakness of each: the planner explores globally, the optimizer refines locally.
- Fixed path to a convex program. For a fixed path, the change of variables makes the time-optimal problem convex (convex formulation).
Applications
Robot arms use trajectory optimization to plan smooth collision-free motions in cluttered cells and kitchens. Legged robots and humanoids plan motions through contact, such as walking, jumping and climbing. Aircraft, rockets and spacecraft follow optimal ascent, reentry and transfer trajectories, which is where many of the numerical methods began. Autonomous cars optimize their path and speed in a receding horizon. Animation systems use the same methods to make characters move in a physically plausible way.
References
- John T. Betts, Survey of numerical methods for trajectory optimization, Journal of Guidance, Control, and Dynamics 21(2), 1998, 193-207, the whole paper (direct and indirect methods, transcription to a nonlinear program)
- Kevin M. Lynch and Frank C. Park, Modern Robotics, Mechanics, Planning, and Control, Cambridge University Press, 2017, Section 10.7 (motion planning by nonlinear optimization)
- Matt Zucker, Nathan Ratliff, Anca D. Dragan, Mihail Pivtoraiko, Matthew Klingensmith, Christopher M. Dellin, J. Andrew Bagnell and Siddhartha S. Srinivasa, CHOMP: Covariant Hamiltonian optimization for motion planning, The International Journal of Robotics Research 32(9-10), 2013, 1164-1193, the whole paper (trajectory optimization as a motion planner, and its local minima)
- John Schulman, Yan Duan, Jonathan Ho, Alex Lee, Ibrahim Awwal, Henry Bradlow, Jia Pan, Sachin Patil, Ken Goldberg and Pieter Abbeel, Motion planning with sequential convex optimization and convex collision checking, The International Journal of Robotics Research 33(9), 2014, 1251-1270, the whole paper (the nonconvex problem and a local method for it)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag ZEP6AG Edit this page History Report an error Markdown