Detect collision between agents and obstacles in Isaac Lab scripts

Hi, after some research, I am still confused about the best practices for detecting collisions of robots and obstacles in a scene.

Say I have the quadcopter_direct scene in the Isaac Lab samples. Now I added some obstacles in the scene, and during training, I want to detect whether the quadcopters have a collision with any of the obstacles (global) so that I can set done and negative rewards to the agents.

I know I can create contact sensors attached to the quadcopters, but I found that in the code the many-to-many filtering is not working. I have the configuration like the following.

 # contact = ContactSensorCfg(
    #     prim_path="/World/envs/env_.*/Robot/.*", 
    #     filter_prim_paths_expr=[???],
    #     update_period=0.01, 
    #     history_length=1, 
    #     debug_vis=False
    # )

It seems that I cannot create a contact sensor for each quadcopter in different environments and filter other environments. To use the contact sensor I need to create separate instances for different environments and manually filter other environments. However, this is not efficient enough.

I wonder if there is any efficient API to detect the collision in each of the collision groups or environments. Maybe some low-level PhysX calls can return tensor objects.

I am also curious about that if the contact sensors in different collision groups will interact with each other.

Thank you for your interest in Isaac Lab. To ensure efficient support and collaboration, please submit your topic to its GitHub repo following the instructions provided on Isaac Lab’s Contributing Guidelines regarding discussions, submitting issues, feature requests, and contributing to the project.

We appreciate your understanding and look forward to assisting you.

This page in the documentation explains how to filter your sensor’s contact to its own environment: