Growing Certified Attitude Envelopes on SO(3) Without Coordinate Charts

Robots that learn their own dynamics safely usually do it by expanding a "safe set," meaning a region of states where a mathematical certificate guarantees the system can always stay out of trouble. The robot starts in a small region it can certify, flies or moves toward the edge of that region to collect data where its model is least sure, and then grows the region as the model improves. This works well when the state lives in flat space. For an aerial robot it breaks down in the coordinate that matters most for agile flight: orientation. Every three-number description of 3D orientation has a bad spot. With roll, pitch, and yaw angles the bad spot is gimbal lock at ±90° pitch, where two rotation axes line up and the math divides by zero. Four-number quaternions avoid that but count every orientation twice. A safe set expanded in any of these coordinates either stalls before the bad spot or certifies things that do not hold physically.

We propose to build both the safety certificate and the learned uncertainty model directly on the space of rotations, SO(3), by writing them as smooth functions of the 3×3 rotation matrix rather than of any angle chart. The step that makes this work is to treat the very property that causes gimbal lock as an advantage. SO(3) is compact, meaning closed and bounded, and that is why no single flat coordinate system can cover it. The same compactness means a finite grid of orientations with a known spacing covers all of it. That allows the certificate to be checked on the whole rotation space, including upside-down attitudes, with no chart switching. The deliverable is a safe exploration loop for attitude dynamics that can grow its certified envelope past 90° of tilt and toward inversion, which current Euclidean methods cannot do.

Core Claim

Our claim is that iterative safe set expansion fails on rotations because of how the barrier function and the uncertainty model are parameterized, and that it can be fixed with two choices that cost little. A barrier function here is a scalar function $h$ whose nonnegative region is the certified safe set and whose rate of change the controller keeps from going too negative. Both the barrier and the Gaussian process (GP, a regression model that gives a mean prediction together with a calibrated uncertainty) should be written in terms of the rotation matrix $R$ and the body angular velocity $\omega$, using the distance between rotation matrices. The specific GP kernel is

