Interpenetration of objects and incoherent force measurement with physx engine

Hi,

I face two problems:

Context: There is a manipulator (with a gripper) that is always controlled (using inverse kinematic and position controller) to go down (-z) and forward (+x) in the scenario shown in the videos below


1) There is interpenetration between the robot gripper and a rigid object no matter what simulation parameters are changed

After reading in detail the Isaac Gym documentation (Simulation Setup, Simulation Parameters, Simulation Parameter Tuning, etc.) and also the PhysX 4.1 SDK Guide (Best Practice Guide, Advanced Collision Detection) it seems to be impossible to avoid the interpenetration between the robot gripper and a rigid object as shown in the videos…

The typical behavior follows the same pattern: the simulation performs correctly (or not) the contact without interpenetration of the objects for a few episodes and then enters a state in which there is always interpenetration.

Questions:

  • Based on the configuration parameters shown below (which have been tested with several sets of values), how could the interpenetration problem be fixed?
  • Does the fact that the gripper’s fixed finger has a very sharp collision geometry affect the physics?


Here are, as a reference, the latest parameters used to configure the PhysX engine:

'sim': {'dt': 1 / 60.0, # 1/60: 0.0166
        'substeps': 8, 
        'up_axis': 'z', 
        'use_gpu_pipeline': True, 
        'gravity': [0.0, 0.0, -9.81], 
        'physx': {'num_threads': 4, # for CPU PhysX only
                  'solver_type': 1, # 0: pgs, 1: tgs
                  'use_gpu': True, 
                  'num_position_iterations': 12, 
                  'num_velocity_iterations': 0, 
                  'contact_offset': 0.005, 
                  'rest_offset': 0.0, 
                  'bounce_threshold_velocity': 0.08175,  # 2 * gravity * dt / num_substeps
                  'max_depenetration_velocity': 1000.0, 
                  'default_buffer_size_multiplier': 5.0, 
                  'max_gpu_contact_pairs': 8 * 1024 ** 2,
                  'friction_offset_threshold': 0.005,
                  'friction_correlation_distance': 0.001,
                  'num_subscenes': 4, 
                  'contact_collection': 2}}, # 0: CC_NEVER, 1: CC_LAST_SUBSTEP, 2: CC_ALL_SUBSTEPS

2) Force reporting is not consistent for different sensors

I am measuring the force that appears during the performance of the task (shown in the video below) using the three methods indicated in the documentation (Joint Force Sensors, Rigid Body Force Sensors and Contact Tensors (net contact force: CC_ALL_SUBSTEPS). Note: The rigid body force sensor is attached to the fixed finger.

However, based on the next graphs, only the contact tensors (net force) show values consistent with the simulation (always go down (-z) and forward (+x)). The other sensors don’t show relevant/valid information, for example, after 60 timesteps (when the gripper touches the object and a downward and forward motion is still applied).

Question:

  • Any idea why this might be happening?
  • How can I get a reliable force measurement from the other sensors?

Thanks in advance,
Toni

1 Like

Hello Toni,
I am also using IsaacGym to build an environment where a manipulator interacts with contact forces.

First of all, for your question #2, yeah I have experienced the same thing. It seems like those dof-force/force sensor outputs are very irrelevant force value when there is contact/friction. At least, the contact-force sensor showed me a somewhat consistent force values. It still had some very high noise (sometimes it had some value like 100N, which was supposed to output around 1-2N), so I had to implement median-moving avg filter to remove those weird noise.
Back to your question, when you are using the contact sensor for the gripper, it becomes very tricky. It is because now your fixed finger experience the friction/normal forces from the object which is resulted by the end-effector’s movement and the other finger’s grasping motion. The contact sensor basically sums up all the contact forces occurring on its whole body(the gripper in your case), but it does not tell where the contact is occurring (In IsaacSim you can get an access to the raw data and get the local pose, but I don’t think you can get that from IsaacGym. It has “gym.get_rigid_contacts” to get RigidContact object which is basically the raw data, but I don’t think it is fully implemented on IsaacGym yet.)
In my case, I do not work on the grasping motion, so I just attached the object on the robot (basically add the object on the robot urdf file). In your case, what I can think of is measure the contact forces occuring on both fingers or measure the contact force occurring on the object. I actually tried both methods, and the result was not the best but became somewhat more explainable.

For your first question, try sdf instead of the regular mesh. For me, it seems to be working better when there is somewhat complicated-shaped object. In the factory example, Nvidia is also using sdf to express the bolts and nuts. You can simply add sdf resolution=“256” inside collision. Here is an example:
collision
geometry
mesh filename=“…/mesh/factory_nut_bolt/factory_nut_m8_loose_subdiv_3x.obj”
geometry
sdf resolution=“256”
collision

If you have found out any other solutions, please let me know!

1 Like

Hi @wlsgn1217

Thanks for pointing out some ideas for the resolution.

At the time the signed distance function (SDF)-based collisions were not implemented, and I think we changed the gripper and adjusted the simulation parameters better to avoid interpenetration.

Indeed, I have migrated some implementations to Isaac Sim, at least those that do not use cameras at the moment :)

1 Like

Hey @toni.sm ,

how did you change the simulation parameters? What was the one that solved the issue?
Having the same problem…