newton.core.quat_to_rpy#

newton.core.quat_to_rpy(q)[source]#

Convert a quaternion into Euler angles (roll, pitch, yaw).

The returned angles represent a sequence of extrinsic rotations following the Z-Y-X convention (Tait-Bryan angles).

  • yaw: Rotation about the z-axis.

  • pitch: Rotation about the y-axis.

  • roll: Rotation about the x-axis.

All angles are in radians and are applied counter-clockwise. Note that Warp’s quaternion components are stored in (x, y, z, w) order.

Parameters:

q (wp.quat) – The input quaternion to convert.

Returns:

The Euler angles (roll, pitch, yaw) in radians.

Return type:

wp.vec3