Disable collisions between attached bodies #640
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🦟 Bug fix
Fixes #
Summary
Even with #632 , it looks like objects that are attached to each other continue to generate contacts. Even though we've explicitly marked the two objects not to collide, looking at the bullet code (https://github.com/bulletphysics/bullet3/blob/e9c461b0ace140d5c73972760781d94b7b5eee53/src/BulletDynamics/Featherstone/btMultiBodyLinkCollider.h#L79-L80), that is ignored because
checkCollideWithOverride
will always return true if the two objects are not in the same btMultiBody.@iche033 I haven't checked this thoroughly, but the solution I came up with is to call the base class's
checkCollideWithOverride
as well asbtMultiBodyLinkCollider::checkCollideWithOverride
and return the result of anding the two. This does behave much better. I tried with the SDF below by uncommenting only one of the<plugin>
tags. Without this PR, the objects fly up or down together even though gravity is 0. Visualizing contacts in gz-sim also shows that they are in contact. With the PR, the boxes stay in place and generate no contacts.SDF File
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