Created
May 8, 2019 06:46
-
-
Save richardrl/b81cc5bb9c83d5e79a8dda582f96026d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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