Reputation: 23
The library which drake used to collision detected is different from the FCL(https://github.com/flexible-collision-library/fcl)? Is Drake collision detection based on FCL? Or where can I find the difference?
Can I use FCL to get the contact force between sphere and box? Or can Drake achieve it?
Thanks very much!
Upvotes: 2
Views: 514
Reputation: 136
Thanks for asking.
In general, the collision detection is based partly on FCL broadphase+narrowphase and partly on Drake custom code.
The contact force also depends on the contact mode: point contact, hydroelastics, hydroelastics with fallback. See set_contact_model() and Hydroelastic Contact User Guide.
Recently we added an example that includes sphere-and-box contact at https://github.com/RobotLocomotion/drake/tree/master/examples/hydroelastic/ball_plate
By default, it uses hydroelastic contact. You can use the option --contact_model=point
to use point contact. In that case, I believe it will use FCL to calculate penetration between the sphere and the box. By default, the example uses hydroelastic contact, which doesn't use FCL for narrowphase collision detection but still use FCL for broadphase detection as Russ said.
I'm not sure that I answer your questions. If you could be specific to which function in this list of query functions (ComputePointPairPenetration, ComputeSignedDistancePairwiseClosestPoints, HasCollisions, etc.) or you could provide a small example, I can give more details what's happening under the hood.
Upvotes: 7
Reputation: 5533
Drake provides compete support for collision detection / contact-force computation. It currently does use FCL for one piece of that computation (broad-phase detection).
Upvotes: 2