Pose to Transformation Matrix
SUMMARY
pose_to_transformation_matrix converts a 6-element (deg/rad/rotvec) or 7-element (quat) pose into a 4x4 homogeneous transformation matrix.
UNITS
The pose's position component is in meters. Rotation is in degrees ("deg"), radians ("rad"/"rotvec"), or unitless ("quat"). The returned transformation matrix's translation is in meters.
The Skill
python
from telekinesis.tf import tfutils
T = tfutils.pose_to_transformation_matrix([0, 0, 1, 0, 0, 90], rot_type="deg")Parameter Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
pose | list | np.ndarray | required | A 6-element [x, y, z, rx, ry, rz] pose ("deg"/"rad"/"rotvec"), or a 7-element [x, y, z, qw, qx, qy, qz] pose ("quat"). |
rot_type | str | "deg" | One of "deg", "rad", "quat", "rotvec". |
Returns
| Type | Description |
|---|---|
np.ndarray | The corresponding (4, 4) transformation matrix. |
Raises
| Exception | Condition |
|---|---|
ValueError | pose is not a list or np.ndarray. |
TypeError | rot_type is not a string. |
ValueError | rot_type is not one of "deg", "rad", "quat", "rotvec". |
ValueError | pose has 6 elements but rot_type="quat", or 7 elements but rot_type is not "quat". |
ValueError | pose has a size other than 6 or 7. |

