Scalar (w, x, y, z) quaternion used internally by the AHRS algorithms.
Kept separate from BB.Math.Quaternion (Nx-backed) because the AHRS
filters run at hundreds of Hz and the Nx dispatch overhead per
operation dominates the actual arithmetic. Conversion to
BB.Math.Quaternion happens at each estimator's input / output
boundary.
Ported from
gworkman/ahrs' Ahrs.Quaternion.
Summary
Functions
Returns the conjugate of a unit quaternion (also its inverse).
Constructs from a BB.Math.Quaternion.
Calculates q̇, the time-derivative of a quaternion under angular
velocity (gx, gy, gz) in rad/s. Returns a {ẇ, ẋ, ẏ, ż} 4-tuple.
Identity quaternion (no rotation).
Hamilton-product multiplication. Non-commutative; composes the right-hand rotation first, then the left.
Normalises a quaternion to a unit quaternion. Returns the input unchanged when its norm is zero.
Converts to a BB.Math.Quaternion for use in a message payload.
Types
Functions
Returns the conjugate of a unit quaternion (also its inverse).
@spec from_bb(BB.Math.Quaternion.t()) :: t()
Constructs from a BB.Math.Quaternion.
Calculates q̇, the time-derivative of a quaternion under angular
velocity (gx, gy, gz) in rad/s. Returns a {ẇ, ẋ, ẏ, ż} 4-tuple.
@spec identity() :: t()
Identity quaternion (no rotation).
Hamilton-product multiplication. Non-commutative; composes the right-hand rotation first, then the left.
Normalises a quaternion to a unit quaternion. Returns the input unchanged when its norm is zero.
@spec to_bb(t()) :: BB.Math.Quaternion.t()
Converts to a BB.Math.Quaternion for use in a message payload.