Skip to content

Instantly share code, notes, and snippets.

@richardrl
Created May 8, 2019 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardrl/b81cc5bb9c83d5e79a8dda582f96026d to your computer and use it in GitHub Desktop.
Save richardrl/b81cc5bb9c83d5e79a8dda582f96026d to your computer and use it in GitHub Desktop.
block_gripper_contacts = list(filter(lambda contact: (contact.geom1 == right_gripperid or contact.geom1 == left_gripperid) and contact.geom2 == blockid, self.sim.data.contact))
block_gripper_distances = [contact.dist for contact in block_gripper_contacts]
if len(block_gripper_distances) > 0:
collisions += np.any(np.array(block_gripper_distances) <= 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment