Skip to content

Commit

Permalink
Gripper now checks if object is not already grasped.
Browse files Browse the repository at this point in the history
  • Loading branch information
stepjam committed Jul 1, 2019
1 parent 4e9bfe1 commit 5aafad2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyrep/robots/end_effectors/gripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def grasp(self, obj: Object) -> bool:
:return: True if the object was detected/grasped.
"""
detected = self._proximity_sensor.is_detected(obj)
if detected:
# Check if detected and that we are not already grasping it.
if detected and obj not in self._grasped_objects:
self._grasped_objects.append(obj)
self._old_parents.append(obj.get_parent())
obj.set_parent(self._attach_point, keep_in_place=True)
Expand Down

0 comments on commit 5aafad2

Please sign in to comment.