Skip to content

Transformation Matrix to Pose

SUMMARY

transformation_matrix_to_pose converts a 4x4 homogeneous transformation matrix into a pose in the requested rot_type (deg, rad, quat, or rotvec).

UNITS

The input transformation matrix's translation is in meters. The returned pose's position component is in meters; rotation is in degrees ("deg"), radians ("rad"/"rotvec"), or unitless ("quat").

The Skill

python
pose = tfutils.transformation_matrix_to_pose(T, rot_type="quat")

Parameter Configuration

ParameterTypeDefaultDescription
transformation_matrixnp.ndarrayrequiredThe (4, 4) transformation matrix to convert.
rot_typestr"quat"One of "deg", "rad", "quat", "rotvec".

Returns

TypeDescription
listThe corresponding pose: 6 elements ("deg"/"rad"/"rotvec") or 7 elements ("quat").

Raises

ExceptionCondition
ValueErrortransformation_matrix is not a (4, 4) np.ndarray.
TypeErrorrot_type is not a string.
ValueErrorrot_type is not one of "deg", "rad", "quat", "rotvec".