$$k\big((R,\omega),(R',\omega')\big) = \sigma^2 \exp\!\Big(-\tfrac{\|R-R'\|_F^2}{2\ell^2}\Big)\, k_\omega(\omega,\omega'),$$

where $\|R-R'\|_F^2 = 4(1-\cos\theta)$ and $\theta$ is the rotation angle between the two attitudes. $\sigma^2$ and $\ell$ are the usual variance and length-scale, and $k_\omega$ is any standard kernel on angular velocity. This kernel is a restriction of an ordinary nine-dimensional squared-exponential kernel, so it is valid positive definite. It depends only on the true angle between attitudes, so it is smooth everywhere, has no gimbal lock, and has no double-counting. Data gathered at one attitude reduces uncertainty at nearby attitudes in a way that reflects the physics, and a chart boundary never cuts that sharing off.

The certified set at iteration $k$ is $S_k=\{(R,\omega): h_k(R,\omega)\ge 0\}$. Here $h_k$ is built from a low-degree polynomial in the entries of $R$ plus a quadratic in $\omega$. One example is a weighted sum of terms like $\mathrm{tr}(R_c^\top R)$ around chosen centers $R_c$, minus $\tfrac12\omega^\top P\omega$. This family can describe regions that are not geodesically convex, such as a band reaching past 90° tilt. Such sets are exactly what the contraction-based method of Geometric Reachability for Attitude Control Systems via Contraction Theory cannot handle, because it needs small, strongly convex sets.

A candidate enlargement is accepted only if the barrier decrease condition holds on a finite cover of $S_{k+1}$. The condition must hold with a margin equal to a multiple $\beta$ of the GP standard deviation, plus a Lipschitz term in the chordal metric:

$$\inf_{u\in\mathcal U}\Big[\nabla h_{k+1}\cdot \big(f(x,u)+\mu_k(x)\big) - \beta\,\|\nabla h_{k+1}\|\,\sigma_k(x) + \alpha\big(h_{k+1}(x)\big)\Big] \;\ge\; L\,\tau \quad \text{for all grid points } x.$$

In this condition, $f$ is the nominal rigid-body model and $\mu_k,\sigma_k$ are the GP mean and standard deviation of the unmodeled torque. $\alpha$ is a class-K function and $\mathcal U$ is the torque limit set. $L$ is a Lipschitz constant of the bracketed expression. $\tau$ is the covering radius of the grid. A uniform grid on SO(3) has a known covering radius, so the cover can be made as fine as needed without any chart.

What is new is the combination: intrinsic certificates, intrinsic uncertainty, and a global finite-cover check, all inside an online exploration loop. Each piece has a precedent, but the loop that grows past the 90° and 180° barriers does not.

Relation to Prior Work

Two quadrotor papers motivate the gap directly.

Safe Learning of Quadrotor Dynamics Using Barrier Certificates couples a GP with barrier functions. It drives the vehicle to the safe-set edge to learn a 1.4× mass error and wind, and grows an "elastic" ellipsoidal boundary as GP variance falls. It does this in flat coordinates, which limits it to modest attitudes. We keep its exploration logic and replace both its geometry and its kernel.

Learning Model Predictive Control for Quadrotors grows a safe set from the convex hull of past laps. It handles rotation integration carefully, but the hull is taken linearly over rotation representations, so hull points need not be valid rotations. It also never explores beyond visited states. Our expansion is driven by uncertainty, and every certified point is a genuine rotation.

Three lines of work supply methods we reuse.

The Lyapunov Neural Network: Adaptive Stability Certification for Safe Learning of Dynamical Systems supplies the template of certifying a level set by checking a decrease condition on a discretization with a Lipschitz margin. That template is Euclidean. On SO(3), compactness makes the discretization exhaustive rather than truncated.

Control Barriers in Bayesian Learning of System Dynamics supplies the chance-constrained second-order cone program that serves as the online safety filter. It also supplies its fast matrix-variate GP, which was tested only on a pendulum and ground vehicles.

Geometric Reachability for Attitude Control Systems via Contraction Theory shows that chart-free certification on SO(3)×ℝ³ is computationally feasible, taking 14.73 s for 40 steps. It is offline, uses a fixed model, and is restricted to strongly convex neighborhoods. We trade its tight reachable tubes for invariant sets that are coarser but global and updated online.

Two papers constrain the design.

Certified Polyhedral Decompositions of Collision-Free Configuration Space inflates certified regions dramatically, 10,000× in 11 iterations on a 7-DOF arm. It does this through a half-angle tangent substitution that blows up at a full turn, and it takes up to 105 minutes of computation. This is why we avoid both stereographic coordinates and full sum-of-squares programs in the online loop.

Convex Geometric Motion Planning on Lie Groups via Moment Relaxation is globally exact on Lie groups but needs seconds to minutes per solve. This tells us global exactness has to live in the between-episode certification step, not in the 100 Hz filter.

Matrix Control Barrier Functions shows that matrix-inequality safety filters run at 240 Hz with 1–2 ms solves. It suggests an optional extension, which we do not depend on: a matrix-valued barrier on $R$.

Research Program

The system has three parts.

The first is an attitude GP on SO(3)×ℝ³ using the kernel above. It models the residual torque left over after the nominal rigid-body equations, such as inertia error, rotor drag, or a torque disturbance. It uses recursive updates so the per-step cost stays within the 20 ms budget reported by the quadrotor barrier paper.

The second is an online filter. Each control step solves a second-order cone program that keeps the barrier condition with margin $\beta\sigma_k$ while staying close to an exploration command. The exploration command steers toward the point on the boundary of $S_k$ where the GP is most uncertain. Distances on the boundary are measured by the true rotation angle. As a result, a target "across" the 180° point is reached the short way, and the robot never unwinds through a needless full turn.

The third is a between-episode certifier. It proposes enlarged barrier parameters, by growing level sets or adding a new center $R_c$ at a well-learned region, and accepts them only if the grid condition holds. The grid is a uniform SO(3) grid crossed with a box grid on $\omega$. The check is embarrassingly parallel, so it can run on a GPU.

Two parts of the analysis matter.

The first is a theorem stating that the accepted sets are forward invariant with probability at least $1-\delta$. This follows from GP confidence bounds, the Lipschitz cover argument, and the filter, and it does not invoke any chart.

The second is a characterization of the cost: how covering radius, Lipschitz constant, and conservatism trade off. In a 6D state the grid size grows as $\tau^{-6}$, which is the main scalability risk.

Throughout, we restrict to the attitude subsystem. This is the inner loop of a quadrotor, and it is where gimbal lock lives. Coupling with translation is left to a cascaded demonstration rather than claimed as certified.

Baselines

The naive reference is the nominal-model safe set without learning: the largest set certified using worst-case disturbance bounds. It measures how much expansion learning buys at all.

The strongest existing competitor on this question is the GP-barrier elastic expansion of Safe Learning of Quadrotor Dynamics Using Barrier Certificates. We run it in Euler-angle coordinates with ellipsoidal sets, as in that paper. It gets the same simulator, disturbance, data budget, filter solver, and a matched hyperparameter search over length-scales and $\beta$. Its only reported figure in the file is per-iteration computation "under 20ms" at a 3σ (99.7%) guarantee. We found no reported result on Lacuna for certified attitude envelope size or maximum certified tilt on a 3D quadrotor, so we must reimplement it and measure both. Beating it means a strictly larger certified fraction of attitude space at equal or fewer constraint violations and equal data. In particular, it means certifying tilts beyond 90°, which the Euler version cannot represent smoothly.

We also compare against the Euclidean safe-set growth of Learning Model Predictive Control for Quadrotors. Its reported lap time is 2.09 s in simulation after starting from 14.13 s, but that is a lap-time metric on a different task. We use it only to count how often its quaternion hull certifies states that are not rotations or that turn out to be unsafe.

The ablations isolate the key ingredient. Each keeps our full loop and replaces exactly one component. The first ablation uses a quaternion kernel in ℝ⁴ instead of the rotation-matrix kernel. The second uses a log-map tangent chart at identity, applied to both the kernel and the barrier. The third uses a re-centered tangent chart with switching. This third variant is the strongest simple alternative, discussed below.

Why not just…?

Why not just use Euler angles with a tilt limit? For gentle flight this is enough, and we expect it to tie our method within ±45°. On that regime we will report it honestly as a tie. It fails in the regime that motivates envelope expansion. A tilt limit fixes the envelope ceiling in advance, and Representation Issues in the ML Estimation of Camera Motion shows that artificial sensitivity appears well before the exact singularity. In our setting that sensitivity inflates the Lipschitz constant and shrinks what the grid check can certify. Our maximum-certified-tilt experiment directly measures where the Euler pipeline stops growing.

Why not just feed quaternions into the standard pipeline? A squared-exponential kernel on ℝ⁴ treats $q$ and $-q$ as far apart, even though they are the same attitude. Data at one does not reduce uncertainty at the other, and barrier gradients can steer toward an unnecessary full turn. The contraction-reachability paper and Reinforcement Learning with Lie Group Orientations for Robotics both document this unwinding failure. We test it by measuring the gap in GP standard deviation at antipodal quaternion pairs after identical data, and by counting how often unwinding occurs during exploration.

Why not just use a tangent chart, re-centered on the current attitude, as aerospace error-state filters do? This is the real threat. A log map at identity is smooth up to about 170°. The Lie-group RL paper found such tangent representations train faster than Euler angles, converging in about 18.8 s versus about 45.1 s. If the target envelope stays under that angle, a single chart may match us. A re-centered chart covers larger sets, but it needs a certificate that survives each chart switch. It also needs a kernel that does not reset uncertainty at chart seams. Our claim is that the rotation-matrix formulation achieves the same thing with no switching logic, and that it is needed once the set wraps around 180°. The flip-recovery experiment below decides the question. If the re-centered chart certifies equal volume at equal violations and cost, then our contribution shrinks to a simpler implementation, and we will say so.

Why not just plan globally offline with moment relaxations? Convex Geometric Motion Planning on Lie Groups via Moment Relaxation is globally certified but takes seconds to minutes per solve. It also produces trajectories under a fixed model, not invariant sets that update as the disturbance is learned. We use it as an offline sanity check on small instances, not as a competitor for the online loop.

Proposed Experiments

The first testbed is pure attitude dynamics on SO(3)×ℝ³, the same system class as the contraction-reachability paper. Its unknowns are an inertia mismatch and a state-dependent torque disturbance, and the initial seed set is a small region around hover obtained from a linear-quadratic controller.

The second testbed is a 3D Crazyflie in PyBullet. That is the same physics base as safe-control-gym, which offers only 1D and 2D quadrotors, so we add the 3D attitude task. The Hamiltonian neural ODE paper also used this platform, at about 3.5 ms per step. We reuse the 1.4× mass and 0.1g wind setting of the quadrotor barrier paper.

The primary metrics are four. The first is the certified envelope size, as a fraction of total SO(3) volume crossed with the $\omega$ box. The second is the maximum certified tilt. The third is the number of safety violations during exploration, which should be zero within $\delta$. The fourth is the iterations and data needed to reach a given envelope. Secondary metrics are filter solve time against the 10 ms budget, certifier wall-clock time, and the unwinding count.

The decisive check is a flip-recovery task. Its envelope must grow from hover to include inverted attitudes, and the disturbance is strongest near 135°. Our method should keep expanding smoothly through 90° and 180°. The Euler baseline should stall below 90°. The quaternion ablation should show the antipodal variance gap. The identity-chart variant should stall near π.

The second check is the kernel-only swap at a fixed barrier. It separates how much of the gain comes from uncertainty sharing and how much from certificate geometry.

The third check is scalability. We report how certified volume and certifier time change as the grid is refined. The method fails its own standard if a useful 6D certificate needs a grid too fine to check between episodes in minutes on one GPU.

A negative result here would itself be informative. If the re-centered-chart ablation matches on flip recovery, the field learns that chart switching, not intrinsic modeling, is the cheap fix.