Home › Forum › SOFA › Using SOFA › [SOLVED] How to do feasible and stable physical acceleration in force feedback scene?
Tagged: 64_bits, Cuda, physical acceleration, SOFA_1706, Windows_7
- This topic has 40 replies, 4 voices, and was last updated 5 years, 9 months ago by Wong.
-
AuthorPosts
-
15 February 2019 at 16:26 #13046WongBlocked
Hello @olivier-goury,
I tried to do it but it did not work.
https://www.dropbox.com/s/2m6rl239eb6w8rp/reduced_test3.py?dl=0Wong
15 February 2019 at 17:27 #13047olivierBlockedHi @outtt,
Several reasons why this does not work completely:
– 1) the actuator node has to be a child of the “attachedTo” node to be aside the reduced model, and the link for the position of the actuator needs to updated. This how it should look like:actuator = attachedTo.createChild('actuator') actuator.createObject('MechanicalObject', name = 'actuatorState', position = '@'+boxROIactuation.getPathName()+'.pointsInROI', template = 'Vec3d')
together with creating a pointer to the boxROI:
boxROIactuation = liver.createObject('BoxROI' , name= 'boxROIactuation' , orientedBox= newBox([[-5.0, 0.5, -0.5], [-5.0, 0.0, -0.5], [-4.0, 0.0, -0.5]] , [0.0, 0.0, 0.0],translation,rotation,[0, 0, 0.5],scale) + multiply(scale[2],[1.0]).tolist(),drawBoxes=True)
Here we used the function getPathName() which is quite useful to make links.
– 2) Indeed there is a little bug with the way the RestShapeSpringForceField is created. It will be corrected next week. In the meantime you can solve it by hand by going to the “data” folder (inside the folder where your reduction is), and editing the 3 files: reducedFF_liver_2_listActiveNodes.txt, reducedFF_liver_2_RID.txt and reducedFF_liver_2_weight.txt .
reducedFF_liver_2_listActiveNodes.txt should contain just:
0
reducedFF_liver_2_RID.txt should contain just:
1 1
0
reducedFF_liver_2_weight.txt should contain just:
11 1
1
0
0
0
0
0
0
0
0
0Hopefully this should work!
Olivier16 February 2019 at 04:29 #13049WongBlockedHello @olivier-goury,
I just did what you said but it crashed once it just started playing.
The console output:[WARNING] [MatrixLoader] Problem with matrix file D:\SofaPlugins\ModelOrderReduction\tools\sofa_test_scene\liverFine2\data\ reducedFF_liver_2_weight.txt : wrong row number !!!
https://www.dropbox.com/s/wixl52qfjtz4i92/liverFine2.rar?dl=0
Looking forward to your update!
Wong
18 February 2019 at 15:42 #13055olivierBlockedHello @outtt,
OK, there is one zero missing, reducedFF_liver_2_weight.txt should actually contain:
11 1
1
0
0
0
0
0
0
0
0
0
0Hope this works!
19 February 2019 at 04:01 #13064WongBlockedHello @olivier-goury,
Yes, it works.
And then I tried to modify the scrip reduced_test.py. However, the scene would crash or become slow sometimes it was launched. I do not know why.
The issue details are in the video from the attachment:
https://www.dropbox.com/s/x50r699o8jwvubx/liverFine3.rar?dl=0Can you help me?
Wong22 February 2019 at 04:14 #13102WongBlocked27 February 2019 at 17:29 #13127FélixBlockedHello @outtt,
sorry for the delay,
we are currently working on fixing your bug and others…
For the moment we corrected the problem with links you had. So now you can (normally) reduce your scene in one go without completing some files like @olivier-goury explain to you previously.
But for the problem you just shown us in your video, I have currently no clue about where it comes from, also this error only occur on windows.
Anyways thanks for pointing it to us, we will keep you informed when we correct it.
Félix
28 February 2019 at 02:59 #13128WongBlockedHello @felixvanneste,
I am really grateful that you notice me again and tell me what you are working on because I was once afraid that you won’t give me a reply anymore. (o_o)
It does not matter that you have no clue about the issue because at least it still can work after I try a few more times.
Now I will use MOR plugin in my own scene to test if it works. If I have problem, I will inform you on this topic and wait for your reply until you have time to respond.
Thanks
Wong1 March 2019 at 11:14 #13135olivierBlockedHello @outtt,
Just so you know, I have just made a few changes that could hopefully resolve some of your bugs, if you want to try.
Let me know how you get on,
Olivier12 March 2019 at 12:21 #13195WongBlockedHello @olivier-goury,
I have been testing the plugin for about a week. And now I want to report some issues.
1) The crash and slowness situation still exist in v18.12 on Windows. It is quite a headache, and I do not know why either.
2) I know the MOR plugin is mainly applied to soft robot simulation. So I think it is an active plugin to actuate the deformable body to move. But I want to use this plugin in a haptic feedback scene where the deformable body is passive, being collided by an instrument.
So I want to know if this plugin is genuinely feasible to be used in a haptic feedback scene.3) Anyway, I still have a try using Geomagic in my brain scene created by myself. But it is very difficult to configure the fixed ROIs and the actuactors and the parameters to generate a reduced brain model.
My brain model has two parts: the upper part and the lower part. When I use the instrument to push one part, the other part would deform abnormally.
Here is the relevant files and the video link:
https://www.dropbox.com/s/4ohm7d36d2wnamu/b2.rar?dl=0
Can you tell me if my scene is configured correctly? If not, can you help me correct it?Thanks
Wong12 March 2019 at 14:15 #13196olivierBlockedHello @outtt,
– For the reduced model to be giving reasonable results, the snapshot generation phase is very important, because it what the reduced model will be based upon. You can run the debug scene in the debug folder:
runSofa debug_scene.py
andrunSofa debug_scene --argv step2_stateFile.state
to check what shaking was actually made in snapshot generation phase and the reduced Snapshot phase respectively. What kind of shaking did you use? I had a look and I think your shaking is not exhaustive enough for the reduced model to be really accurate. Consider adding mode actuators at various location on your brain.
– For the windows crash, thank you for the update, we will check if we can solve that issue.Olivier
13 March 2019 at 04:47 #13199WongBlockedHello @olivier-goury,
Thank you for your reply.
I use shakingSofia to shake my model. And I used your command to check the shaking and then I found that indeed I had made a wrong configuration of the shaking.
I also saw that if the shakingSofia is used, the actuator would be rotating about axis Z. But sometimes I want it to rotate about axis X. How can I do it?
Thanks
Wong13 March 2019 at 11:55 #13203olivierBlockedHi @outtt,
Feel free to write your own shaking. Have a look at the file “shakingAnimations.py” in the folder python/mor/animation of the plugin. This where the shaking you are using is defined, and you can modify it. It is calling the function “rotationPoint” and I think that is the one you want to update.
Olivier
14 March 2019 at 10:48 #13207WongBlockedHello @olivier-goury,
I think it is not easy to design a satisfying shaking. Because the movement of the soft robots is usually regular, but the one of a deformable body being collided by an instrument is always uncertain. So it is really tricky to think how many actuators and where should I set and what the shaking method can be designed as. And it is a new application differ from the soft robot simulation, I am not sure if it can genuinely work.
And I have tested my scene using shakingSofia for about a day. I notice that if I want to expand the space of shaking, I should increase the rodRadius. But if I increase it to 8(I created two actuators), the FPS of the generated scene would go down to around 80. I do not think it is a great improvement of the performance, compared with the sparse fem scene.
Wong
14 March 2019 at 13:41 #13208olivierBlockedHi @outtt,
What kind of accuracy are you looking for? It depends if your are looking for an accurate description locally in a small neighbourhood around the instrument, or only the global deformation of the brain.
In the first case, indeed it will be challenging to perform a reduction that catches the local deformations while still running at a high frame rate. However, if it is the global deformation of the two parts of the brain touched by the instrument that interest you, I think it should be possible to generate a good reduced model.Maybe consider implementing your own shaking, “shakingSofia” moves the actuator in a circle which may not be the most realistic way to stimulate your brain.
Olivier
14 March 2019 at 16:28 #13209WongBlocked -
AuthorPosts
- You must be logged in to reply to this topic.