Skip to content

Commit

Permalink
Fix: fetch is_grasping cpu sim
Browse files Browse the repository at this point in the history
  • Loading branch information
arth-shukla committed Jan 22, 2024
1 parent 3ea9c06 commit b79389a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mani_skill2/agents/robots/fetch/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ def is_grasping(self, object: Actor = None, min_impulse=1e-6, max_angle=85):
contacts = self.scene.get_contacts()

if object is None:
finger1_contacts = get_actor_contacts(contacts, self.finger1_link)
finger2_contacts = get_actor_contacts(contacts, self.finger2_link)
finger1_contacts = get_actor_contacts(contacts, self.finger1_link._bodies[0].entity)
finger2_contacts = get_actor_contacts(contacts, self.finger2_link._bodies[0].entity)
return (
np.linalg.norm(compute_total_impulse(finger1_contacts))
>= min_impulse
Expand All @@ -339,10 +339,10 @@ def is_grasping(self, object: Actor = None, min_impulse=1e-6, max_angle=85):
)
else:
limpulse = get_pairwise_contact_impulse(
contacts, self.finger1_link, object
contacts, self.finger1_link._bodies[0].entity, object._bodies[0].entity
)
rimpulse = get_pairwise_contact_impulse(
contacts, self.finger2_link, object
contacts, self.finger2_link._bodies[0].entity, object._bodies[0].entity
)

# direction to open the gripper
Expand Down

0 comments on commit b79389a

Please sign in to comment.