Skip to content
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

[BitmaskCollisionFilter]: improve with category and collision mask #150

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

costashatz
Copy link
Member

This PR fixes #136... The way to use this:

robot1:
    category_mask: 1 << 1
robot2:
    category_mask: 1 << 2
floor:
    category_mask: 1 << 3

This sets robot1 as category with number 2, robot2 as category with number 4, and floor as category with number 8. Now we set:

robot1:
    collision_mask: 4 | 8
robot2:
    collision_mask: 4
floor:
    collision_mask: 0

Collisions are ignored if collision_mask & category_mask_of_other == 0. In the above example, what will happen is that robot1 will collide with both robot2 and the floor, while robot2 will only collide with robot1.

Overall using the combinations of category and collision masks (per BodyNode), we can create a very complex collision ignorance systems.

@costashatz costashatz added this to the RobotDART 1.0.0 milestone Sep 28, 2021
@costashatz costashatz self-assigned this Sep 28, 2021
@costashatz costashatz merged commit 9afab0c into master Sep 28, 2021
@costashatz costashatz deleted the cat_col_filter branch September 28, 2021 22:37
costashatz added a commit that referenced this pull request Dec 8, 2021
[BitmaskCollisionFilter]: improve with category and collision mask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve bitmask collision masking
1 participant