Contact sensor not working when enabling GPU

Isaac Sim Version

4.5.0
4.2.0
4.1.0
4.0.0
4.5.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):

Operating System

Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):

GPU Information

  • Model: NVIDIA GeForce RTX 3090 Ti
  • Driver Version: 535.183.01

Topic Description

Detailed Description

I’m trying to get the contact information of the rigid body (here I use DynamicCuboid) under GPU simulation. It always detect no contact.

Steps to Reproduce

franka_new.zip (1.9 KB)

Screenshots or Videos

image

Additional Information

What I’ve Tried

I’ve tried 3 different methods (can be found in get_box_contact) to get contact but they all output in_contact=False.

  1. ContactSensor
for contact_sensor in contact_sensors:
    frame = contact_sensor.get_current_frame()
  1. _sensor.acquire_contact_sensor_interface()
_contact_sensor_interface = _sensor.acquire_contact_sensor_interface()
data = _contact_sensor_interface.get_sensor_reading("/World/envs/env_0/tumor/contact_sensor", use_latest_data = True)
raw_data = _contact_sensor_interface.get_contact_sensor_raw_data("/World/envs/env_0/tumor/contact_sensor")
  1. get_physx_simulation_interface().get_contact_report()
contact_headers, contact_data = get_physx_simulation_interface().get_contact_report()
for contact_header in contact_headers:
    print("Got contact header type: " + str(contact_header.type))
    print("Actor0: " + str(PhysicsSchemaTools.intToSdfPath(contact_header.actor0)))
    print("Actor1: " + str(PhysicsSchemaTools.intToSdfPath(contact_header.actor1)))
    print("Collider0: " + str(PhysicsSchemaTools.intToSdfPath(contact_header.collider0)))
    print("Collider1: " + str(PhysicsSchemaTools.intToSdfPath(contact_header.collider1)))
    print("StageId: " + str(contact_header.stage_id))
    print("Number of contacts: " + str(contact_header.num_contact_data))
  1. If I switch back to CPU then the contact sensor can detect the contact successfully.
    world = World(stage_units_in_meters=1.0, device='cpu', backend='numpy)

Related Issues

When will the deformable object have contact information supported?

Additional Context

I upgraded from version 4.2.0 and it worked using the same code under GPU.

Hi @lyx010318,

Due to the implementation algorithm, contact sensor is not available on GPU. If there is only one object you are coming into contact with then one way you could query for contacts is through the RigidContactView api. This will give you all the contact information, but you can just query for the contact data corresponding to the prim id of interest (see the example in the documentation for get_contact_data).

Hope that helps,
Michael

Thanks for explaining. I’ll try that.
Also, will the future version support deformable contact? I guess that’s the same question of will the contact sensor being supported on the GPU?

Yes, it is a plan to include this in the upcoming release.

Hello!

We noticed that this topic hasn’t received any recent responses, so we are closing it for now to help keep the forum organized.

If you’re still experiencing this issue or have additional questions, please feel free to create a new topic with updated details. When doing so, we recommend mentioning or linking to this original topic in your new post—this helps provide context and makes it easier for others to assist you.

Thank you for being part of the NVIDIA Isaac Sim community.

Best regards,
The NVIDIA Isaac Sim Forum Team