Rotation-axis direction uncertainty in clearance bounds (source code)

= Rotation-axis direction uncertainty in clearance bounds

<Rotation-axis direction uncertainty in clearance bounds> accounts for a <robot> rotating about a direction different from the modeled direction. Even an exactly located pivot does not determine the final occupied geometry if its axis direction is uncertain. Rotation acts through a <rotation matrix>; <Rodrigues rotation formula> computes that <matrix> from a unit axis and rotation angle.<Modern Robotics: Mechanics, Planning, and Control by Kevin M. Lynch and Frank C. Park>[§3.2.3, Exponential Coordinates of Rotation, Part 2, Rodrigues formula]{ref}

Assume the pivot $c$ and principal rotation angle $0\le\theta\le\pi$ are known and shared by both models. Let the unit axes be $u,\widehat u$, separated by $\alpha$, and suppose every occupied point obeys $\|p-c\|\le R$. The endpoint discrepancy is
$$
(Q(u,\theta)-Q(\widehat u,\theta))(p-c).
$$
It measures error against a nominal endpoint, not total motion from the initial position.

One exact <operator norm> calculation uses the unit <quaternions> $(\cos(\theta/2),u\sin(\theta/2))$ and its modeled counterpart. Their scalar product is
$$
d=\cos^2(\theta/2)+\sin^2(\theta/2)\cos\alpha
=1-2\sin^2(\theta/2)\sin^2(\alpha/2).
$$
The relative rotation has half-angle cosine $|d|$. A rotation through angle $\beta$ moves a perpendicular unit vector by $2\sin(\beta/2)$, giving
$$
\|Q-\widehat Q\|_2=2\sqrt{1-d^2}
\le4\sin(\theta/2)\sin(\alpha/2).
$$
Consequently, if the direction error is at most $\alpha_{\max}\le\pi$,
$$
\boxed{\|p'-\widehat p'\|\le R\min\{2,4\sin(\theta/2)\sin(\alpha_{\max}/2)\}.}
$$
The cap $2R$ follows because both endpoints lie on the same radius-$R$ sphere. The bound vanishes at zero rotation and, for small axis error, scales approximately as $2R\sin(\theta/2)\alpha_{\max}$. Opposite oriented axes represent the same rotation at $\theta=\pi$; the conservative inequality need not capture that special cancellation.

For an original rotary-tool example, $R=0.50\,\mathrm m$, $\theta=90^\circ$ and $\alpha_{\max}=1^\circ$ give an endpoint-error allowance of $0.01234\,\mathrm m$, about $12.34\,\mathrm{mm}$. A direction tolerance that looks small numerically can consume a substantial clearance margin at a long tool tip.

A <combined pivot and axis uncertainty in rotational clearance> must add or jointly bound pivot-location error, angle error and direction error without double-counting a shared coordinate-frame error. The fixed-axis formula in <pivot-location uncertainty in a rotational clearance bound> addresses a different contribution. For a proposed test, observe multiple rigid fiducials over several angles, fit pivot and direction, and validate independent endpoint measurements against the claimed enclosure. Geometric <robot motion planning> needs the resulting occupied-body bound along the path, rather than only at its final orientation.<Robotic Systems by Kris Hauser>[Chapter 9, C-obstacles for rotational motion]{ref}