|
An attitude quaternion describes the orientation of one frame relative to another. In estimation and control, however, the quantity of immediate interest is often not the attitude itself but the difference between two attitudes.
Examples include:
- the difference between a commanded spacecraft attitude and the measured attitude;
- the difference between the true attitude and a filter estimate;
- the relative orientation between two vehicles;
- the correction that must be injected into a nominal quaternion state;
- the small attitude error used in a Kalman filter or feedback controller.
Attitude error is not obtained by subtracting quaternion components. Because three dimensional orientation is a noncommutative rotation group, the exact relative attitude is formed by quaternion multiplication with an inverse.
PhysicsLibrary uses passive frame quaternions. Let
 |
(1) |
denote the current or actual attitude, mapping reference frame coordinates into actual body frame coordinates.
Let
 |
(2) |
denote the desired attitude, mapping the same reference frame coordinates into desired frame coordinates.
Two multiplicative error definitions are useful:
 |
(3) |
and
 |
(4) |
They are called the left and right errors because they reconstruct the desired attitude as
 |
(5) |
or
 |
(6) |
Both represent the same physical relative orientation, but their vector parts are resolved on different sides of the attitude transformation.
PhysicsLibrary uses Hamilton multiplication,
with reversed products changing sign.
Quaternion components are displayed scalar first:
 |
(7) |
The canonical passive coordinate map is
 |
(8) |
For a positive frame rotation through angle about unit axis
,
 |
(9) |
This negative vector sign is essential when converting an error quaternion to a physical small frame rotation vector.
A quaternion is not an ordinary vector in orientation space.
The component difference
is a four dimensional Euclidean difference between two parameter vectors. It is not itself a unit quaternion and does not directly represent the finite rotation that carries one attitude into the other.
The exact relative transformation must instead satisfy a composition equation.
For a left error,
Right multiply by :
Therefore
 |
(10) |
For a right error,
Left multiply by :
Therefore
 |
(11) |
Because
and
the conjugate of the current attitude is
Therefore the left error has the explicit frame chain
Hence
 |
(12) |
The left error is the direct passive coordinate transformation from the current actual frame into the desired frame.
It is therefore especially natural when the correction is applied on the body or output side:
The right error is
It reconstructs the desired attitude by right multiplication:
The right error is the same relative rotation transported to the reference or input side of the current attitude transformation.
The two errors are related exactly by conjugation.
Starting from
multiply on the left by and on the right by :
Thus
 |
(13) |
Equivalently,
 |
(14) |
This relation explains why left and right errors have the same scalar part and the same rotation magnitude but generally different vector components.
The following diagram summarizes the passive frame maps and the two multiplicative errors.
Figure. The actual passive attitude is and the desired passive attitude is
. The left error is the direct actual to desired frame map
and is applied on the left. The right error
is the conjugate transported version applied on the right. For a small positive frame error, the quaternion vector part has the opposite sign from the physical rotation vector.
Let
and
be the passive DCMs.
Because
and
the left error matrix is
 |
(15) |
The right error matrix is
 |
(16) |
The exact conjugation relation becomes
 |
(17) |
Thus the quaternion and DCM error definitions are completely consistent.
Choose a unit error quaternion
Under the PhysicsLibrary passive convention,
 |
(18) |
For a principal representative with
the principal error angle is
 |
(19) |
If the vector part is nonzero, the corresponding positive frame error axis is
 |
(20) |
The minus sign is the passive counterpart of the usual active axis extraction formula.
The unit quaternions
and
represent the same physical relative attitude.
For local estimation and control, it is usually convenient to choose the representative with nonnegative scalar component:
 |
(21) |
This selects a principal error angle in the interval
 |
(22) |
If an initially computed error has
replace it by
before forming a local small error vector.
At exactly ,
and the sign choice is intrinsically ambiguous. The two quaternion signs are equally valid at that point.
For a small positive frame error vector
use
and
Then the passive error quaternion becomes
 |
