Mesure the deformation of an object

Hello,
I am attempting to simulate deformable objects and would like to know if there are features in Isaac Sim (or the Omniverse kit as a whole) that can assist in measuring the extent of deformation these objects undergo after contact with rigid bodies, such as the fingers of a panda gripper.
In my research, I came across the study DefGraspSim: Simulation-based grasping of 3D deformable objects which offers code-based features for evaluating the grasping of various objects. However, I have been unable to utilize or replicate these features as they are designed to work with Isaac Gym, a platform I am not well-versed in.
Could anyone provide assistance?
Thank you very much

I’m not sure if there is this tool you are looking for, but you can start taking a look at the franka deformable OIGE example. They get the mesh points of a deformable there, you can probably compute all you need from those points.

1 Like

Hi Edson,
thanks for the reply. I’ve looked into the pointed example and I think you are referring to the lines:

from omni.isaac.core.prims.soft.deformable_prim import DeformablePrim
from omni.isaac.core.prims.soft.deformable_prim_view import DeformablePrimView
self.deformableView = DeformablePrimView(
            prim_paths_expr="/World/envs/.*/deformableTube/tube/mesh", name="deformabletube_view"
        )
tube_positions = self.deformableView.get_simulation_mesh_nodal_positions(clone=False)

However when i tried to use it in my code it raised the error

Traceback (most recent call last):
  File "/home/alexz/.local/share/ov/pkg/isaac_sim-2023.1.1/Deformable/DeformableApple.py", line 128, in <module>
    print("nodal positions: ", def_prim._deformable_prim_view.get_simulation_mesh_nodal_positions(clone=False))
  File "/home/alexz/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/prims/soft/deformable_prim_view.py", line 908, in get_simulation_mesh_nodal_positions
    [indices.shape[0], self.max_simulation_mesh_vertices_per_body, 3], dtype="float32", device=self._device
  File "/home/alexz/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/prims/soft/deformable_prim_view.py", line 137, in max_simulation_mesh_vertices_per_body
    return self._max_simulation_mesh_vertices_per_body
AttributeError: 'DeformablePrimView' object has no attribute '_max_simulation_mesh_vertices_per_body'. Did you mean: 'max_simulation_mesh_vertices_per_body'?

This seems to be an error originating from the source code, for which I am not responsible. After correcting the typo in the source code as indicated by the log error, the following error emerges:

Traceback (most recent call last):
  File "/home/alexz/.local/share/ov/pkg/isaac_sim-2023.1.1/Deformable/DeformableApple.py", line 128, in <module>
    print("nodal positions: ", def_prim._deformable_prim_view.get_simulation_mesh_nodal_positions(clone=False))
  File "/home/alexz/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/prims/soft/deformable_prim_view.py", line 908, in get_simulation_mesh_nodal_positions
    [indices.shape[0], self.max_simulation_mesh_vertices_per_body, 3], dtype="float32", device=self._device
  File "/home/alexz/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/prims/soft/deformable_prim_view.py", line 137, in max_simulation_mesh_vertices_per_body
    return self.max_simulation_mesh_vertices_per_body
  File "/home/alexz/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/prims/soft/deformable_prim_view.py", line 137, in max_simulation_mesh_vertices_per_body
    return self.max_simulation_mesh_vertices_per_body
  File "/home/alexz/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/prims/soft/deformable_prim_view.py", line 137, in max_simulation_mesh_vertices_per_body
    return self.max_simulation_mesh_vertices_per_body
  [Previous line repeated 995 more times]
RecursionError: maximum recursion depth exceeded

Has someone run into this problem while using the DeformablePrim and DeformableView classes before and was able to solve them? (Classes that by the way seems not included in the documentation)
Thank you

Following @edsonbffilho heads up of getting the mesh point I found this script Get Size of a Mesh that computes the size of a mesh following the Axis-Aligned Bounding Box (AABB) convetion and it worked fine for me as a workaround to get how much a Deformable objects deforms.
Thanks

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.