KieranWynn / pyquaternion

A fully featured, pythonic library for representing and using quaternions
http://kieranwynn.github.io/pyquaternion/
MIT License
339 stars 68 forks source link

Misleading docstring for yaw_pitch_roll #72

Open dex-julian opened 2 years ago

dex-julian commented 2 years ago

The docstring for yaw_pitch_rolls states as follows: """Get the equivalent yaw-pitch-roll angles aka. intrinsic Tait-Bryan angles following the z-y'-x'' convention

    Returns:
        yaw:    rotation angle around the z-axis in radians, in the range `[-pi, pi]`
        pitch:  rotation angle around the y'-axis in radians, in the range `[-pi/2, -pi/2]`
        roll:   rotation angle around the x''-axis in radians, in the range `[-pi, pi]`

    The resulting rotation_matrix would be R = R_x(roll) R_y(pitch) R_z(yaw)

""" From the resulting rotation matrix formula we could see this post-multiplication implies this is extrinsic angles. I examined the results with https://github.com/ros/geometry/blob/hydro-devel/tf/src/tf/transformations.py#L1100 as well, and indeed the yaw_pitch_roll is giving values as 'szyx', which is static frame rotation, not intrinsic Tait-Bryan angles. This function should return the same result as "rzyx".