Inconsistent output from btGjkPairDetector::getClosestPoints
-
- Posts: 4
- Joined: Wed Jun 12, 2019 2:20 pm
Inconsistent output from btGjkPairDetector::getClosestPoints
I've attached a project that demonstrates the issue. Essentially, I've built two hulls and depending on the order in which I pass them into a btGjkPairDetector object, I get different values for getClosestPoints, either -0.08 or 7.18. Also, if I reorder the points used to build the hulls, then the output becomes consistent (-0.08). I didn't see anything in the documentation to suggest that the hulls had to be build with a specific point ordering, so I'm curious as to why there is a difference in the output.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: Inconsistent output from btGjkPairDetector::getClosestPoints
When I run it I get:
These values seem close enough to me. The GJK algorithm is an iterative algorithm which must decide when to exit. Depending on its path through the Minkowski space it could take a longer or shorter path and end up with slightly different answers.
Code: Select all
d12 = -0.0800091
d21 = -0.0799984
-
- Posts: 4
- Joined: Wed Jun 12, 2019 2:20 pm
Re: Inconsistent output from btGjkPairDetector::getClosestPoints
You ran it exactly as is? Did you change the version of Bullet it links against. Because I just redownloaded it and ran it and still get:
7.17892885 and -0.0799984410
If I change the #if from 0 to 1, then I get:
-0.0799984410 and -0.0799877569
I don't see how you'd get different answers with the exact same code.
7.17892885 and -0.0799984410
If I change the #if from 0 to 1, then I get:
-0.0799984410 and -0.0799877569
I don't see how you'd get different answers with the exact same code.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: Inconsistent output from btGjkPairDetector::getClosestPoints
No, our build configs are not the same.
I think I'm using Bullet 2.87. I copied most of your StovePipeDlg.cpp code into another project I had already had cmake build configuration all setup. I'm building on linux with g++ 7.4.0.
I think I'm using Bullet 2.87. I copied most of your StovePipeDlg.cpp code into another project I had already had cmake build configuration all setup. I'm building on linux with g++ 7.4.0.
-
- Posts: 4
- Joined: Wed Jun 12, 2019 2:20 pm
Re: Inconsistent output from btGjkPairDetector::getClosestPoints
Ok, sweet, so maybe this has already been fixed and I just need to upgrade my version of Bullet. I'll try that and report back.
-
- Posts: 4
- Joined: Wed Jun 12, 2019 2:20 pm
Re: Inconsistent output from btGjkPairDetector::getClosestPoints
That's it! I updated to the latest 2.88 and it's working fine. My apologies, I should have thought to have done that.