How to setup collision between soft tissue and rigid body using Free Motion AL #5207
Unanswered
Lorenzo-Mazza
asked this question in
Write / Run a simulation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I have been trying to implement a collision model between a soft tissue (a liver) and a rigid body (a surgical hook).
My goal is to control the surgical hook via a position-based controller and actively create deformations of the soft tissue.
For the controller, I based myself upon the templates from the 'sofa_env' project by @ScheiklP (https://github.com/ScheiklP/sofa_env/tree/main).
However I have been struggling to find a plausible solution.
The only examples I found in the SOFA codebase regarding a liver and a FreeMotionAnimationLoop are the following:
https://github.com/sofa-framework/sofa/blob/88320b856fea453ee6311d922f888446acda8018/applications/plugins/Geomagic/scenes/Geomagic-FEMLiver.scn
https://github.com/sofa-framework/sofa/blob/88320b856fea453ee6311d922f888446acda8018/applications/plugins/MultiThreading/examples/livers.scn
https://github.com/sofa-framework/sofa/blob/88320b856fea453ee6311d922f888446acda8018/applications/plugins/Haption/examples/haption1.scn
I tried to use the same liver parameters as in the examples, but they result in unstable results. The liver seems way too soft, even when tweaking the params and choosing a very high Young Modulus.
I am not able to implement a realistic collision so far. I am not sure whether the issue lies in the position-based controller, in my scene definition or in something else.
Following a suggestion by @ScheiklP, I tried to tweak the tool controller to slow down the hook velocity when moving (by reducing the position offset after every OnKeyPressedEvent). Unfortunately the effect is the same. When the objects collide, either the simulation becomes unstable or the liver is still too soft and deformed in unrealistic ways.
https://github.com/user-attachments/assets/623bd272-848a-4771-aca0-649f1963da13
Below, I tried to re-write the code to show a minimally understandable example (in my actual code I am using a lot of helper functions coming from sofa_env). I hope I did not forget anything.
Feel free to have a look. I would really appreciate if someone had an intuition on what I am doing wrong.
The scale of the meshes is in meters.
SOFA version is 24.06.
Thanks,
Lorenzo Mazza
The controller updates the location of the tool in a similar manner:
Where method
do_action
simply converts Pan-Tilt-Spin-Depth coordinates to cartesian coordinates and adds them to the tool current cartesian pose in the following way (taken by sofa_env) :Beta Was this translation helpful? Give feedback.
All reactions