(23) |
In scalar first array notation,
 |
(24) |
Therefore the physical small frame error vector is recovered from the quaternion vector part by
 |
(25) |
This is one of the most important sign changes from an active quaternion error model.
Let
denote the small frame error vector associated with
, and let
denote the small frame error vector associated with
.
The exact quaternion relation is
To first order,
Therefore
The quaternion sandwich transforms pure vector coordinates according to the current passive attitude:
Hence
 |
(26) |
Equivalently,
 |
(27) |
Thus the left and right small errors represent the same geometric misalignment in different coordinate resolutions.
Suppose the current passive attitude is a positive frame yaw about
:
Suppose the desired attitude is a positive frame yaw:
Because both rotations use the same axis, they commute. The left error is
Therefore
 |
(28) |
This is the passive quaternion for a positive frame error about
.
The exact physical error is therefore
 |
(29) |
Take the current attitude as a positive frame rotation about :
 |
(30) |
Take the desired attitude as a positive frame rotation about :
 |
(31) |
The current conjugate is
The left error is
Thus
 |
(32) |
The right error is
Thus
 |
(33) |
The two errors have the same scalar part and the same vector magnitude but different vector directions.
Finite attitude error is therefore convention sensitive even when the error angle itself is unchanged.
Suppose the stored current and desired quaternions satisfy
They represent exactly the same physical attitude.
The left error is
Thus
 |
(34) |
The quaternion represents the identity orientation just as does.
For a local error representation, change the sign to the principal representative
 |
(35) |
The physical attitude error is zero, not .
For control, let
be the measured or estimated actual passive attitude and let
be the commanded passive attitude.
A body side correction can be formed with
For a small error,
Therefore a controller that requires a physical positive frame correction vector should use
 |
(36) |
away from the sign ambiguity.
The sign factor selects the locally shortest quaternion representative.
A control law should not use the raw quaternion vector part without first accounting for the active or passive convention.
Let the true passive attitude be
and a nominal estimate be
A left multiplicative error is defined by
 |
(37) |
Therefore
 |
(38) |
A right multiplicative error is defined by
 |
(39) |
so
 |
(40) |
For a passive small error state,
 |
(41) |
The filter covariance, Jacobians, reset equation, and correction injection must all use the same left or right definition.
Suppose an estimator has computed a correction quaternion
.
For a left error model, update the nominal attitude by
 |
(42) |
For a right error model,
 |
(43) |
Mixing a right error covariance model with a left injection, or vice versa, changes the coordinate interpretation of the correction and is generally inconsistent.
The same algebra applies when neither attitude is merely a desired command.
Let two physical frames and have passive attitudes
and
The direct coordinate map from into is
 |
(44) |
This is exactly the same form as the left error quaternion.
Therefore relative attitude and attitude error are mathematically the same operation. The difference is the engineering interpretation assigned to the two endpoint frames.
Suppose the actual and desired attitudes are displayed as yaw, pitch, and roll triples.
The component difference
is generally not the exact finite attitude error vector.
Euler Angles are nonlinear coordinates associated with an ordered sequence of rotations. Finite rotations do not commute, so subtracting the three coordinates does not reproduce the group product
or
For sufficiently small errors and away from an Euler singularity, angle differences may provide a local approximation. The exact error should nevertheless be formed first with quaternions or DCMs.
For a principal passive error quaternion,
Therefore
corresponds to
Near this angle, the two equivalent representatives and have nearly equal scalar magnitude and opposite vector parts.
Consequently a rule that always forces a positive scalar component can switch sign under very small perturbations near .
The physical orientation remains continuous. The discontinuity belongs to the chosen quaternion representative.
This issue is especially important in controllers, optimizers, and time histories that assume quaternion component continuity.
If only the magnitude of the principal attitude error is needed, choose the quaternion sign so that
Then
 |
(45) |
An equivalent numerically robust form is
 |
(46) |
The second form behaves well for both small and large angles.
The first order passive error quaternion is
Its squared Euclidean norm is
Thus
 |
(47) |
The unit norm error introduced by the first order small error approximation is second order in the attitude error magnitude.
A relative attitude implementation should pass the following checks.
- Identity.
If
then both errors must equal up to quaternion sign.
- Opposite stored sign.
If
the physical error must still be zero.
- Same axis rotations.
For current yaw and desired yaw , the passive error must represent a positive frame yaw and therefore have a negative vector component.
- Left and right reconstruction.
Verify
and
- Conjugation relation.
Verify
- DCM consistency.
Verify
and
- Small error sign.
For a small positive frame rotation vector
, verify
- Subtracting quaternion components.
The exact relative attitude is multiplicative, not additive.
- Using the old active small error sign.
For the PhysicsLibrary passive frame quaternion,
- Calling an error simply “the quaternion difference.”
The order must be stated. and are generally different.
- Mixing left error propagation with right error injection.
The filter or controller must keep the chosen side consistent.
- Ignoring the
versus equivalence.
An error quaternion near can represent almost zero physical error.
- Forcing sign continuity and principal angle simultaneously without a policy.
Near , the principal sign choice can switch discontinuously.
- Interpreting the raw passive vector part as a positive physical correction vector.
The small physical frame error is approximately
.
- Subtracting Euler angle triples for a large finite error.
Euler coordinates are sequence dependent nonlinear coordinates, not a global rotation vector.
- Assuming left and right error vectors have the same coordinates.
They represent the same geometric error but are transported through the current attitude.
The preceding article, quaternion kinematics and angular velocity, derives the passive quaternion differential equations used to propagate the nominal attitude.
The present article defines exact relative attitude and multiplicative error quaternions and establishes the passive small error sign used in estimation and control.
A separate companion entry, Relative Attitude and Error Quaternions: Examples, Exercises, and Solutions, provides the Q12E self study problem bank.
The next main article, numerical quaternion propagation and IMU attitude state integration, combines quaternion kinematics, sampled gyro increments, bias correction, and small error concepts in a discrete navigation implementation.
Relative attitude and multiplicative quaternion errors are standard tools in spacecraft attitude estimation, inertial navigation, robotics, and nonlinear state estimation. Their exact signs and multiplication sides depend on the chosen quaternion frame map.
Sommer and coauthors provide a modern discussion of quaternion convention management and passive frame transformations. Markley and Crassidis provide a broad spacecraft attitude treatment including quaternion errors and estimation. Shuster discusses historical spacecraft quaternion conventions. Solà provides a detailed engineering discussion of quaternion perturbations and error state Kalman filtering; its formulas should be translated carefully when the quaternion map differs from the PhysicsLibrary passive convention.
- 1
- H. Sommer, I. Gilitschenski, M. Bloesch, S. Weiss, R. Siegwart, and J. Nieto, “Why and How to Avoid the Flipped Quaternion Multiplication,” Aerospace, vol. 5, no. 3, article 72, 2018. Published under CC BY 4.0. Publisher article https://www.mdpi.com/2226-4310/5/3/72
- 2
- F. L. Markley and J. L. Crassidis, Fundamentals of Spacecraft Attitude Determination and Control, Springer, 2014. Engineering reference. Publisher book page https://link.springer.com/book/10.1007/978-1-4939-0802-8
- 3
- M. D. Shuster, “The Nature of the Quaternion,” The Journal of the Astronautical Sciences, vol. 56, no. 3, pp. 359–373, 2008. Reference source. DOI record https://doi.org/10.1007/BF03256558
- 4
- J. Solà, “Quaternion Kinematics for the Error State Kalman Filter,” technical report, 2017. arXiv preprint https://arxiv.org/abs/1711.02508
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution ShareAlike 4.0 International license.
|