5 November 2018 at 10 h 04 min #12336
I notice that the fps would decrease dramatically if the deformable meshes are complex in Sofa, not like other foreign simulators perform. So I try to find and use SofaCUDA in Sofa. But after I have successfully compiled the SofaCUDA plugin, I found that there are many bugs within it.
The default scenes are quite simple and many components already in Sofa cannot be used in SofaCUDA, such as ConstantForceField (could not be created in the SofaCUDA scene) and it is easy to crash and there is no default scene about haptic control and feedback. So I do not think it would be a feasible way to be used in stable interactive scene.
My graphics card is GTX 1050 Ti and CUDA version is 8.0.
Could any one give some hints and help about it?15 November 2018 at 10 h 15 min #12481HugoKeymaster
- SOFA Consortium
Using very irregular or bad-quality meshes results in bad-conditioned system matrix, which makes the convergence of any linear solver complicated. Moreover, if the number of nodes/elements increases significantly, the size of the system increases in a quadratic form, which obviously will impact the performances. These two remarks are generic, thus valid for any physics engine.
CUDA is a way to accelerate computation. However, writing efficient code using the CUDA toolkit is very complicated. It is therefore worth implementing CUDA version only for complex (computationally demanding) algorithm. ConstantForceField is simple and indeed not implemented. We would be glad to welcome your contribution in the core of SOFA!
Finally, to speed up simulation, a recent plugin on Model Order Reduction has been made open-source. It may be worth it to consider.
Never forget, SOFA is open-source, therefore not perfect. But any contribution in any way is always welcome.
Hugo16 November 2018 at 16 h 03 min #12497
Thank you @hugo,
After a lot of testing, the performance can be indeed improved if I simplify the mesh of the model. I will try my utmost to make my scene simple afterwards.
Thank you for your theoretical and detailed reply again.18 December 2018 at 7 h 20 min #12613
I tried to build ModelOrderReduction, but failed.
I got errors like
1>HyperReducedHexahedronFEMForceField.obj : error LNK2019: unresolved external symbol “__declspec(dllimport)
So how to solve this kind of problem?18 December 2018 at 11 h 55 min #12617HugoKeymaster
- SOFA Consortium
Thanks for the feedback @outtt
This plugin is a plugin developed by a research team. They are not providing support on this. However, I will catch them up and ask for information.
Let us know whether you solved your issue.
What is your exact configuration (OS, version, version of SOFA etc)
Hugo18 December 2018 at 15 h 18 min #12619
Well, I have not solved this issue.
I tried this plugin in both Sofa 17.06 and 17.12 on Win10 64bit. The plugin requires some classes missed in the current stable Sofa revision, obviously, both 17.06 and 17.12 included.
So I search the missing classes on GitHub and add them into my Sofa. And also check the option SOFA_WITH_EXPERIMENTAL_FEATURES at CMake.
But when I compile the plugin, errors like error LNK2019: unresolved external symbol still occurs after all. So I think it is likely that the plugin is not updated to fit the current revision of Sofa.
Can you help me?19 December 2018 at 12 h 05 min #12622
The plugin is normally up to date with Sofa but here you are using the version 17.06 & 17.12 of Sofa and we are now at version 18.06.
Is there a special reason for you to use these previous versions ?
Félix20 December 2018 at 3 h 32 min #12630
The reason why I do not use the version 18.06 is that the Geomagic plugin works abnormally at that version.
When I run the offcial example Geomagic-RigidSkull.scn, the instrument would penetrate into the skull with little force feedback, which, however, can behave normally at 17.12.
Even so, I do not think the ModelOrderReduction plugin can be compiled successfully at 18.06 because there is no significant difference between 18.06 and 17.12. The missing class MechanicalMatrixMapper can still not be found in 18.06.20 December 2018 at 15 h 03 min #12672
Yes you are right for the Geomagic plugin there is an issue for this that has been fixed recently.
Concerning MOR you are right also, the necessary modification in sofa to make this plugin work isn’t included in the current last version 18.06.
Sorry for the false informations.
So currently for you in order to have a working MOR & Geomagic plugin you need to build it yourself from source as explained here:
Or if you can, wait till the next release that will include all the necessary adjustment
and will be public around mid-January normally.
I hope this help you,
Félix24 January 2019 at 15 h 15 min #12879
Now I use version 18.12 to compile the MOR plugin and, however, the similar problems described from my previous post still arise.
But I tried to solve the compile errors by modifying the source code and finally I succeeded, albeit through tremendous efforts.
However, it seems that there is no standalone scn example for the MOR plugin and it should be used with the soft robot plugin. So I even downloaded the soft robot plugin later and then compiled it to see if it would work. But unfortunately, it crashed once I launched the reducedMultiGait-softRobot.pyscn.
So can you give me some guidance about it?
Wong28 January 2019 at 15 h 45 min #12917
sorry for all the trouble compiling on windows,
we never really test it on this OS…
There is some standalone scn for this plugin but I didn’t write it anywhere explicitly.
Its in doc/examples/SOFIA.
Anyways can you give me your error ? I would be glad to help you resolve it.
Félix29 January 2019 at 5 h 12 min #12920
I tried to launch the DemoSofia.py but failed because the component OglSceneFrame has been removed from Sofa since v18.12.
So I commented out the line
#node.createObject('OglSceneFrame', style="Arrows", alignment="TopRight")
at mainheader.py in Plugin STLIB and then launched the DemoSofia.py again.
But it still did not run normally because the component SparseLDLSolver always output the message “Failed to factorize, D(k,k) is zero”30 January 2019 at 5 h 17 min #1295630 January 2019 at 10 h 34 min #12959
concernig OglSceneFrame component (and others), it was wrongly removed in the last binaries and is being put back maybe for this current week…
I am interested to know what finally was the error with the SparseLDLSolver and if it was concerning our plugin.
Also don’t hesitate to make some pull/issue request to ModelOrderReduction if you find some errors, thanks in advance for that.
Again if you need help or explanations to use MOR, don’t hesitate to ask or search within the documentation that I hope is helpful.
Félix2 February 2019 at 7 h 57 min #12978
I want to generate the data and the python scene of hexaBeam.pyscn.
So how can I specify the parameters at modelOrderReduction.py to generate it?
Wong6 February 2019 at 11 h 09 min #13003
sorry for the delay…
The hexaBeam example was made by @olivier-goury, here are the arguments:
actuator = ObjToAnimate(“M1/cableNode”, incr=1,incrPeriod=5,rangeOfAction=5)
listObjToAnimate = [actuator]
addRigidBodyModes = [0,0,0]
We recently corrected the compilation issue of ModelOrderReduction plugin on Windows. The problem was two-fold : so PR have been made in MOR & SOFA to correct it, so for the moment the fix isn’t in any binaries. Sorry that you have to debug it yourself.
I will test today to run the different examples and tell you if everything work fine to avoid you some trouble.
Félix6 February 2019 at 11 h 51 min #13004
Thank you for your reply.
I want to know why these values of the parameters are the best ones. Can you give some hints to me that how I can choose the proper parameters?
And I want to report an issue on Windows: the directory separator on Windows, ‘\’, is different from that on Linux, ‘/’. So it would cause errors if reduceModel.py is directly used.
Wong7 February 2019 at 11 h 24 min #13014
there is a little tutorial here about that but basically:
– nodesToReduce : path to the node we want to reduce in our scene
– listObjToAnimate : here we want specify with which components we will shake our model to do the reduction and with which parameters.
– ObjToAnimate : with ObjToAnimate we can specify an animation, here we want to pull with a CableConstraint with an increment of 1 each 5 steps until 5 -> (“M1/cableNode”, incr=1,incrPeriod=5,rangeOfAction=5)
Giving him only the path to a node (here M1/cableNode) it will search in it an actuator to control (here CableConstraint).
– addRigidBodyModes : finally this argument indicate if our reduced model will be fixed ([0,0,0] -> without any translation) or if it will be able to translate and along which axes.
For the windows path I just made some fixes to (normally) correct that for the script modelOrderReduction.py… But I find there are some issues with the sofa-launcher when I launch the reduction examples (diamondRobot.py) that I will try to correct for the end of this week with also fixes to the GUI part.
Sorry for all the trouble but you are our first windows user.
Hopes this helps !
Félix8 February 2019 at 14 h 43 min #13016
I just finish to test & fix the different problems, so now it works both for the script and the GUI normally, at least for the diamondRobot & hexaBeam examples which I have tested but the quadruped_snapshotGeneration.py doesn’t seems to work and I don’t know (yet) why…
You can now try it out again if you want.
Just a precision for the hexaBeam example its :
Félix12 February 2019 at 8 h 45 min #13027
I just tried your new updated MOR and it still has some compile issues on my platform.
should be respectively added in HyperReducedTetrahedralCorotationalFEMForceField.cpp and HyperReducedTetrahedronHyperelasticityFEMForceField.cpp.
It is the solution.
And I want to ask two questions.
1) How can I add FreeMotionAnimationLoop into the liverFine.pyscn?
I tried to add FreeMotionAnimationLoop and GenericConstraintSolver and GenericConstraintCorrection into the scene, and then directly launched the modelOrderReduction.py.
But the generated reduced_test.py did not work properly. So what is the problem?
2) Can the reduced model be used for force feedback interaction, for instance, in a Geomagic scene? If it can, could you give me an example?
Wong12 February 2019 at 17 h 19 min #13028
Hello Wong @outtt,
First of all, well done if you solved some compile issues and got the plugin to compile for your computer.
About your two questions:
1) Could you give us your modified version of liverFine.pyscn? In principle, there is no reason why this should not function.
2) About using the MOR plugin in a scene with haptic feedback.
To be honest, we have not tried yet, but it should be working as it stands. An optimised version of the haptic loop when used with an FEM model reduced with the plugin could be implemented in the future however.
Let us know!
Olivier13 February 2019 at 3 h 11 min #13029
I have shared the scene file. You can use it to have a test.
Wong14 February 2019 at 17 h 19 min #13040
The reduced scene generated will not contain what you added in your rootnode (FreeMotionAnimationLoop, GenericConstraintSolver), but can just edit the reduced scene generated and add it.
Please try it and see if it works on your computer.
Olivier15 February 2019 at 3 h 46 min #13041
I tried to modify the scene:
But it seemed that the HyperReducedRestShapeSpringsForceField reducedFF_liver_2 could not fix.
Was it normal?
Wong15 February 2019 at 10 h 32 min #13044
Yes that is normal because the reduced scene does not include the node “actuator”, with the mechanical object “actuatorState” by default (you removed the “external_rest_shape” link in “HyperReducedRestShapeSpringsForceField” ?). If you want to keep it in the reduced scene you also need to add it:
actuator = rootNode.createChild('actuator') actuator.createObject('MechanicalObject', name = 'actuatorState', position = '@'+boxActuation.getPathName()+".pointsInROI", template = 'Vec3d')
- You must be logged in to reply to this topic.