Home › Forum › SOFA › Using SOFA › [SOLVED] How to extract reaction force for certain nodes
Tagged: 64_bits, Linux_ubuntu, reaction force, SOFA_1906
- This topic has 9 replies, 3 voices, and was last updated 3 years, 11 months ago by trannguyenle.
-
AuthorPosts
-
5 November 2019 at 02:27 #14533nickljBlocked
Hi
Recently, I met problem when extracting reaction force. The sense I modeled is a rigid gripper to grasp a deformable object, say, soft ball. I want to extract the reaction force the ball exert on the gripper during grasping. I understand that for rigid body the mechanical object is generally 1 indice with 3 position and 4 quaternion elements. So the problem comes how to get the reaction force on this specific node.I found two related topics in the forum but none can solve my problem.
https://www.sofa-framework.org/community/forum/topic/tactile-sensing-with-deformable-material-in-sofa/
https://www.sofa-framework.org/community/forum/topic/external-force-on-a-vertex/I use RestShapeSpringsForceField with a very large stiffness to constrain my gripper, and move the rest position the modify to control the gripper. I’ve tried to extract the force for the gripper mechanicalObject, i.e.
node.getChild(‘finger’).getObject(‘mechObj’).force
However, the value is extremely large and cannot be trusted. I guess that this is because this force value considering the recovering force during applying constraint.
Then I found that there is a constraint value in the
node.getChild(‘finger’).getObject(‘collision’).getObject(‘mechObj’).constraint
And the value seems somewhat reasonable, and can even extract the value at each surface mesh indices of the rigid body (this is exactly what I want). However, the format seems a bit difficult for me to understand, as:
0 1 37 -0.841634 0.148139 0.519333 1 1 37 0.127235 -0.880181 0.457267 2 1 37 -0.524846 -0.450929 -0.721942
I’ve tried to read into the source code to find the exact data structure, but still struggling with understanding the whole program architecture. I have some knowledge on the contact algorithm in commercial software and also implemented contact algorithm in my own in-house FEM code. We generally define the slave and master surface, and detect the penetration of slave surface point into master surface and use penalty method for compensation. However, I’m still quite confused by the TriangleCollisionModel, LineCollisionModel and PointCollisionModel, and not sure why need these much “model”. Since I found different model also output different format for the “constraint” object.
Hence now I would like to seek for your help. Could you kindly help to explain the meaning of the constraint value, or more specifically, how to extract the reaction force during grasping?
25 November 2019 at 08:19 #14623nickljBlockedAnyone may help me on this?
27 November 2019 at 22:52 #14649HugoKeymasterDear @nicklj
I am really sorry for the delay of my reply, we have been busy with the SOFA Week. You can find out more about this annual community event on SofaFramework’s YouTube account.
I don’t whether you can share a (simplified) version of your rigid object grasping a deformable one. It would help knowing which collision detection you are using, which resolution/response your are using.
I understood that you are interesting in recovering the force applied on the rigid grasper. Is this correct?
When you say the “force” data field provides extremely large values, how much is this? what are your units?
Sorry for coming up with more questions than answers (for now!).
Best wishes,Hugo
28 November 2019 at 04:05 #14653nickljBlockedDear @Hugo,
Thanks a lot for your kind reply. Firstly congratulations on the successful SOFA week. It was very pity that I cannot join the activity this year as the half earth distance:( Hopfully there is chance next year and I can do some contribution with my knowledge. Actually I’ve watched the live streaming on the Symposium day and it was amazing. I’ve learnt many state-of-art work progress using SOFA and very exicted with the active community.
For my problem, please find a (reletively) complete program from the following dropbox link:
https://www.dropbox.com/sh/l40p8sqznedv6va/AABQCwRdEUfN5uKa5TdgqGXCa?dl=0I successfully run it using the master branch (up to today) “13e61c5″. ctrl+”+”/”-” is used to squzzing/relexing the grasper. For some details questions, I’ve commented in the code with
####################
# QUESTION #
#******************#
####################
There is one small question in gripper.pyscn, and one detailed question in controller.pyComing up to answer your question:
I understood that you are interesting in recovering the force applied on the rigid grasper. Is this correct?
– Yes. More specificly I’d like to know the force applied on certain vertex points (assuming where sensor is attached). But for now the force on the whole rigid grasper is good enough. In abaqus we do this by “applying rigid body constrain on the rigid body to a reference point”, then “output the value of reaction force on that reference point”.When you say the “force” data field provides extremely large values, how much is this? what are your units?
– It will be up to the value I used in the RestShapeSpringsForceField. I’ve already commened in the program.
– For the unit, I used the mm/N/tonne/MPa system.Much appriciate for your kind help.
3 December 2019 at 01:45 #14676HugoKeymasterDear @nicklj
Thank you for your super enthusiastic reply! The SOFA week is actually the success of the entire community, from PhDs, researchers to industrial partners. We are glad to see the community growing and increasing its simulation activities. It would definitely be a pleasure to get further contributions and to have you with us next year.
Regarding soft robotics, a tutorial should be organized for Robosoft 2020, let me know if you are interested.
For you questions, firt of all, thanks they were clearly identified in your files.
Secondly, sorry for the delayed reply, I am currently in holidays and it took me some time to get your files with the WiFi.1. Question on Collision: you are right, adding the Line and TriangleCollisionModel do not improve much the simulation. The collision between the points of the fingers and the triangles of the apple seem to be sufficient.
2. OK I better understand which forces you want to extract and how to do it. You are solving the contact using the Lagrange Mutlipliers method described here. It is possible to recover the forces (lambda) resulting from the contact resolution. This is described in the following post.
Let me know if it needs further clarification.Anyway, nice work! Looking forward to seeing what you will achieve with it!
Best wishes,Hugo
3 December 2019 at 01:47 #14677HugoKeymasterJust two short remarks
PS: note that using UncoupledConstraintCorrection strongly simplifies your finger model in the constraint resolution.
PS2: note that the time step has (as always) a strong importance in the stability of your simulation3 December 2019 at 06:51 #14680nickljBlockedDear @hugo,
Thanks a lot for your time and your reply. Really helpful and that’s exactly what I want. Your PS is also helpful and I will play with them.
5 December 2019 at 12:23 #14683HugoKeymasterYou are very welcome @nicklj
Let us know whether you need more guidance.
If it solves your problem, feel free to close this topic.Best,
Hugo
14 December 2019 at 15:08 #14692nickljBlockedThnaks. I’ve marked this topic as resolved.
9 December 2020 at 13:46 #17985trannguyenleBlockedHi @nicklj,
I just found this topic and this scene is exactly what I need in my experiment? Would it be able for me to have the latest version of this scene? It would be really helpful for me!
Thanks alot!
-
AuthorPosts
- You must be logged in to reply to this topic.