StanfordVL / OmniGibson

OmniGibson: a platform for accelerating Embodied AI research built upon NVIDIA's Omniverse engine. Join our Discord for support: https://discord.gg/bccR5vGFEx
https://behavior.stanford.edu/omnigibson/
MIT License
478 stars 50 forks source link

Multiple issues with contact checking #935

Open ChengshuLi opened 1 week ago

ChengshuLi commented 1 week ago
  1. Currently we have two ways of checking contacts, should unify
    • RigidContactAPI (this doesn't work for kinematic-only objects)
    • contact sensor: omni.isaac.sensor._sensor.acquire_contact_sensor_interface()
  2. For both methods, it seems that we only get contacts from the last physics step, instead of accumulating all the contacts from all the physics steps of the last sim step.
    • This can lead to problems because if two objects penetrate and then de-penetrate within the same sim step, no contact will be detected.
    • We have a contact subscription system, but it's currently only used for the Attached state
  3. RigidContactAPI has false positives
    • contact sensor reports contact, GUI shows contact, but the impulses from RigidContactAPI are all zeros.
hang-yin commented 3 days ago

Here's our current understanding:

Consider this scenario - image while all three objects are clearly touching/contacting each other, the RigidContactView gives all zeros for both impulse and contact. Even if we wake all objects after they fall asleep, we would still get the same result.

Now consider this assisted grasping scenario - image when the robot fingers get in contact with the red cube, we would get non-zero impulse and valid contact data from RigidContactView (GripperRigidContactAPI in this specific case). That is exactly how assisted grasping is established. However, once the cube is grasped and things settle, we would again get zero impulse and contact data.

There are essentially three stages of a contact:

  1. Contact occurs (obj A moves to touch obj B)
  2. Contact continues (obj A keeps touching obj B)
  3. Contact ends (obj A moves away from obj B)

Presumably, the RigidContactView only gives valid data during stage 1. This is perfectly fine for assisted grasping, as AG is checked per physics step. However, this is not fine for some of our other use cases, e.g. ToggleOn state checking, as continual contact is required. This would explain why our ToggleOn test is so flaky.

There are currently three ways we deal with contact: