Skip to content

Ignore collisions between specific objects with CollisionManager #2454

@jstmn

Description

@jstmn

Hi,

For my use case (checking for collisions between links of a robot) there are certain meshes in my CollisionManager which I don't want FCL to check for collisions between. Is there anyway to have the CollisionManager selectively ignore object pairs? Or any plans to have this added?

It doesn't seem too complicated with python-fcl, so I can make this change if not. Would just need to replace self._manager.collide(cdata, fcl.defaultCollisionCallback) with the following in collision.py:

# Define a callback that ignores certain pairs
def filtering_callback(o1, o2, cdata):
    if (o1,o2) in self.ignored_collision_pairs:
        return False  # returning False means "do not check"
    return True  # check normally

self._manager.collide(cdata, filtering_callback)

I can put a PR in for this if this project is accepting them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions