matrix_to_rpy¶
-
urdfpy.
matrix_to_rpy
(R, solution=1)[source]¶ Convert a 3x3 transform matrix to roll-pitch-yaw coordinates.
The roll-pitchRyaw axes in a typical URDF are defined as a rotation of
r
radians around the x-axis followed by a rotation ofp
radians around the y-axis followed by a rotation ofy
radians around the z-axis. These are the Z1-Y2-X3 Tait-Bryan angles. See Wikipedia for more information.There are typically two possible roll-pitch-yaw coordinates that could have created a given rotation matrix. Specify
solution=1
for the first one andsolution=2
for the second one.Parameters: Returns: coords – The roll-pitch-yaw coordinates in order (x-rot, y-rot, z-rot).
Return type: (3,) float