Access to CPython Sensor Code or Low-Level Object Collision Information to Model Custom Contact Sensor

Hello!

I’m trying to model a custom contact sensor that can detect normal and shear forces based on the deformation of the sensor. However, the contact sensor class in the omniverse documentation only appears to allow access to the force, impulse, and normal information.

Are there methods of accessing the body collision information from:

  1. the Python or Cython source code for the omni.issac.sensor _sensor class
  2. from USD APIs/classes/methods
  3. any other means?

Thanks!

A follow-up question:

It seems that the Omniverse contact sensor class can only be spherical. Are there any plans to allow for the shape to be defined by a mesh?

If not, do you have any recommendations for how to utilize the spherical setup to approximate a rounded but no spherical shape?

For shear force you mean access to the tangential friction force? This is currently not possible, unfortunately, but it is on our list of features to add (I don’t have a timeline yet for you, unfortunately).

Yes, tangential friction force.

I’m having trouble getting normal force readings from adding the contact sensors to my robot. I think it may be due to the API’s I have applied to the prims in the USD because when I import the Ant USD and add contact sensors to the legs (like the contact sensor example) it works in my script.

This is the USD/link I’m trying to apply the contact sensor to:

def Xform "dip_link2" (
    prepend apiSchemas = ["PhysicsRigidBodyAPI"]
)
{
    token visibility = "inherited"
    quatd xformOp:orient = (0.70710688829422, 0, -0.7071066498756409, 0)
    double3 xformOp:scale = (1, 1, 1)
    double3 xformOp:translate = (5.319714801998998e-8, -0.03550000116229057, 1.18274986743927)
    uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"]

    def "visuals" (
        prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMassAPI", "PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysicsMeshCollisionAPI", "PhysxSDFMeshCollisionAPI", "PhysxContactReportAPI"]
        instanceable = true
        prepend references = @./Props/instanceable_meshes_no_collision_meshes.usda@</manipulator/dip_link2/visuals>
    )
    {
        point3f physics:centerOfMass = (0.022019, -0.0011798, 0.000092257)
        float3 physics:diagonalInertia = (0.0000011712, 0.0000011826, 9.7145e-7)
        float physics:mass = 0.027278
        uniform token physics:approximation = "sdf"
        bool physics:collisionEnabled = 1
        float physxContactReport:threshold = 0
    }
}

}

Is there anything you see wrong that I should change?

No did you compare this to the working Ant example you have?

I’ve tried comparing it to the Ant example, but because the ant USD is a .usd instead of .usda file, I have to open it in the Isaac Sim GUI application first and save it to a .usda file.

I believe this process changes the file in a potentially important way because when I try to import the new .usda into my scene in the contact sensor example extension using the same method as the original ant.usd file, it throws an error.

However, when just comparing the API’s and settings for the xforms and meshes/shapes in the ant and my robot USD files, I’ve already made the manual changes I think are necessary to have matching functionality to get the contact sensors to work on my robot.

I’ve attached the USD files for my robot that I think should work and the converted .usda ant if they would be useful:

simple_ant.usda (2.0 MB)
Arm_with_Two_Fingers_Manual_SDF_Clean_Manual_Just_Robot_Edit_To_Match_Ant.usda (40.0 KB)

1 Like

Just to clarify the message above, I haven’t found a solution to why the contact sensor won’t work on my robot and I’ve attached the full USD files. Can you please take a look to see what the problem may be?

The spherical region is just a clipping plane for contact information - contacts will only happen in the surface of the collision mesh, and if they are within the spherical clipping plane they will count towards the contact sensor.

are you getting any errors when you try using it? what is the issue you are experiencing, specifically?

I’ve opened a separate post with the information