Mathematics
The rotations as unit quaternions with the stereographic chart, global and full with a declared volume so that they carry the normal, the rigid motions SE(3) and SE₂(3) as their semidirect products with the left-translated chart, and the usual maps of all three, each a composite of the core's operations.
The problem#
skoro is meant for models whose states are attitudes, poses and extended poses, a pose with a velocity, and whose measurements are of them. The only curved type it has is the sphere of the core’s tests. This entry brings back the rotations and the rigid motions and , as embedded types declared on the core’s public interface, so that each may be an estimated state or an observable, and carry the normal.
Three earlier positions shape them. A type that carries the normal has a declared volume
(the core’s measures) and a global chart
(why global charts). A type’s operations are composites of
the core’s primitives wherever they can be, and fused operations, with kernels of their own,
only where they must (charter, position 11). And a type’s chart is part of the meaning of every
normal on it, so it is chosen once, here. The archive branch held the rotations as matrices with the exponential chart, and gave their exponential, logarithm and composition fused
kernels for each backend; its rigid motions were a rotation matrix and a position. This document
works out which representation, which chart and which measure each type takes now, and the maps
between them. It assumes no frame of the earth: frames are the user’s to compose from these.
Setting#
A quaternion is with and , stored as the vector of . The product is
the conjugate , and , . The unit quaternions are a group under , with identity and inverse , and a compact Lie group of dimension , whose Haar measure is invariant under translation on either side. Each unit quaternion is a rotation,
the rotation by the angle about when , and is a homomorphism, two to one, with . Its action on a vector is .
The rotations’ tangent coordinates in this document are the rotation vector in the frame of the point, : a perturbation on the right, in the body frame.
Matrices or quaternions#
The rotations can be stored as the matrices or as the unit quaternions , and the core asks two different things of either.
A chart. For the normal, the chart at each point must be global and full. On the matrices the Cayley chart is, with log-volume (the note’s table). On the unit quaternions the stereographic chart is (Proposition 5, below). Either serves the normal exactly.
A way into the type. A model computes rotations as well as holding them: a composition, an inverse, a rotation built from a rate. The core reaches an embedded type from Euclidean values in two ways: the retraction from a base point, valid in that point’s chart, and the type’s projection , a smooth map onto the type that is the identity on it (Proposition 3). A composition of two rotations written as a retraction from one of them, , fails wherever is a half-turn, which a model meets whenever a sensor is mounted upside down. A composition needs the projection. On the unit quaternions it is the normalization , a composite smooth away from , and a composition is . On the matrices it is the polar factor , which has no closed form in the core’s primitives that is smooth at the rotations themselves: the eigenvalues of coincide there, and a formula through them divides by their differences. Nor can it pass through the quaternions:
There is no continuous map with .
Suppose is one. Its image is compact, and so is , since is continuous. They are disjoint, since gives and then , which no unit quaternion is. And they cover , since a with is or . So is the union of two disjoint nonempty closed sets, which contradicts its connectedness.
∎Every formula that reads a quaternion off a matrix is therefore discontinuous somewhere, and a projection of matrices through one is too. The matrices would need the composition, or the projection, as a fused operation, with kernels for each backend and their tests on an adapter. The unit quaternions need none: storage, chart, projection and composition are all composites.
The unit quaternions#
The type has storage , dimension , and the retraction, inverse and projection
For and , with , let
Then is a diffeomorphism of onto , whose inverse is ; is the rotation by the angle about ; and , so that is, to first order, the rotation vector of the perturbation in the frame of .
Write . Its norm is , so is a unit quaternion. With and , is the rotation by about with and , so . As runs over , runs over , so runs over every unit quaternion but , once each; is the inverse of the stereographic projection of from onto the hyperplane , at . Left multiplication by carries to . The inverse follows from and , which cancels from. Last, , and (2) at it is ; is a homomorphism.
∎The chart’s coordinate of a rotation by has the length , closer to the exponential coordinate than the Cayley chart’s . These are the modified Rodrigues parameters of attitude estimation, scaled by so that they agree with the rotation vector to first order. The chart is the left translation of the chart at the identity, , and since for a unit , and depends on only through its direction and , which preserves,
exactly, not only to first order: a perturbation in the frame of the point is the perturbation in the frame the point is expressed in. So the stereographic chart on the left, , is the same chart as this one, its coordinates rotated by , and a law given with its noise on the left is a law on the right with the covariance .
Let be the Haar measure of normalized so that the chart of Proposition 5 has volume at its centre, which is times the surface measure of . The chart at every is global and full, and its log-volume is
The chart at is the left translation of the chart at , and is invariant under left translation, so the volume is that of the chart at (Proposition 8). In polar coordinates, with the angle of a rotation and its axis, Haar measure on is for , normalized as the exponential chart, whose volume at is ((11)) and which on is a diffeomorphism of the ball of radius . With , and , so the measure is , while Lebesgue measure in is . The chart’s derivative at is , whose columns have length , so its volume at against surface measure is , and is times surface measure (Proposition 7). The chart is global by Proposition 5 and full since it misses one point.
∎The log-volume is rational in , smooth as computed everywhere, and needs no guard at . The total mass of is .
The double cover#
A normal on is a law on the unit quaternions, and through a law on the rotations.
Let be a random point of with density with respect to , and . Then has, with respect to , the density , either preimage of . If with in , then lies on the far side of , , exactly when ; and the two points over one rotation have chart coordinates at whose lengths multiply to .
The map is the translation by , which preserves , and for a measurable meeting each fibre once, such as the quaternions over with , or and a first nonzero coordinate of positive. So , and carries on to on . For the second claim, , negative exactly when . For the third, the coordinates of and at have the angles and , and .
∎So the normal on puts the mass on the far side of its mean, at most for the largest eigenvalue of : below at rad, about at rad. As a law on the rotations it has the density , in which the second term is negligible for a concentrated noise and the first is the normal’s term. For a broad one, such as a prior on an attitude about which little is known, it is the sum that is the law on the rotations, and the term on is the law on its double cover.
Three consequences follow for a model.
- Generation is unaffected. A draw is a unit quaternion near , and every value computed from it through , a rotated vector or a matrix, is the rotation’s.
- An observed quaternion must be given on the side of its prediction. A sensor’s quaternion has an arbitrary sign: and are one rotation, but two points of , and by the third claim one of them has a chart coordinate at the prediction of length at least , where the normal’s density is negligible. A measurement predicted by is aligned before it is observed, , at a value of the prediction near the estimate: the point of that is the measured rotation on the prediction’s side. Likelihoods that read the rotation only through , a measured direction for one, need no alignment.
- A posterior on has a mirror. Every term that reads its quaternion through alone takes the same value at and at ; a normal on does not, and breaks the symmetry. A model whose attitude enters through alone has a posterior with two mirrored modes, one for each sign, and an estimator converges to the one on the side it starts from, which is the same rotation.
Maps of the rotations#
A model computes with rotations as well as estimating them: it composes them, rotates vectors by them, integrates rates into them, reads angles off them, and builds them from the forms in which sensors and people give them. Each map below is a composite of the core’s primitives and selection, and its derivatives in charts are those of its parts. The primitives have no square root, absolute value or inverse sine, and divide only through logarithms, so the composites write a norm as , defined for , a reciprocal as , for , every inverse trigonometric function through , and an absolute value or a sign as a selection. Each map is of one of three kinds, and the kind says what a model may ask of its derivatives:
- smooth as written: products, sums, sines and cosines of the storage, and reciprocals and norms of quantities positive on the map’s domain, with derivatives of every order the core takes;
- smooth, with a removable singularity: smooth on its domain, but its closed form divides by an angle that vanishes at the identity; computed as the core’s smooth as computed asks, by a series below a cutoff, with derivatives of every order the core takes, at the identity too;
- a discretization and a selection: where no continuous map exists, by Proposition 3, by Proposition 20, or by the jump of a rotation vector at a half-turn, the composite selects between smooth formulas by a discretization of its input; its derivatives are those of the selected formula, and the jump has none.
The group#
| map | of | to | as | kind |
|---|---|---|---|---|
| identity | the constant | smooth | ||
| composition | , (1) | smooth | ||
| inverse | smooth | |||
| relative rotation | smooth | |||
| action | smooth | |||
| inverse action | smooth | |||
| matrix | , (2) | smooth | ||
| adjoint | smooth | |||
| hat | smooth | |||
| vee | smooth |
The composition, the inverse and the relative rotation are maps into the type, written in storage and projected ((9)); the product of two unit quaternions, and the conjugate of one, are unit quaternions already, and the projection only returns what rounding carried off the sphere. The relative rotation is the rotation that carries the frame of to that of , expressed in the frame of , so that . The inverse action is the action of , the transpose , which takes a vector given in the outer frame into the frame of ; both actions apply column by column to a matrix of vectors, and a covariance is carried by , a product of the matrix with itself. The adjoint is the matrix itself on the rotations, and its meaning is (6): it carries a perturbation in the frame of the point to the outer frame. The hat is the skew matrix with , and the vee is its inverse on skew matrices and, on any other, the vector of its skew part.
The exponential and the logarithm#
The exponential takes a rotation vector to the rotation about it by its length:
It is a diffeomorphism of the open ball of radius onto , and every is a rotation by modulo . It is how a rate becomes a rotation: an attitude turning at the constant body rate for a time moves from to , exactly. Its inverse on is the logarithm,
whose rotation vector has the length , smooth on and undefined at , the one point the exponential’s ball does not reach. The logarithm is a map of the unit quaternions, and . The rotation’s own logarithm, the rotation vector of the shorter turn,
is a map of the rotation, , with length in , and a discretization: at a half-turn, , it jumps from to , two rotation vectors of one rotation. The logarithm is what inverts the exponential, and the derivative of either is the other’s inverse; the rotation vector is what a model reports as the error of an attitude, or reads as the rate between two attitudes, .
The left and right Jacobians of the exponential are the matrices with to first order in . They are
and their inverses, for ,
Each is a polynomial in , so the inverses are checked by multiplying out with , and , since is skew. skoro does not need them to differentiate: a model’s derivatives are computed by passes, in the charts of the types, and those are the Jacobians of the textbooks.
Let be a smooth map between the types of this document and Euclidean spaces. Its derivative in charts (11), read in the charts of this document, equals its Jacobian read in exponential coordinates on the same side, . In particular the derivative of at is the right Jacobian , and that of at is . On the unit quaternions the chart and the exponential agree to second order, , so the second derivatives of a map of unit quaternions at the centres of the charts agree too; on the rigid motions they agree to first order only.
The derivative in charts of at is the Jacobian at of , with the chart at and its inverse at , and by the chain rule it depends on only through its differential at and on only through its differential at , which is the inverse of ’s at . On , from , and has the same expansion from and ; both charts are left translations of these, so they agree at every point to second order, and so do their inverses. The local representatives of in the two charts then agree to second order at , and so do their first and second derivatives there. On the rigid motions the chart is and the exponential coordinates are , by (25) below, and : they agree to first order, and differ at second order by the term . Last, is the chart coordinate at of , which is ; and is the inverse of .
∎The right Jacobian is still a map of its own, for the values a model computes with it rather than for its derivatives: the left Jacobian is the of the rigid motions’ exponential below, and a model that propagates a covariance through a rate by hand, as the preintegration of an inertial unit’s samples does, writes into its formula.
Removable singularities#
The exponential, the logarithm, the Jacobians and their inverses are smooth at the identity, and their closed forms divide by there, or by . Each is computed as the core’s smooth as computed asks of a composite: a discretization of the argument below a cutoff selects a truncated series of each coefficient, and further selections give each formula a harmless argument on the rows where the other is chosen (the closed form where the series is, and the series, if it can be undefined, where the closed form is), so that no derivative of a formula that is not selected is ever undefined. The coefficients, each a function of , or for the logarithm of and , are:
| coefficient | closed form | series | used by |
|---|---|---|---|
| (9) | |||
| (9) | |||
| (12) | |||
| (12) | |||
| (13) | |||
| , | (10) |
The series of is that of , and that of is for , expanded in . The logarithm’s series holds near the identity only, so its discretization is and , which needs no division, and the series is given on the rows where it is not chosen, since its is undefined at ; near the closed form is selected, and it is the logarithm’s cut, not a removable singularity. Its argument keeps : on the sphere , but a series in alone would have no derivative in , and the second derivatives along the sphere, which move at second order, would be wrong. The closed forms’ own arguments are and , and , positive in its logarithm for .
Each series keeps at least the terms through , so that the derivatives of second order at the identity are exact, and in practice as many as make its truncation error at the cutoff smaller than the closed form’s rounding there. Where to put each cutoff and how many terms to keep, at either precision, is settled by the implementation against measured errors on both sides of the cutoff; the archive’s exponential, with its terms through and its cutoffs at in single precision and in double, is where that starts.
Interpolation and distance#
The geodesic from to , at the parameter , is
which runs at a constant rate along the great circle of through and , reaching at by the arc that avoids , and is smooth wherever . With in place of it is the rotation’s interpolation, along the shorter of the two turns from one attitude to the other, and a discretization where the relative rotation is a half-turn and the two turns are equally short. A model interpolating an attitude between two estimates means the second; the first is the curve of the unit quaternions, and the two agree whenever .
The angle between two rotations, the length of the shorter turn from one to the other and the distance between them on the rotations, is
It is the same at and , and smooth where : at it is a norm, with no derivative, and at a maximum, where turns. Its square, , is smooth at , and is what a cost on an attitude’s error is written with.
Constructions and conversions#
Rotations reach a model as an axis and an angle, as a pair of directions, as Euler angles and as matrices, and leave it in the same forms.
Elementary rotations and axis–angle. The rotation by about the coordinate axis is , and about any axis it is , smooth in both. The way back is the logarithm split into its length and its direction, and ; the direction is undefined at the identity, where the composite selects a fixed axis, and is a discretization there. A model differentiating through an axis and an angle is better served by the rotation vector, which has no such point.
From two directions. The rotation of least angle carrying the direction of to that of is
since for unit vectors at the angle about the axis the argument is . It is smooth for except where is opposite to : there the argument vanishes, every half-turn about an axis perpendicular to is a rotation of least angle, and the map is undefined. It is how a measured direction, of gravity or of a magnetic field, is turned into an attitude that explains it.
Euler angles. A sequence of axes with is proper when and of Tait–Bryan type when the three are distinct, six sequences of each. The rotation by the angles about them, each about the axis as the previous rotations left it (intrinsic), is
smooth in the angles, and its rotation about the fixed axes in the same order (extrinsic) is , the intrinsic rotation of the reversed sequence. Roll, pitch and yaw in the usual aerospace convention are the intrinsic angles . The way back is a composite for every sequence:
Let be axes with , let be the axis other than and , and let with . Write .
Proper angles, . If with , then, with and ,
So for the angles are recovered, modulo , from any positive multiple of or of as , and , where and .
Tait–Bryan angles, . If with , then has the proper angles about , and is a positive multiple of , listed as the coordinates .
With and , and , , the product (1) gives , and its product with has
which are the stated forms by the addition formulas. For both and are positive, so and for scaled by , and the s return , and and modulo ; for they return and modulo , which change and by multiples of . For the second claim, let . Since turns about to , , and so , with . Last, is , and .
∎So the Euler angles of a unit quaternion are, for a proper sequence, those of Proposition 19 read off , and for a Tait–Bryan sequence those read off the linear rearrangement of it gives, with lowered by and multiplied by ; for an extrinsic sequence, those of the reversed sequence, in reverse order. The rotation is smooth in its angles everywhere, but the angles are not smooth in the rotation everywhere, and no choice of formula makes them so:
Fix a sequence of axes , and call a rotation at the lock when its is or for a proper sequence, for a Tait–Bryan one.
- Away from the lock, and are smooth maps of the rotation into the circle , but neither is represented by a continuous real-valued map on any set of rotations containing the loop , , for the loop in its own angle, with off the lock.
- At a rotation at the lock, neither nor has a limit, even in the circle. For a proper sequence, has one at and at ; for a Tait–Bryan sequence, has one at and at , with as in the proposition on the Euler angles of a unit quaternion.
For the first claim, let be continuous and real-valued, equal to modulo on the loop. Off the lock the angles are unique modulo by Proposition 19, so the loop’s rotation at has modulo , and is continuous with values in , hence constant. So is larger by at than at , but the loop closes there, since and . The same holds of on its loop. For the second, take a proper sequence. As , tends to for every , and for its angles are and modulo ; so the rotations near take every and every , while on all of them. At the same holds of , which tends to for every , since , a half-turn about reversing ; there . A Tait–Bryan sequence’s angles are, by Proposition 19, the proper angles of , a diffeomorphism of the rotations, and its lock is theirs.
∎The way back therefore has two kinds of singularity, and the composite treats them differently.
The wrap. Away from the lock, and are smooth as angles, points of the circle, and are returned as real numbers in , as , so that and give the same angles. By Proposition 20 a real-valued angle must be cut somewhere, and this convention cuts it where it is : crossing there, it jumps by , from to just above . The jump is in the value alone. jumps across its half-line , , but its derivatives, by (13), and all of their own, are continuous across it, so the angles’ derivatives of every order are the same on either side of the wrap: those of the angle on the circle. What a jump in value breaks is a difference of values: a finite difference straddling the wrap, and a residual. Half-turns about the coordinate axes, common test values, lie on it: a half-turn about has the angles , and rounding puts its at either end of the interval. A residual between an angle read off a model and an angle it is compared with is taken on the circle,
which moves the cut to a residual of , as far as an angle can be from the one it is compared with, and has the derivatives of everywhere else. With a reference angle, such as the previous estimate along a trajectory, is the angle in , continuous along any path that stays within a half-turn of .
The lock. At gimbal lock one of the two norms of Proposition 19 vanishes, and by Proposition 20 only or is determined there: no convention makes the angles continuous at the lock, and the composite chooses , which (18) maps back to the rotation exactly. It selects it by a discretization of the smaller squared norm against a fraction of . On the rows selected, is taken at the lock rather than computed, when vanishes and when does, and the vanishing norm and the it feeds are given a harmless argument, since a norm has no derivative at . A row is selected when , or , and there the convention’s rotation differs from by a conjugate of , or of : by the angle , or , at most . So is chosen to make that angle smaller than the rounding of either precision, and the selection changes the round trip of no rotation that rounding can tell from the lock. On the selected rows the derivatives are those of the selected formulas: none for and , and for those of or , which are the derivatives of or , the one combination that has them.
Off the lock the angles are smooth, but not uniformly. is the angle of the vector of length , and that of of length , so the first derivatives of and grow like as and as , and their second derivatives like the squares; , twice the angle between those two lengths, has bounded first derivatives that turn with the direction of approach, and second derivatives that grow in the same way. The same factor amplifies a rounding of ’s coordinates into and near the lock, while , read off the larger norm, stays accurate: that is the condition of the angles, not an error of the composite. Euler angles are therefore a way into and out of a model, and its noise is put in the charts instead.
From a matrix. By Proposition 3 no continuous map reads a quaternion off every rotation matrix, and the usual reading is a selection between four, each a linear map of the matrix projected:
with the index of the largest of the four diagonal entries . At , (2) gives , writing , so : the quaternion over whose -th coordinate is positive. Since and the largest of the is at least , the selected argument has norm at least . The composite selects the argument before it projects, so that the projection never meets one of the small arguments it did not choose. Within each choice of the map is smooth; where the choice changes, the result may change sign. A matrix that is only near a rotation gives a nearby unit quaternion, though not that of the nearest rotation. A quaternion read off a measured matrix this way is aligned with its prediction like any other.
Alignment. The alignment of with , by selection, is the point over ’s rotation on the side of , and with the one with . It is a discretization, applied on the host to an observed quaternion before it is observed, as The double cover says, or to a quaternion before it is reported.
The rigid motions#
A rigid motion is a rotation and a translation, and an extended pose a rotation, a velocity and a position. As groups, with the unit quaternions in place of the rotations, they are the semidirect products , a double cover of , and , a double cover of , with the products of Proposition 23, stored as , of storage and dimension , and , of storage and dimension .
On , with the product , let
and on , with , let
Each is the left translation by the point of the chart at the identity, is global and full, has the inverse (and likewise for ), and has, against the product Lebesgue, which is a Haar measure of the group, the log-volume of its rotation alone.
The product of and is , the chart, and likewise for the extended pose. For fixed the chart is the product of the rotation’s chart, a diffeomorphism of onto , and the affine map of onto itself, so it is global, full, and inverted as stated. Since is a rotation, Lebesgue measure is invariant under the group’s left and right translations, so it is a Haar measure and the volume of the chart is the same at every point (Proposition 8); at the identity it is the product of the rotation’s chart’s volume and .
∎The chart is not the groups’ exponential (25), which couples the translation to the rotation through the left Jacobian; the two agree to first order, by Proposition 14. Its translation coordinates are in the frame of the point: the noise of a pose’s normal moves the position along the pose’s own axes, as the noise of an odometer, an inertial unit or a scan matcher is given. Since the chart is a left translation, the normal’s law of a translated chart holds on these groups, as on the rotations.
A translation with its noise in a fixed frame is a different model, the product of with , whose chart moves the rotation and the position independently. The core has products already: is a product of spaces, global and full when its factors are, with the log-volume of its rotation alone, and needs no type of its own.
Maps of the rigid motions#
The maps of the rigid motions are their group’s, each a composite projecting its rotation, with and tangent coordinates ordered rotation first, :
| map | of | to | as | kind |
|---|---|---|---|---|
| identity | smooth | |||
| composition | smooth | |||
| inverse | smooth | |||
| relative motion | smooth | |||
| action on a point | smooth | |||
| action on a direction | smooth | |||
| inverse action | smooth | |||
| rotation, position | , | , | smooth | |
| from parts | smooth | |||
| matrix | smooth | |||
| adjoint | (24) | smooth | ||
| exponential | (25) | removable | ||
| Jacobians | (27) | removable | ||
| logarithm | (26) | removable | ||
| interpolation | (29) | removable |
From parts is a map from the product to the motion, and rotation, position the way back: they are the identity on storage, and a change of chart, whose derivative is from the product’s chart to the motion’s, since the product’s coordinates reach , whose coordinates in the motion’s chart are . The matrix is the homogeneous one, so that composition is its product and the action on a point is its product with .
The adjoint is the conjugation of the group’s Lie algebra, , and carries a perturbation in the frame of the motion to the outer frame, ; in the order it is
which many references write with the blocks the other way about, their translation first. Unlike (6) on the rotations, the relation holds to first order only, since the chart is not the exponential.
The exponential is the motion at a constant body twist , rotating at the rate while translating at the body velocity , for unit time, and the logarithm its inverse:
the logarithm defined for , with and its inverse of (12) and (13), whose series serve here too. The motions’ Jacobians, with to first order, are in the order
with , and
the coefficient of (12). This is the block of the textbooks written translation first, moved below the diagonal by the order of the coordinates here. Its coefficients are smooth with removable singularities at , with the series
computed as the rotations’ are. By Proposition 14, is the derivative of (25) that a pass computes, and like the rotations’ it is a map for the values a model computes with it. A pose moving at constant body rates for a time moves from to , exactly. With in place of , the logarithm is the motion’s along the shorter turn, a discretization at half-turns as on the rotations.
Two interpolations are in use, and both are offered:
The first is the screw motion at a constant twist, the one-parameter subgroup through carried to , and the second interpolates the rotation along its geodesic and the position along a straight line, the geodesic of the product. Each comes, like (15), with in place of for the shorter turn.
The extended poses have the same maps with the velocity carried as the position is: the composition , the inverse , the relative motion likewise, the parts and the pose among them, the matrix with the columns over , the exponential and its logarithm, the left Jacobian with the blocks on its diagonal and and below it in its first column, and in the order the adjoint
Their action on points is that of their pose. An inertial unit’s step, which turns the attitude by its rate, adds the rotated specific force and a gravity to the velocity, and the velocity to the position, is a composite of these maps that the model writes with its own gravity, since no frame of the earth is assumed.
The normal on these types#
Every chart of this document is global and full with a declared volume, so the normal applies as its mathematics defines it, its density and its sampler exact. The figures its Properties state for a chart follow from the log-volume, whose negative is , with the Hessian :
- a measurement of a rotation weighs on the state as a Gaussian of its residual would with the precision on the rotation’s block, a change of for a noise of rad;
- the mean is a mode of the density when , a standard deviation under rad;
- Gauss–Newton with the log-volume’s gradient converges at a rate within of the residuals’ own.
The expected information of the normal’s root is exact in the scale’s block and of second order in the blocks of the point and the mean, as on any curved type.
What the tests check#
- The types’ boundaries: the core’s check of an embedded type on , and , with each declared volume checked against the area formula.
- The chart: Proposition 5’s inverse on the whole image, the angle , the first-order rotation vector against (2), and (6).
- The groups: associativity, identities and inverses of the compositions, and the relative rotations and motions against them; a homomorphism, the same at and ; the actions homomorphisms, the inverse actions their inverses; the homogeneous matrices homomorphisms; hat and vee inverse on skew matrices; the adjoints against , and (24) against the first-order relation with the chart.
- The exponentials and logarithms: each logarithm the inverse of its exponential on the ball of radius , and against on either side of a half-turn; the Jacobians against Proposition 14, as the derivative of computed by a pass, on the rotations and on both motions, and their inverses by multiplication; every coefficient of Removable singularities, and and , against its closed form, in extended precision, on both sides of its cutoff, at both precisions, with first and second derivatives at the identity checked against the series’.
- The constructions: (17) carrying to ; Proposition 19 by round trips through (18) for all twelve sequences, intrinsic and extrinsic, away from the lock and the wrap, and at the lock the convention reproducing the rotation, on rows exactly at it and within the threshold of it; (22) returning from in each of its four branches; alignment and the interpolations at their endpoints and at a constant rate.
- The discretizations: each one’s value on both sides of its jump, and its derivatives those of the formula selected, finite where the core’s passes are taken; at the wrap of the Euler angles, values apart on either side and derivatives that agree across it, with the angles’ finite differences checked only at rows farther from the wrap than their step; and (21) continuous across the wrap of either angle.
- The normal: its density integrating to one through the chart of and of , its draws agreeing with quadratures, and Proposition 8’s law on the rotations, by quadrature over of .
The core’s acceptance test stays where it is, on the sphere its tests declare. That sphere is to be replaced by the library’s own spheres when an entry brings them; this entry does not revise the core.
In skoro’s terms#
- Three embedded types, declared from the core’s public interface: the unit quaternions, of storage and dimension ; the rigid motions, and ; the extended poses, and . Each declares its retraction, inverse and projection as composites, and a global volume, the log-volume of its rotation’s chart.
- Their tangent coordinates are the rotation vector in the body frame, then the translation, and for the extended pose the velocity before the position, in the body frame; every adjoint and Jacobian is written in that order.
- Their maps are composites of the core’s primitives and selection: the groups’ operations, with compositions and inverses into the types by projection; actions, matrices, adjoints and the rotations’ and the motions’ Jacobians into Euclidean values; exponentials into the types and logarithms out of them; the interpolations and the angle; and the constructions from and to axes and angles, pairs of directions, Euler angles and matrices. Each is smooth, smooth with a removable singularity computed by series, or a stated discretization.
- Their derivatives are the passes’ over those composites, and are the textbooks’ Jacobians, by Proposition 14; no derivative is written by hand.
- A quantity of these types may be scored by the normal, observed and simulated; an observed quaternion is aligned with its prediction by its caller. A pose with its noise in a fixed frame is a quantity of the product .
- No earth frame is assumed: a frame is a rotation or a motion the user composes, and a gravity a constant the user’s model holds.
Open questions#
None remain.
Revisions#
2026-11-03. Reopened after the build: the Euler angles are said to be smooth away from gimbal lock, but returning and to makes them jump by wherever either crosses , which the derivative checks found at the half-turns about the coordinate axes. This revision treats the Euler angles at all of their singularities. A new proposition, Proposition 20, shows that neither singularity can be removed: a real-valued angle must be cut somewhere, and at the lock no convention is continuous. The text now says that the wrap is a jump of the value alone, the derivatives agreeing across it; gives the residual on the circle, (21), by which a model compares angles across the wrap or keeps them continuous along a path; bounds what the lock’s threshold costs, and so how it is chosen; and says how the angles’ derivatives and their rounding grow near the lock. The tests check the wrap and the residual, and the lock within its threshold as well as exactly at it.
Built on by
- Observed quaternions of arbitrary sign on outside data: Mathematics A unit quaternion names a rotation twice, and the stereographic chart of the unit quaternions tells the two names apart, so that a measurement given with the wrong sign is misread; the rotations, the rigid motions and the extended poses become the groups themselves, stored as quaternions up to sign under the Cayley chart, which cannot tell the signs apart, and the core learns to declare a type stored up to a finite group.
- Examples that run: Mathematics The model the examples share, a trajectory of poses on SE(3) with landmarks, odometry and sightings, generated from its own joint law and queried for the rest; a Levenberg–Marquardt method on its linearization, with its damping, schedule and stopping rule; the calibration of a Laplace approximation that data drawn from the model lets an example check; and a sliding window that retires a pose and the landmarks it alone sees at every tick.
- Accuracy on the GPU: Mathematics How the absolute error of a GPU's sine and cosine reaches the closed forms of the removable singularities and their derivatives, measured on a wgpu adapter; the error the cutoffs are designed for and how a device is admitted to it; and the conditions a cutoff and its series must meet so that single precision on the GPU agrees with double precision as it does on the CPU.
- Rotations and rigid motions: Implementation A crate `skoro-spatial` declaring the unit quaternions, the rigid motions and the extended poses as embedded types with their volumes, and every map of the mathematics as a composite of the core's operations, typed by markers, reached through operators and extension traits, with host helpers for the values a model is given.