utils

Utility methods for working with object poses and keypoints.

trifinger_rl_datasets.utils.get_keypoints_from_pose(pose, num_keypoints=8, dimensions=(0.065, 0.065, 0.065))[source]

Calculate keypoints (coordinates of the corners of the cube) from pose.

Parameters:
  • pose – Object pose containing position and orientation of cube.

  • num_keypoints – Number of keypoints to generate.

  • dimensions – Dimensions of the cube.

Returns:

Array containing the keypoints.

trifinger_rl_datasets.utils.get_pose_from_keypoints(keypoints, dimensions=(0.065, 0.065, 0.065))[source]

Calculate pose (position, orientation) from keypoints.

Parameters:
  • keypoints – At least three keypoints representing the pose.

  • dimensions – Dimensions of the cube.

Returns:

Tuple containing the coordinates of the cube center and a quaternion representing the orientation.

trifinger_rl_datasets.utils.to_world_space(x_local, pose)[source]

Transform point from local object coordinate system to world space.

Parameters:
  • x_local – Coordinates of point in local frame.

  • pose – Object pose containing position and orientation.

Returns:

The coordinates in world space.