collision_manager.py
Go to the documentation of this file.
1 import coal
2 import numpy as np
3 
4 sphere = coal.Sphere(0.5)
5 sphere_obj = coal.CollisionObject(sphere)
6 
8 M_sphere.setTranslation(np.array([-0.6, 0.0, 0.0]))
9 sphere_obj.setTransform(M_sphere)
10 
11 box = coal.Box(np.array([0.5, 0.5, 0.5]))
12 box_obj = coal.CollisionObject(box)
13 
15 M_box.setTranslation(np.array([-0.6, 0.0, 0.0]))
16 box_obj.setTransform(M_box)
17 
19 collision_manager.registerObject(sphere_obj)
20 collision_manager.registerObject(box_obj)
21 
22 assert collision_manager.size() == 2
23 
24 collision_manager.setup()
25 
26 # Perform collision detection
28 collision_manager.collide(sphere_obj, callback)
29 
30 assert callback.data.result.numContacts() == 1
coal::CollisionCallBackDefault
Default collision callback to check collision between collision objects.
Definition: coal/broadphase/default_broadphase_callbacks.h:196
coal::DynamicAABBTreeCollisionManager
Definition: coal/broadphase/broadphase_dynamic_AABB_tree.h:53
coal::Box
Center at zero point, axis aligned box.
Definition: coal/shape/geometric_shapes.h:166
coal::Sphere
Center at zero point sphere.
Definition: coal/shape/geometric_shapes.h:240
coal::Transform3s::Identity
static Transform3s Identity()
Definition: coal/math/transform.h:68
coal::CollisionObject
the object for collision or distance computation, contains the geometry and the transform information
Definition: coal/collision_object.h:214


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:57