Skip to content

Convert Pose Format

SUMMARY

convert_pose_format converts a pose's rotation component between deg, rad, quat, and rotvec, leaving the position unchanged.

UNITS

The pose's position component is in meters, in both the input and the output. Rotation is in degrees ("deg"), radians ("rad"/"rotvec"), or unitless ("quat").

The Skill

python
pose_rad = tfutils.convert_pose_format([0, 0, 0, 90, 90, 180], "deg", "rad")

Parameter Configuration

ParameterTypeDefaultDescription
poselistrequiredPosition plus rotation, at least 6 elements: [x, y, z, ...].
in_rot_typestrrequiredRotation type of pose, one of "deg", "rad", "quat", "rotvec".
out_rot_typestrrequiredDesired rotation type of the returned pose.

Returns

TypeDescription
listThe pose with its rotation converted to out_rot_type, position unchanged.

Raises

ExceptionCondition
TypeErrorpose is not a list.
ValueErrorpose has fewer than 6 elements.
TypeErrorin_rot_type or out_rot_type is not a string.
ValueErrorin_rot_type or out_rot_type is not one of "deg", "rad", "quat", "rotvec".