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 the Rotation 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.