Robust swing-foot clearance margin (source code)

= Robust swing-foot clearance margin

A <robust swing-foot clearance margin> is a guaranteed lower separation between a robot's swing foot and terrain over a specified crossing interval and set of allowed errors. It differs from clearance computed only for a nominal <trajectory>. The interval must exclude intended ground contacts when a strictly positive margin is required.

An original point-foot model lets the planned terrain be $H(x)$ and the planned clearance be $c_0=z-H(x)$. Assume actual vertical foot error $|\delta_z|\le\epsilon_z$, horizontal error $|\delta_x|\le\epsilon_x$, and terrain-model height error bounded by $\epsilon_H$. If $H$ has <Lipschitz constant> $L_H$ over the relevant neighborhood, then
$$
|H(x+\delta_x)-H(x)|\le L_H\epsilon_x.
$$
The actual clearance consequently satisfies
$$
\boxed{c_{\rm actual}\ge c_0-\epsilon_z-\epsilon_H-L_H\epsilon_x.}
$$
This follows from the <triangle inequality> and covers all errors in the stated bounds. Their effects add in a worst-case calculation; combining them as independent random <standard uncertainties> would answer a different question.

For a local sloped-terrain example, take $\epsilon_z=3\,\mathrm{mm}$, $\epsilon_H=4\,\mathrm{mm}$, $\epsilon_x=2\,\mathrm{mm}$ and $L_H=0.5$. The total clearance allowance is $3+4+0.5(2)=8\,\mathrm{mm}$. Guaranteeing a $5\,\mathrm{mm}$ margin therefore requires nominal clearance at least $13\,\mathrm{mm}$ throughout that crossing. A nominal $5\,\mathrm{mm}$ gap gives only a $-3\,\mathrm{mm}$ lower bound and cannot certify the requested separation.

Finite path samples need another allowance. Suppose the nominal clearance as a function of path parameter $s$ is Lipschitz with constant $L_c$, and every point lies within $\Delta s/2$ of a checked sample. If the smallest sampled clearance is $c_{\rm sample}$, a <clearance bound between trajectory samples> gives
$$
\min_s c_{\rm actual}(s)\ge c_{\rm sample}-\frac{L_c\Delta s}{2}
-\epsilon_z-\epsilon_H-L_H\epsilon_x.
$$
With $L_c=0.10\,\mathrm m$ per unit parameter and sample spacing $\Delta s=0.10$, between-sample uncertainty costs another $5\,\mathrm{mm}$. The preceding example would then require sampled clearance at least $18\,\mathrm{mm}$ for a certified $5\,\mathrm{mm}$ margin.

Bounds must match the geometry. A vertical obstacle edge is not covered by a finite height-slope bound across its discontinuity; use the full <configuration-space obstacle> instead. Shared coordinate-frame errors can also cancel in a relative clearance, so separate component bounds can be conservative when their joint dependence is known.

The primary robotics formulation requires constraints along the full path and distinguishes planned from executed motion.<Robotic Systems by Kris Hauser>[Chapter 8, Point-to-point path planning and Explicit vs implicit plans]{ref} A proposed test records terrain and foot geometry in one reference frame, validates the stated error bounds, and compares a continuous-path certificate with observed minimum separation. A passing sample grid without the intervening bound does not establish the same guarantee.