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

Collision filtering #4

Merged
merged 7 commits into from
Apr 22, 2024
Merged

Collision filtering #4

merged 7 commits into from
Apr 22, 2024

Conversation

m-decoster
Copy link
Contributor

Adds examples to the collision checking notebook of:

  • How to detect which bodies are colliding
  • How to filter collisions with the SceneGraphCollisionChecker (SGCC)

In this current version, these methods are incompatible. When filtering with the SGCC, we will still get contacts when using the plant's contact output port. If we use an alternative method of filtering, see here, using the scene graph's collision filter manager, then we get the opposite: the SGCC will report that the configuration is not collision free, but there will be zero contacts reported from the plant's contact output port.

I will investigate further, this link will probably be useful. Most likely, this is due to these two operating on different contexts.

@m-decoster m-decoster self-assigned this Mar 29, 2024
@m-decoster
Copy link
Contributor Author

From the Drake C++ API documentation (source):

The CollisionChecker's definition of filtered body pairs is initially drawn from the underlying model's configuration (see GetNominalFilteredCollisionMatrix()). However, the CollisionChecker's definition of the set of collision filters is independent of the model after construction and can be freely modified to allow for greater freedom in determining which bodies can affect each other.

GetNominalFilteredCollisionMatrix():

The nominal matrix is initialized at construction time and represents the configuration of the model's plant and scene graph. It serves as a reference point to assess any changes to collision filters beyond this checker's intrinsic model.

Hence, if we update the collision filter manager of the scene graph after construction of the SceneGraphCollisionChecker, the latter will not reflect these changes.

For our use cases, we will mostly want to use the SceneGraphCollisionChecker for now, to check if states are valid when motion planning with airo-planner. My proposal is to only implement collision filtering and checking with SceneGraphCollisionChecker for now. See the commit after this comment.

When use cases arise where we want to do more in simulation or model certain constraints, we will want to add functionality that works with the SceneGraph's CollisionFilterManager.

@m-decoster m-decoster marked this pull request as ready for review April 2, 2024 09:19
Copy link
Contributor

@Victorlouisdg Victorlouisdg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks great, these are very useful features for airo-drake! Feel free to merge and release a new version of airo-drake.

collision_checker: SceneGraphCollisionChecker,
body_indices_one: List[BodyIndex],
body_indices_two: List[BodyIndex],
*,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this asterisk * an accident?

@m-decoster m-decoster merged commit 37b9c61 into main Apr 22, 2024
6 checks passed
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.

2 participants