22 May 2020 at 20 h 14 min #16338
I wrote an algorithm for continuous collision detection. I would like it to work with constraints for the collision response. I’m having some difficulties understanding how to get this to work in Sofa.
I calculate the time and coordinate of contact between the two collision elements, but whatever I pass to the detectionOutputVector, the result is a little bit off. The distance between the elements after the constraint correction are always different and the objects end up penetrating into each other.
Is there any implementation of a continuous collision detection algorithm available somewhere, like in a 3rd party plugin, or any other resource that would be helpful to understand how to use continuous collisions in Sofa?
François Léonard31 May 2020 at 18 h 59 min #16467
Sorry for letting you down for so long.
I am currently working on a documentation of this part in SOFA. It should help the understanding of this dark part in SOFA!
Which AnimationLoop are you using?
Yes there was a third party (private) plugins on continuous collision detection with implicit surfaces (I am unfortunately not knowledgeable about it). This work arose from the collaboration between two research teams. I could see to share this code if you’d like. To do so, we could Skype anytime in order to get some info/updates on your side.
Hugo23 June 2020 at 0 h 29 min #16692
Sorry for the late reply. It looks like I don’t receive emails anymore when my messages are answered.
I made some progress in the last few weeks. I understood some things about how the freeAnimationLoop and the free positions work. I’m using the freeAnimationLoop with the LCPConstraintSolver. However, I don’t fully understand the math behind the constraint correction and how Delta v^cor is calculated. I’m also not sure what exactly the contacts’ values sent to the contact manager need to be and what the contactDistance does with collision responses using constraints.
My continuous detection almost works, but the times of intersection I calculate seems a little off. Sometimes the intersection falls just before or after the step, letting the objects penetrate even though the point and triangle visibly pass through each other. I wonder if it’s the numerical errors that propagate in the calculations, making the time of intersection a little off. In other cases, I detect an intersection and create a contact, but the constraint correction let the point and triangle penetrate anyway.
I would love to see this continuous collision plugin. Maybe it could help me figure out what I’m doing wrong. I’m available to Skype anytime.
François23 June 2020 at 22 h 50 min #16698
For the FreeAnimationLoop and the Lagrange multipliers approach did you pay attention to the doc page?
Defining the numerical setting for collision detection is complex. You need to use a time step small enough to make sure that your objects won’t go through one another in between one time step. For this, the time step, the alarm and contact distance are key.
Let me know if above information are helping already.
Hugo24 June 2020 at 21 h 48 min #16716
I saw that that the documentation improved a lot over the last few months. Thanks for all the work on this!
So far I made a discrete collision detection algorithm based on spatial subdivision that works well with the correct numerical settings (time step, alarm and contact distance). Now, I’m trying to adapt it to handle continuous collision detection. The idea is to compute the exact time of collision during the step (using linear interpolation of the vertices positions) and then to correct the positions so that the objects don’t go through one another. I’m using the free positions as the end-of-step positions for the linear interpolation. For the collision response, I’m trying to use constraints to correct the positions. It’s mostly this last part that is not clear to me.
François7 July 2020 at 22 h 59 min #16819
What’s new with your continuous detection algorithm?
Regarding the last collision step, the response, it’s a part I do not perfectly master neither. But take a look at the FrictionContact class which implements the
createResponse()function called in the doCollisionResponse stage.
- You must be logged in to reply to this topic.