Skip to content

Commit

Permalink
Check arm collision.
Browse files Browse the repository at this point in the history
  • Loading branch information
stepjam committed Mar 18, 2021
1 parent ff9ba7e commit d6d60b7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pyrep/robots/arms/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,14 @@ def get_jacobian(self):
jacobian, (rows, cols) = sim.simGetIkGroupMatrix(self._ik_group, 0)
jacobian = np.array(jacobian).reshape((rows, cols), order='F')
return jacobian

def check_arm_collision(self, obj: 'Object' = None) -> bool:
"""Checks whether two entities are colliding.
:param obj: The other collidable object to check collision against,
or None to check against all collidable objects. Note that objects
must be marked as collidable!
:return: If the object is colliding.
"""
handle = sim.sim_handle_all if obj is None else obj.get_handle()
return sim.simCheckCollision(self._collision_collection, handle) == 1

0 comments on commit d6d60b7

Please sign in to comment.