warp.quat_to_rpy#

warp.quat_to_rpy(q: quatf) → vec3f[source]#
  • Kernel: true
  • Python: true
  • Differentiable: true

Return the roll, pitch, and yaw angles in radians of the rotation q.

This is the inverse of quat_rpy(), which applies roll, pitch, and yaw in that order about the fixed x, y, and z axes (extrinsic x-y-z).

Near gimbal lock, where pitch approaches pi/2 or -pi/2, the returned roll and yaw are inaccurate and might not reproduce q. quat_to_euler(q, 0, 1, 2) uses the same convention and handles gimbal lock.

Parameters:

q – Rotation quaternion, with unit length.

Returns:

(roll, pitch, yaw) in radians, with roll and yaw in [-pi, pi] and pitch in [-pi/2, pi/2].

Return type:

warp.vec3