Parse category bitmask SDF element in Surface DOM (backport #1630) - #1634
Merged
Conversation
12 tasks
Contributor
|
the ubuntu build is failing because it's failing to download codcov hash file: Looks like |
Signed-off-by: Ian Chen <ichen@openrobotics.org> (cherry picked from commit 9f8b079)
iche033
force-pushed
the
mergify/bp/sdf15/pr-1630
branch
from
March 4, 2026 01:01
9c44125 to
c63c971
Compare
Contributor
Ran again and now it passes. Could bit hitting a rate limit. |
iche033
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Parses the
category_bitmaskSDF element:https://sdformat.org/spec/1.12/collision/#contact_category_bitmask
In short, collision occurs if
(category_bitmask1 & collide_bitmask2) | (category_bitmask2 & collide_bitmask1)evaluates to non-zero.
Currently in gazebo, collision occurs if
(collide_bitmask1 & collide_bitmask2)evaluates to non-zero. To preserve backward compatibility, here's a proposed implementation (to be implemented in gz-physics):collide_bitmaskis set andcategory_bitmaskis not set, thencategory_bitmaskis set to the same value ascollide_bitmaskExample 1:
collide_bitmaskis set butcategory_bitmaskis not for both collision entities (existing behavior in gz-physics):collide_bitmask1: 0x1category_bitmask1: (not set, so defaults to 0x1 )collide_bitmask2: 0x2category_bitmask2: (not set, so defaults to 0x2 )Result of
(category_bitmask1 & collide_bitmask2) | (category_bitmask2 & collide_bitmask1): No collision. Preserves existing behavior.Example 2:
collide_bitmaskandcategory_bitmaskare set for both collision entitiescollide_bitmask1: 0x1category_bitmask1:0x2collide_bitmask2: 0x2category_bitmask2: 0x1Result of
(category_bitmask1 & collide_bitmask2) | (category_bitmask2 & collide_bitmask1): Collision occurs!Example 3:
collide_bitmaskandcategory_bitmaskare set for one collision entity while onlycollide_bitmaskis set for the other collision entitycollide_bitmask1: 0x1category_bitmask1: (not set, so defaults to 0x1)collide_bitmask2: 0x2category_bitmask2: 0x1Result of
(category_bitmask1 & collide_bitmask2) | (category_bitmask2 & collide_bitmask1): Collision occurs!The category bitmask field in Surface DOM uses
std::optionaltype so we are able to know if the value is set or not.Checklist
codecheckpassed (See contributing)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-byandGenerated-bymessages.Backports: If this is a backport, please use Rebase and Merge instead.
This is an automatic backport of pull request #1630 done by [Mergify](https://mergify.com).