archimedes.spatial.quaternion_kinematicsΒΆ
- archimedes.spatial.quaternion_kinematics( ) ndarrayΒΆ
Quaternion kinematical equations
If the rotation represents the attitude of a body B relative to a frame A, then w should be the body relative angular velocity, i.e. Ο_B.
- The derivative is computed using quaternion kinematics:
dq/dt = 0.5 * q β [0, Ο]
where β is the quaternion multiplication operator.
The method optionally support Baumgarte stabilization to preserve unit normalization. For a stabilization factor Ξ», the full time derivative is:
dq/dt = 0.5 * q β [0, Ο] - Ξ» * (||q||Β² - 1) * q
- Parameters:
q (array_like, shape (4,)) β Unit quaternion representing rotation, in the format [q0, q1, q2, q3] where q0 is the scalar part.
w (array_like, shape (3,)) β Angular velocity vector in body frame.
baumgarte (float, optional) β Baumgarte stabilization factor. If not None, Baumgarte stabilization is applied to enforce unit norm constraint. Default is None (no stabilization).
- Returns:
Time derivative of the quaternion.
- Return type:
np.ndarray, shape (4,)