Skip to content

bullet-featherstone: Add support for category bitmask - #884

Merged
iche033 merged 18 commits into
mainfrom
iche033/bullet_category_bitmask
Mar 12, 2026
Merged

bullet-featherstone: Add support for category bitmask#884
iche033 merged 18 commits into
mainfrom
iche033/bullet_category_bitmask

Conversation

@iche033

@iche033 iche033 commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

🎉 New feature

builds on top of #804

Summary

Adds support for category bitmask for the bullet-featherstone physics engine. This PR implements the strategy outlined gazebosim/sdformat#1630 that adds this new feature while preserving existing behavior when only collide bitmasks are set.

Note: another important change I made in this PR is that I had to manually call world->getCollisionWorld()->performDiscreteCollisionDetection(); again (after clearing the broadphase cache and stepping sim) to force generation of up-to-date contact points in the same iteration. Without this, incorrect contacts are generated and the test fails.

Test it

New test added in simulation_features.cc

To run

cd build/gz-physics
ctest -R simulation_features_bullet-featherstone

You can also play with the test world:

gz sim -v 4 -r <path_to>/gz-physics/test/common_test/worlds/shapes_category_bitmask.sdf --physics-engine libgz-physics-bullet-featherstone-plugin

Boxes are grouped by colors, i.e. have the same category bitmasks, so boxes of the same color should not collide with each other.

Screenshot 2026-03-02 at 6 15 47 PM

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the feature
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: Remove this if GenAI was not used.

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

Backports: If this is a backport, please use Rebase and Merge instead.

@iche033
iche033 requested review from azeey and scpeters as code owners March 3, 2026 02:24
@iche033 iche033 changed the title Add support for category bitmask bullet-featherstone: Add support for category bitmask Mar 3, 2026
@iche033 iche033 added the Bullet Bullet engine label Mar 3, 2026
Comment thread bullet-featherstone/src/SDFFeatures.cc Outdated
Comment thread bullet-featherstone/src/Base.cc Outdated
Comment thread bullet-featherstone/src/Base.cc Outdated
Comment thread bullet-featherstone/src/EntityManagementFeatures.cc Outdated
Comment thread bullet-featherstone/src/SDFFeatures.hh
Comment thread bullet-featherstone/src/SDFFeatures.cc Outdated
Comment thread test/common_test/simulation_features.cc Outdated
Comment thread bullet-featherstone/src/Base.cc Outdated
Signed-off-by: Ian Chen <iche@intrinsic.ai>
iche033 and others added 4 commits March 7, 2026 00:10
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
@iche033
iche033 force-pushed the iche033/bullet_category_bitmask branch from 70a581c to 3231ed1 Compare March 7, 2026 00:14
iche033 added 4 commits March 7, 2026 00:30
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
@github-project-automation github-project-automation Bot moved this from Inbox to In review in Core development Mar 9, 2026
Base automatically changed from iche033/bullet_collide_bitmask to main March 11, 2026 18:33
Signed-off-by: Ian Chen <iche@intrinsic.ai>
@iche033
iche033 merged commit c74c62c into main Mar 12, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Core development Mar 12, 2026
@iche033
iche033 deleted the iche033/bullet_category_bitmask branch March 12, 2026 16:16
iche033 added a commit that referenced this pull request Mar 12, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
iche033 added a commit that referenced this pull request Mar 19, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
mergify Bot pushed a commit that referenced this pull request Mar 19, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
(cherry picked from commit 0c74a8a)
mergify Bot pushed a commit that referenced this pull request Mar 19, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
(cherry picked from commit 0c74a8a)
iche033 added a commit that referenced this pull request Mar 19, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
(cherry picked from commit 0c74a8a)
iche033 added a commit that referenced this pull request Mar 20, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
(cherry picked from commit 0c74a8a)
iche033 added a commit that referenced this pull request Mar 23, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
(cherry picked from commit 0c74a8a)
@azeey azeey moved this from Done to Highlights in Core development Mar 25, 2026
mderbaso-deepx pushed a commit to DeepX-inc/gz-physics that referenced this pull request Apr 13, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
(cherry picked from commit 0c74a8a)
j-rivero pushed a commit that referenced this pull request Apr 28, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai>
Co-authored-by: Ian Chen <iche@intrinsic.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bullet Bullet engine 🏯 kura

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants