Pose Conversion

Using the robot’s kinematics, it is possible to convert poses from joint space to Cartesian space and back. The robot does not move during a conversion.

Note

Pose conversion is currently only available for robots of the Victor Robot Behavior Group.

Convert a Joint Pose to a Cartesian Pose

Use convert_joint_pose_to_cartesian_pose_v() to convert a JointPose to a CartesianPose. It returns the Cartesian pose and its corresponding configuration vector.

cartesian_pose, configuration_vector = (
    robot.convert_joint_pose_to_cartesian_pose_v(joint_pose)
)

The method accepts the following optional arguments:

  • tool_transformation: Pose of the tool endpoint in flange coordinates.

  • tool_transformation_offset: Offset from the tool endpoint in tool coordinates.

  • output_cs: Coordinate system of the resulting pose.

By default, the method uses no tool transformation and no offset, and returns the pose of the robot’s flange in robot coordinates.

flange_pose, configuration_vector = (
    robot.convert_joint_pose_to_cartesian_pose_v(HOME)
)

To get the tool center point (TCP) pose of the selected tool, use convert_joint_pose_to_tcp_pose_v(). See Tools for more information about tool selection.

tcp_pose, configuration_vector = (
    robot.convert_joint_pose_to_tcp_pose_v(joint_pose)
)

For a tool that is not configured on the robot, pass its tool_transformation:

tool_transformation = CartesianPose(z=0.1)
custom_tcp_pose, _ = robot.convert_joint_pose_to_cartesian_pose_v(
    HOME, tool_transformation
)

Convert a Cartesian Pose to a Joint Pose

Use convert_cartesian_pose_to_joint_pose_v() to convert a CartesianPose to a JointPose. It requires a configuration vector, which selects one of the joint poses that reach the Cartesian pose.

joint_home_pose = robot.convert_cartesian_pose_to_joint_pose_v(
    cartesian_pose, configuration_vector
)

The method accepts the same optional arguments:

  • tool_transformation: Pose of the tool endpoint in flange coordinates.

  • tool_transformation_offset: Offset from the tool endpoint in tool coordinates.

  • input_cs: Coordinate system of the Cartesian pose.

To convert a TCP pose of the selected tool to a joint pose, use convert_tcp_pose_to_joint_pose_v().

tcp_joint_home_pose = robot.convert_tcp_pose_to_joint_pose_v(
    tcp_pose, configuration_vector
)

An unreachable pose raises a RobotArmError with the reason reported by the robot control. Catch it to check a pose before moving to it:

unreachable_pose = cartesian_home_pose + CartesianPose(x=10)
try:
    robot.convert_cartesian_pose_to_joint_pose_v(
        unreachable_pose, configuration_vector
    )
except RobotArmError as error:
    _logger.info("Not converted: %s", error)

Full Example of Converting Poses

The following example shows a simple application that converts poses:

Definition of the Pose Conversion Methods

The pose conversion methods are defined in the PoseConversionVictorTrait: