Skip to content

Commit

Permalink
Merge pull request NVlabs#332 from tahsinkose/tahsin/fix-get-link-tra…
Browse files Browse the repository at this point in the history
…nsform

Fix get_link_transform API method
  • Loading branch information
balakumar-s authored Jul 12, 2024
2 parents 0c122a3 + ba4e57e commit 2ae381f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/curobo/cuda_robot_model/cuda_robot_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def get_link_mesh(self, link_name: str) -> Mesh:
return mesh

def get_link_transform(self, link_name: str) -> Pose:
mat = self._kinematics_config.fixed_transforms[self._name_to_idx_map[link_name]]
mat = self.kinematics_config.fixed_transforms[self.kinematics_config.link_name_to_idx_map[link_name]]
pose = Pose(position=mat[:3, 3], rotation=mat[:3, :3])
return pose

Expand Down
6 changes: 6 additions & 0 deletions tests/curobo_robot_world_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,9 @@ def test_cu_robot_batch_world_collision():
)
assert d_world.shape[0] == b
assert torch.sum(d_world) == 0.0

def test_cu_robot_get_link_transform():
model = load_robot_world()
world_T_panda_hand = model.kinematics.get_link_transform("panda_hand")
# It seems the panda hand is initialized at the origin.
assert torch.sum(world_T_panda_hand.position) == 0.0

0 comments on commit 2ae381f

Please sign in to comment.