Glossary · Robotics and control

Monotone cubic spline

Also called PCHIP, Fritsch–Carlson interpolation, cubic Hermite spline, spline

A smooth curve through a set of points that never overshoots them, so it rises where the points rise and stays flat where they're flat.

A spline is a curve made of polynomial pieces joined smoothly. A cubic spline uses a third-degree polynomial between each pair of points. On each interval from tkt_k to tk+1t_{k+1}, with s=(t−tk)/hs = (t - t_k)/h and h=tk+1−tkh = t_{k+1} - t_k, a cubic Hermite piece is set by the two end values yk,yk+1y_k, y_{k+1} and the slopes mk,mk+1m_k, m_{k+1} there:

p(s)=(2s3−3s2+1) yk+(s3−2s2+s) h mk+(−2s3+3s2) yk+1+(s3−s2) h mk+1p(s) = (2s^3 - 3s^2 + 1)\,y_k + (s^3 - 2s^2 + s)\,h\,m_k + (-2s^3 + 3s^2)\,y_{k+1} + (s^3 - s^2)\,h\,m_{k+1}

The overshoot problem

A standard smooth cubic spline chooses slopes to make the curve as smooth as possible. Near sharp changes this makes it overshoot: it swings past the data and back. For motion that is visible and can be harmful. A foot meant to rest at floor height dips below the floor, or a joint briefly passes its limit.

The monotone fix

Fritsch and Carlson (1980) choose the slopes mkm_k so that the curve is monotone wherever the data is: if the points only rise, the curve only rises; if two neighbouring points are equal, the curve stays flat between them. Slopes are taken from the neighbouring secant slopes Δk=(yk+1−yk)/h\Delta_k = (y_{k+1} - y_k)/h and set to zero at peaks and valleys. This is often called PCHIP (piecewise cubic Hermite interpolating polynomial).

The cost is a little less smoothness: the second derivative can jump at the points. For keyframed motion that’s a good trade.

In this project

The keyframes of the recovery moves are joined with monotone cubic splines, so a foot that should stay planted, or a heel that should stay down, doesn’t drift between keys.

Related terms

Used in

← All terms