-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validateNearestFeatureOfPolytopeBeingEdge(): The origin is outside of the polytope #390
Comments
I confirm that in @wxmerkt example, __ccdGJK gives the wrong polytope to EPA. __ccdGJK generates a tetrahedron, and it thinks that the origin is in this tetrahedron (indicating the two boxes are colliding). But here are the four vertices of this tetrahedron I will look into the doSimplex code to find out the cause of the bug. |
That seems exactly a squared-distance tolerance masquerading as a distance tolerance. |
I think I find the problem, and it is in libccd. When computing the distance from a point to a triangle, libccd has this code
The summation in the expanded expression causes trouble, when the squared distance is close to epsilon. Due to summation of double numbers (some of these numbers like |PA|² could be big), that epsilon could be discarded, and libccd computes |PQ|² = 0. Hence libccd reports that the point I think the solution is to compute |PQ|² without the expansion. Namely we first compute the vector
store the result to a 3 x 1 vector, and then compute the squared norm of this vector as the squared distance. |
It would be so nice to get this fixed in libccd rather than have to patch around it in FCL :( |
I filed the issue danfis/libccd#55 to libccd. But I think there is a workaround in FCL without changing the libccd code. I will include it in my PR #388 |
@wxmerkt I just pushed a commit to #388 to fix this error. When you got time, is it OK if you could pull in #388, and run your test locally? Thanks a lot! There are many pieces of code in FCL/libccd that we didn't fix, so the code is still buggy. We very much appreciate your effort to test FCL for your use case. This helps us to find out the bugs in FCL/libccd. |
Thank you Hongkai. I have now updated my local copy and will re-run the tests - it may be a day before we see the bug appearing though. Meanwhile, before applying the fix I caught another case:
|
@wxmerkt , I added the failure reported in #390 (comment) to the commit in #388. I think #388 should fix that failure as well. |
@hongkai-dai I have now been running your fix for 35h+ and there were 0 exceptions thrown (before applying your patch I got about ~8 in 10 minutes). |
@wxmerkt thanks a lot for the test! We will merge that PR soon once we resolved some cmake issue with libccd. |
Resolved by #388 |
This issue has been transferred other from #388 (comment).
After applying #388, I ran into the following exception (newly introduced in #388):
Further comments:
The text was updated successfully, but these errors were encountered: