haosulab / SAPIEN

SAPIEN Embodied AI Platform
https://sapien.ucsd.edu/
MIT License
430 stars 41 forks source link

Need suggestion to add support for soft material simulation #181

Closed zhoubin-me closed 1 week ago

zhoubin-me commented 2 weeks ago

I'm trying to build simulation for soft material, e.g. cloth simulation. I did find vulkan examples about it:

https://github.com/SaschaWillems/Vulkan/blob/master/examples/computecloth/computecloth.cpp

Really appreciate if you can give some suggestions on how to make integrate it with sapien, thank you!

fbxiang commented 2 weeks ago

Integrating soft body simulation with an existing simulator takes a lot more work than writing a simple demo example. The best approach is really to write a new simulator from scratch, but it takes too much time. And alternative approach we often take is to couple 2 simulators at the time-step level, which may be what you are more interested in. To couple your custom physical simulator with SAPIEN (or really any other simulator), you could follow these steps.

  1. initialize equivalent sets of geometries in both simulators (A and B)
  2. Step simulator A, get new states (could be poses or forces) for geometries in simulator A, copy these states from A to B
  3. Step simulator B, copy states from B to A.
  4. Repeat This may take significant engineering efforts to make work. However, if you are only looking to use SAPIEN as a renderer (i.e. you want to switch the backend of SAPIEN from PhysX to your own simulator), you can simply create SAPIEN scene with the renderer system without PhysX system and directly control the render objects with your code.
zhoubin-me commented 1 week ago

Thanks for your suggestion!