flexible-collision-library / fcl

Flexible Collision Library
https://flexible-collision-library.github.io/
Other
1.41k stars 417 forks source link

Fail to enter callback function for collision checking #223

Open yswhynot opened 7 years ago

yswhynot commented 7 years ago

I've been debugging for the reason of not entering the collision checking callback function, and find that it returned at this line for checking collision between two BroadPhaseCollisionManager. May I know is it that the two collision manager should have the same root? i.e. if I'm calculating the collision between two arms then they must have the chest as the same root?

avalenzu commented 7 years ago

In the line you linked to, the "root" refers to the root of the bounding volume hierarchy (BVH) used by the broadphase manager, not the root of a kinematic chain. The root of a BVH is a bounding volume that contains all of the geometries in the hierarchy. If collisionRecurse returned at the line you indicated, that means that the roots of the two broadphase managers' BVHs do not overlap. This, in turn, means that it's impossible for any of the geometries owned by the first manager to overlap with any of the geometries owned by the second manager. Therefore, the callback function does not need to be called.