Overview
RigidBodyKinematics (RBK) is a pure-Python library with over 200 functions for converting between attitude representations and composing rotations. All angle arguments and return values are in radians.
Module-level constants
| Constant | Value |
|---|---|
D2R | π / 180 |
R2D | 180 / π |
M_PI | π |
Utility
Wraps angle
x into (-π, π].Direction cosine matrix (DCM) → other representations
Converts a 3×3 DCM to a 4×1 Euler parameter (quaternion) vector
[β₀, β₁, β₂, β₃] with β₀ >= 0. Uses the Stanley method.Converts a 3×3 DCM to a 3×1 Modified Rodrigues Parameter (MRP) vector with
|σ| <= 1.Converts a 3×3 DCM to a 3×1 Gibbs (classical Rodrigues) vector.
Converts a 3×3 DCM to a 3×1 principal rotation vector (PRV). The magnitude of the returned vector is the principal rotation angle
φ ∈ [0, π].Euler angle sets from DCM
All functions follow the patternC2Euler<seq>(C) -> ndarray(3,) and return the three Euler angles in radians. Available sequences:
| Function | Sequence |
|---|---|
C2Euler121(C) | 1-2-1 |
C2Euler123(C) | 1-2-3 |
C2Euler131(C) | 1-3-1 |
C2Euler132(C) | 1-3-2 |
C2Euler212(C) | 2-1-2 |
C2Euler213(C) | 2-1-3 |
C2Euler231(C) | 2-3-1 |
C2Euler232(C) | 2-3-2 |
C2Euler312(C) | 3-1-2 |
C2Euler313(C) | 3-1-3 |
C2Euler321(C) | 3-2-1 |
C2Euler323(C) | 3-2-3 |
Rotation composition
Composes two Euler parameter (quaternion) rotations. Returns the quaternion for the combined rotation B1 followed by B2.
Common usage patterns
Convert MRP to DCM
Several inverse functions are available (e.g.,MRP2C, EP2C, PRV2C) following the naming convention <repr>2C.