bullet-featurestore: Enable auto deactivation #630
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.
🎉 New feature
Summary
bullet supports auto deactivation of bodies after certain period if there's no motion (velocity < some threshold). This feature should be enabled by default by bullet but it looks like we were overriding this by looping through all models and setting them to active after every step. I think this may have been done because free group / joint cmds were not working after objects were deactivated.
This PR removes that logic for activating all bodies after every step. Instead, an explicit call to wake up the bodies when setting free group / joint commands.
Test it
The effect is most obvious with mesh-to-mesh collisions which are less stable. When 2 meshes collide and come to a rest, they should now stop drifting.
I tested with the box meshes from #600 (under To Test section). Expand the Component Inspector to see more decimal points, let the 2 box meshes collide. After a couple of seconds, the box pose values should settle and stop updating. Before these changes, the pose values would continue to drift over time.
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.