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
| Parameter | Type | Default | Description |
|---|---|---|---|
transformation_matrix | np.ndarray | required | The (4, 4) transformation matrix to convert. |
rot_type | str | "quat" | One of "deg", "rad", "quat", "rotvec". |
Returns
| Type | Description |
|---|---|
list | The corresponding pose: 6 elements ("deg"/"rad"/"rotvec") or 7 elements ("quat"). |
Raises
| Exception | Condition |
|---|---|
ValueError | transformation_matrix is not a (4, 4) np.ndarray. |
TypeError | rot_type is not a string. |
ValueError | rot_type is not one of "deg", "rad", "quat", "rotvec". |