archimedes.spatial.euler_kinematicsΒΆ
- archimedes.spatial.euler_kinematics(rpy: ndarray, inverse: bool = False) ndarray ΒΆ
Euler kinematical equations
Defining π½ = [phi, theta, psi] == Euler angles for roll, pitch, yaw attitude representation, this function returns a matrix H(π½) such that
dπ½/dt = H(π½) * Ο.
- If inverse=True, it returns a matrix H(π½)^-1 such that
Ο = H(π½)^-1 * dπ½/dt.
- Parameters:
rpy (array_like, shape (3,)) β Roll, pitch, yaw angles in radians.
inverse (bool, optional) β If True, returns the inverse matrix H(π½)^-1. Default is False.
- Returns:
The transformation matrix H(π½) or its inverse.
- Return type:
np.ndarray, shape (3, 3)
Notes
Typical rigid body dynamics calculations provide the body-frame angular velocity Ο_B, but this is _not_ the time derivative of the Euler angles. Instead, one can define a matrix H(π½) such that dπ½/dt = H(π½) * Ο_B.
This matrix H(π½) has a singularity at ΞΈ = Β±Ο/2 (gimbal lock).
Note that the
RigidBody
class by default uses quaternions (via theRotation
class) for attitude representation. In general this is preferred due to the gimbal lock singularity, but special cases like stability analysis may use Euler angle kinematics.