flexible-collision-library / fcl

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

Penetration depth of collision between mesh and mesh #574

Open Jiangzongbei opened 2 years ago

Jiangzongbei commented 2 years ago

Hello, everyone. When mesh collides with mesh, does the penetration depth only return 0 when contacting, but not the specific value.Is there any way to return specific values?

jmirabel commented 2 years ago

The answer to your question is no. There reason is in https://github.com/flexible-collision-library/fcl/issues/491.

Jiangzongbei commented 2 years ago

Thank you for your reply. @jmirabel So what if the mesh is convex? Apart from the minimum distance, is there no function of penetration depth in FCL when two meshes have a certain penetration. Thank you again for your answer!

jmirabel commented 2 years ago

If the mesh is convex, you have to create a Convex object, and not a BVHModel. In that case, you will get a penetration depth. Mind that penetration is harder to compute and EPA algo (for computing penetration) is not as robust as GJK algo (for computing distance).

If you only need small penetration, you will get a more robust behavior by using security margin and/or inflated convex shapes in hpp-fcl, which is a fork of this repo.