Isaac Sim Version
4.2.0
4.1.0
4.0.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):
Isaac Lab Version (if applicable)
1.2
1.1
1.0
Other (please specify):
Operating System
Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):
GPU Information
- Model: NVIDIA GeForce RTX 2070
- Driver Version: 535.183.06
Topic Description
Detailed Description
I’m trying to use the Franka robot to grasp a deformable object on the ground. I want to get the contact information during the execution to know if my grasp is successful.
I followed the documentation Contact Sensor to set up a contact sensor on my deformable object. But I couldn’t get any data. Can anyone help me with it?
Steps to Reproduce
cube_mesh = UsdGeom.Mesh.Define(current_stage, deformable_prim_path)
# Add PhysX deformable body
deformableUtils.add_physx_deformable_body(
current_stage,
deformable_prim_path,
collision_simplification=True,
simulation_hexahedral_resolution=30,
solver_position_iteration_count=20,
self_collision=False,
)
# Create a physics material
deformable_material_path = omni.usd.get_stage_next_free_path(current_stage, "/DeformableBodyMaterial", True)
deformableUtils.add_deformable_body_material(
current_stage,
deformable_material_path,
youngs_modulus=1005.0,
poissons_ratio=0.3,
damping_scale=0.0,
elasticity_damping=0.0001,
dynamic_friction=1.0,
density=100,
)
# Assign the material to the mesh
physicsUtils.add_physics_material_to_prim(current_stage, cube_mesh.GetPrim(), deformable_material_path)
contactReportAPI = PhysxSchema.PhysxContactReportAPI.Apply(cube_mesh.GetPrim())
contactReportAPI.CreateThresholdAttr().Set(0.0)
# Add contact sensor
contact_sensor = ContactSensor(
prim_path=deformable_prim_path + "/Contact_Sensor",
name="Contact_Sensor",
frequency=60,
translation=np.array([0, 0, 0]),
min_threshold=0,
max_threshold=10000000,
radius=-1
)
Error Messages
2024-12-10 17:52:45 [12,290ms] [Warning] [omni.isaac.sensor.plugin] No valid parent for /World/env_0/deformable/Contact_Sensor with a rigid body api was found, sensor will not be created
2024-12-10 17:52:45 [12,290ms] [Warning] [omni.isaac.sensor.plugin] Failed to create contact sensor, parent prim is not found or invalid
Additional Information
What I’ve Tried
I’ve tried three different methods to get the contact sensor data. But none of them output the contact information.
# Method 1
value = sensor.get_current_frame()
print(value)
# Method 2
_contact_sensor_interface = _sensor.acquire_contact_sensor_interface()
raw_data = _contact_sensor_interface.get_contact_sensor_raw_data(deformable_prim_path + "/Contact_Sensor")
print(str(raw_data))
# Method 3
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)))
Related Issues
I noticed several similar questions have been posted since 22 and the answer was this feature will be released in the future. I’m wondering if this is something available now?