Confused on ContactSensor with an output of multiple contacts but in_contact False

Hi, I was using omni.isaac.sensor.ContactSensor and added ContactSensors. When two bodies are in contact, I got something like below. I am expecting a non-zero force but it gave 0 force and in_contact False. Though clearly the two bodies are in contact with 4 contact points.

{'time': 16.000000834465027, 'physics_step': 960.0, 'contacts': [{'body0': '/World/CubeLift', 'body1': '/World/kuka_allegro/kuka_allegro/thumb_link_3', 'position': array([0.001
8186 , 0.00960615, 0.36933678], dtype=float32), 'normal': array([ 0.02291878, -0.01279282, -0.9996555 ], dtype=float32), 'impulse': array([ 0., -0., -0.], dtype=float32)}, {'bo
dy0': '/World/CubeLift', 'body1': '/World/kuka_allegro/kuka_allegro/thumb_link_3', 'position': array([0.0018186 , 0.00960615, 0.36933678], dtype=float32), 'normal': array([ 0.0
2291878, -0.01279282, -0.9996555 ], dtype=float32), 'impulse': array([ 0., -0., -0.], dtype=float32)}, {'body0': '/World/CubeLift', 'body1': '/World/kuka_allegro/kuka_allegro/t
humb_link_3', 'position': array([0.0018186 , 0.00960615, 0.36933678], dtype=float32), 'normal': array([ 0.02291878, -0.01279282, -0.9996555 ], dtype=float32), 'impulse': array(
[ 0., -0., -0.], dtype=float32)}, {'body0': '/World/CubeLift', 'body1': '/World/kuka_allegro/kuka_allegro/thumb_link_3', 'position': array([0.0018186 , 0.00960615, 0.36933678],
 dtype=float32), 'normal': array([ 0.02291878, -0.01279282, -0.9996555 ], dtype=float32), 'impulse': array([ 0., -0., -0.], dtype=float32)}], 'in_contact': False, 'force': 0.0,
 'number_of_contacts': 4}

Tracing a bit, I found the fields were queried with two apis: get_sensor_readings and get_contact_sensor_raw_data. What’s the proper way to use the ContactSensor api and is it possible to get the contact force at those contact points? Thanks!

Both apis are correct and the data you are getting is correct. The contact points you are getting references the queried bodies and not filtered by the contact sensor radius. However the readings in_contact and force are filtered using the contact sensor radius. Probably whats happening is that these contacts are being filtered out using the radius therefore the force is 0 and the sensor reading is not in_contact. Will will clarify this in our documentation.

Please let us know if you have further questions.

Thanks for clarification! Is impulse field also filtered by the contact sensor radius?

Another question is all queried contacts points have the same positions and normals, as shown above. Is it as expected?

Impulse shouldn’t be filtered, no. Can you provide us with a repro script to explain whats happening ?