-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
GJK raytest fails, revert to old 'subsimplex' convex cast and fix it #34
Comments
By the way, you can revert to the old behavior using the following setting: |
…CastRaytest the default for btCollisionWorld::rayTest See #34 Add btCollisionObject::setIgnoreCollisionCheck to disable collisions between specific instances, without having a btTypedConstraint. See #165 Make btMultiBody and btMultiBodyJointMotor backwards compatible with Bullet 2.82 API (single-DOF API)
…CastRaytest the default for btCollisionWorld::rayTest See bulletphysics#34 Add btCollisionObject::setIgnoreCollisionCheck to disable collisions between specific instances, without having a btTypedConstraint. See bulletphysics#165 Make btMultiBody and btMultiBodyJointMotor backwards compatible with Bullet 2.82 API (single-DOF API)
Hi, @erwincoumans! We are enthusiastic Bullet users for collisions in Drake. I'm working with @amcastro-tri (Alejandro Castro) who finally solved a long-standing problem for us that we think is due to the bug discussed in this issue. The fix was small, but the pain was large because it took several people and 3 months (off and on) to identify the problem (of course we thought it was our bug). Alejandro will follow up with more info. Best regards, Sherm |
Erwin, this is the issue in Drake that @sherm1 is referring to. Essentially we are using ray casting for a simple lidar model. The test in that issue is simply a 2D lidar placed in front of a box. Some strange returns were observed when they ray was hitting the box close to being perpendicular to it (the zero angle in the plots). We have the following questions:
I am working on a very simple demo in my Bullet's fork with just this test (ray vs. one box) in case you are interested in seeing it. I'll post the link soon. |
@erwincoumans: in my fork of Bullet I added another example to the Example Browser. Is in If you run it you'll see just a The example prints to screen the hit point computed with both
The correct solution would have |
Thanks a lot for reaching out and thanks for tracking down the issue and creating a repro case. Yes, the subsimplex convex cast is more sensitive to various issues, and it is better to disable it by default.
Yes, they can be extended to concave shapes, by using an acceleration structure, and doing a pairwise test for all potential candidates and taking the minimum. So although the elementary test only applies on convex shapes, the children in a concave shape are convex (convex triangles in a concave triangle mesh, or convex child shapes in a compound shape).
The subsimplex convex cast has theoretically a better performance, by merging two iteration loops into a single loop. See also http://bulletphysics.com/ftp/pub/test/files/physics/papers/jgt04raycast.pdf for details on these algorithms.
In addition, we should create some unit test using gtest, see Bullet/tests/... , those unit tests are executed as part of each pull request etc. |
Thank you for your answer @erwincoumans! Good to know we are using the correct algorithm now.
|
1+3) Yes, I'll expose the tolerance for the next release. Sub-simplex cast should be faster that gjk+conservative advancement. Note that there are some improvements that we could make, both for sub-simplex ray cast and convex cast. Erin Catto describes this in one of his GDC 2013 Physics Tutorial presentation 'Continuous Collision', see http://box2d.org/downloads
|
It has been a while. We use BT_USE_DOUBLE_PRECISION by default now, in PyBullet, Bullet for Robotics. |
Thanks for the Xmas present, Erwin! I hope you enjoy some time off. Best regards, Sherm |
This is great news, thank @erwincoumans. And happy holidays! |
Bullet 2.x btCollisionWorld::rayTest is using the gjk convex caster, instead of subsimplex convex caster. There is some issues we need to fix.
See also http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=9723&p=32797#p32797
The text was updated successfully, but these errors were encountered: