4 sphere = fcl.Sphere(0.5)
5 sphere_obj = fcl.CollisionObject(sphere)
7 M_sphere = fcl.Transform3f.Identity()
8 M_sphere.setTranslation(np.array([-0.6, 0.0, 0.0]))
9 sphere_obj.setTransform(M_sphere)
11 box = fcl.Box(np.array([0.5, 0.5, 0.5]))
12 box_obj = fcl.CollisionObject(box)
14 M_box = fcl.Transform3f.Identity()
15 M_box.setTranslation(np.array([-0.6, 0.0, 0.0]))
16 box_obj.setTransform(M_box)
18 collision_manager = fcl.DynamicAABBTreeCollisionManager()
19 collision_manager.registerObject(sphere_obj)
20 collision_manager.registerObject(box_obj)
22 assert collision_manager.size() == 2
24 collision_manager.setup()
27 callback = fcl.CollisionCallBackDefault()
28 collision_manager.collide(sphere_obj, callback)
30 assert callback.data.result.numContacts() == 1