MattiaMontanari / openGJK

Fast and reliable implementation of the Gilbert-Johnson-Keerthi (GJK) algorithm for C, C#, Go, Matlab and Python
https://www.mattiamontanari.com/opengjk/
GNU General Public License v3.0
135 stars 37 forks source link

contact information #15

Closed nyers33 closed 3 years ago

nyers33 commented 3 years ago

First off, thanks for your work and sharing the code!

I wonder how big is the task of getting openGJK retrieve contact information (colliders penetrating into each other), to make it behave like an EPA algorithm. I saw your nice video about PyBullet + openGJK speed-up, by any chance, do you have a link for that coveted branch you mention there? :)

Thank you!

MattiaMontanari commented 3 years ago

I never implemented EPA but I feel most of the functions are here already. I'd start off by following what's done in this book. OpenGJK is fast because it's sub-algorithm is fast. The sub-algorithm is fast because it doesn't look in the portion of space where there origin cannot be. GJK it's a descending algorithm and so this can be done without ambiguity. I'm not sure if this is the case for EPA, if not then it will be more involved. Again, have a look at the book first :-). pyBullet has EPA too.

I never managed to merge this into pyBullet. I exchanged few emails with Erwin, possibly even gave him the code, but then ran out of time to create the MR. Once you figure out what is the version of GJK you want to replace in pyBullet, it's very simple because C and C++ talk to each other.

nyers33 commented 3 years ago

Thanks for the recommended book and for the advice, I will delve into it.