Robot control

Direct collocation

Definition

Direct collocation is a trajectory-optimization method that represents states and controls at selected time points and enforces the dynamics through algebraic constraints at collocation points. It converts a continuous optimal-control problem into a finite nonlinear program.

Also known as: Direct collocation method

Updated

Optimize a sampled continuous trajectory

Direct collocation treats sampled states, sampled controls, and sometimes time intervals as decision variables. Polynomial segments interpolate between the samples. Constraints require the interpolated derivative to agree with the robot dynamics at selected collocation points.

MIT's trajectory-optimization notes describe a common formulation with piecewise-linear controls, cubic state splines, and midpoint derivative constraints. The optimizer can also include boundary conditions, torque limits, collision constraints, and task costs.

For a legged robot, direct collocation can search for joint and body trajectories that move between poses while respecting a chosen contact model. For an arm, it can optimize a swing, throw, or other motion in which dynamics and actuator limits matter.

How it differs from shooting

Direct shooting chooses controls and obtains states by forward simulation. Direct collocation exposes both states and controls to the optimizer and enforces dynamics as constraints. This usually creates a larger but sparse optimization problem. It can also make state constraints easier to express and reduce the long sensitivity chains that can make shooting difficult.

Direct collocation is one method within trajectory optimization, not a synonym for the whole field. Pseudospectral methods use related collocation ideas with global polynomial bases, while differential dynamic programming follows a different local optimization procedure.

Discretization and local minima remain

The dynamics hold exactly only at the enforced points for the chosen transcription. A coarse mesh may hide violations between them, so the resulting motion should be checked by denser simulation and, where needed, mesh refinement.

The nonlinear program can converge to a poor local solution or fail from a bad initial guess. Contact adds mode choices, complementarity conditions, and numerical stiffness. A solver result is therefore a candidate trajectory under an approximate model, not proof that the physical robot can execute it safely.

Sources