Forum Replies Created
-
AuthorPosts
-
ElDiwinyBlocked
Dear Zahra,
I am so sorry for not understanding what you are looking forward to do in your scene. Concerning your question: you dont need to run liver_controller.py as it is already embedded in liver.py scene as follows:
rootNode.createObject('PythonScriptController', classname="controller", filename="liver_controller.py")
So, all you need to do is go to the directory of this folder (https://drive.google.com/drive/folders/1t-4KfJ4Y-c7d8XJlRcdR66Y9YQku4lZJ) where scene and its controller founded and just run the main scene liver.py
runSofa liver.py
Please let me know whether you need any further help.
ElDiwinyBlockedDear Zahra,
Kindly I am attaching the updated files for your scene in the following link: https://drive.google.com/open?id=1t-4KfJ4Y-c7d8XJlRcdR66Y9YQku4lZJ
As far as I understood from your question that you are looking for changing the value the constant force field applied at a specific time frame or by pressing a certain key.
For doing that: in the attached files, there is a separate
liver_controller.py
, where you can add two different approachesdef onKeyPressed(self,c):
or
def onBeginAnimationStep(self,dt):
which I have added in the attached fileimport Sofa import os from time import gmtime, strftime class controller(Sofa.PythonScriptController): def initGraph(self, node): self.rootNode = node self.Liver= node.getChild('Liver') self.Visu_fine= self.Liver.getChild('Visu-fine') self.coarse = self.Liver.getChild('coarse') self.Visu_coarse= self.coarse.getChild('Visu-coarse') self.mainNode = 2; self.notYetDone=True self.totalTime = 0 def onBeginAnimationStep(self,dt): self.totalTime+=dt forces=self.Liver.getObject('constantFF0').findData('forces').value if (self.totalTime<=0.4): forces=[0,-120,0] self.Liver.getObject('constantFF0').findData('forces').value = forces; if ( 0.7 <self.totalTime<0.71): forces=[0,-50,0] self.Liver.getObject('constantFF0').findData('forces').value = forces; return 0
By checking the constant force field, the value of the force is changing, however, I dont fully understand your scene very well.
Can you check this first and let me know.
Best,
MarwaElDiwinyBlockedHi Fatemeh,
First of all, you have to build SOFA, once it has been built correctly, you will have the binaries folder in build directory.
I have never tried SOFA on windows platform, but if you have the virtual version of SOFA running on windows, you can directly run SOFA from binary folder.
If you still stuck, I would try to help as much as I can, I can do google hangout to illustrate if you want, here is mine: marwaeldiwiny1991@gmail.com
ElDiwinyBlockedHi Zahra,
Can you attach this file /home/zahra/sofa/Work/testbygmsh/livertetra7509.msh
ElDiwinyBlockedHi Fatima,
I was trying to looking for your previous answers, it seems you use SOFA on windows version, I dont have any prior experience with in windowns, I have only tested it on linux system. From your question ” I understand that for adding the soft robot plugin, I should build the SOFA. That’s right?”
For running the softrobots plugin, you must have a working version of SOFA, so you have to build it first and then adding the plugin in cmake by typing
EXT
, theSOFA EXTERNAL DIRECTORY
should appears and then adding the location of the plugin and then build it.I would really like to help, please let me know whether it makes sense.
ElDiwinyBlockedHi Fatima,
Have you solved the problem? I will be try my best to make it work.
ElDiwinyBlockedPlease could you please share what are the steps that you have did, and are you using linux? I can review with you step by step.
ElDiwinyBlocked@Fatima, I think first you have to follow Hugo’s comments. The other approach is different, but I have used it.
ElDiwinyBlockedHi Fatima,
In the separate folder plugins add create a new CMakeLists.txt inside it and add the following
find_package(SofaFramework) sofa_add_plugin(SoftRobots SoftRobots)
I would like to know whether you are using linux system? Did you compile sofa correctly, in that case I recommend you to add the unstable version of sofa https://github.com/SofaDefrost/sofa/tree/Documentation
Please try and let me know
ElDiwinyBlockedHi Fatima,
I would suggest to make a separate folder “plugin” outside src,
In CMAKE-GUI, you can type in search “EXT” and then click on SOFA EXTERNAL DIRECTORIES to add the path of separate plugin folder as shown in the figure below
then the plugin after configuration is listed
Please let me know whether this works with you.
ElDiwinyBlocked.
ElDiwinyBlockedHi Rishabh,
Sorry for my late reply! I understand you question, it is related to RigidMapping probably, however, I cannot guarantee that I can solve, but I will try to do my best, would be able to share the scene script.
ElDiwinyBlockedHi Fei,
Sorry for the late reply! I have checked the CGAL plugin on the same sofa version that you have already tested and it works fine. I do think that there is no required version if you check the softrobots deforst page
I do think that the problem is after you build sofa and try to add CGAL plugin, it will give you bunch of errors and this because the build folder and its dependencies are locked so just type that in the terminal in the path of sofa
chmod 777 build -R
Then run the double configurations in cmake-gui and generate, it will be added.
Please try this and let me know whether do you still have the same problem.
ElDiwinyBlockedHi Rishabh,
Sorry for the late reply! Could you please check these files that I have uploaded and see whether this could answer your question. If that doesnot answer your question, I will try to help you as much as I can.
https://drive.google.com/open?id=1WlAn9ya-8dRUoXfxK1JliaOCrCJ-1ocs
https://drive.google.com/open?id=15Wc9sN-hu7C58Rfb5EHoNgF2UG0m4pPXElDiwinyBlockedHi Rishabh,
I didnot get what you are looking for exactly, could you please elaborate more with more details?.
ElDiwinyBlockedHi lnnx2006,
I agree with you, I face the same problems, did you install stable or non stable version?
In the mean time, please follows these steps:Create folder “sofa”, in this folder create two folders
The first one :”src”
The second one: “build”In the “src”, download this version “https://github.com/SofaDefrost/sofa.git”
then run cmake-gui, double click on configure, and then generateCheck this first, and see whether there is still errors
After that go to the build directory and run “ninja” command.
Please let me know whether you still has the same errors, I would do my best to help.
Best,
Marwa15 September 2018 at 18:47 in reply to: SIG 11 – SIGSEGV: segfault Segmentation fault (core dumped) #11949ElDiwinyBlockedHi Zahra,
Kindly I have sent you an invitation. I will do my best as much as I can.
Best,
Marwa14 September 2018 at 02:18 in reply to: [SOLVED] How can I get the local frames in TetrahedralCorotationalFEMForceField? #11943ElDiwinyBlockedHi Wong,
I saw the paper, but I am not sure whether I understand your question very well, I dont have so much experience, but you are looking for the local frames, for instance in the two attached figures below shows the this a simulation of the three layered beams and a point mapped to it. Could you please elaborate more whether these local frames you want to display them, or you want to know their location. I will do my best to help as much as I can.
13 September 2018 at 16:58 in reply to: SIG 11 – SIGSEGV: segfault Segmentation fault (core dumped) #11938ElDiwinyBlockedHi Zahra,
You are so welcome, I will try to do my best, I will do a video about installation SOFA, and if doesnot help you, we can possibly do it on Saturday.
13 September 2018 at 15:01 in reply to: SIG 11 – SIGSEGV: segfault Segmentation fault (core dumped) #11935ElDiwinyBlockedHi Zahra,
I would be happy to try help you, I have faced many problems like that before, I can help you step by step. My skype ID is marwaeldiwiny1991.
ElDiwinyBlockedHi SUHAS,
Could you please upload the scene here, so that I can test it.
In the mean time, could you please make sure that you have added the soft plugin properly. Kindly I am going to mention the steps and make sure you have done it as following:
1- First you have to download the git SOFA version https://github.com/SofaDefrost/sofa not the stable version
2- Secondly you can add soft robots plugin ( external directory) and make sure that you have added to CMAKELIST.
3- Make sure that you have added soft robot plugin to your scene via edit plugin manager so that you can run it.
Looking forward for your reply!.
Best,
MarwaElDiwinyBlockedHi Hugo,
So sorry for my late reply!. Perfect, finally it works.
Thank,
MarwaElDiwinyBlockedHi Hugo,
I am sorry for late update, really thanks so much for your help and support. Kindly here is the file in this sharable link https://drive.google.com/open?id=1mSSSYxjnsyQDO6-ZEihCA5KLNIZL5aB0.
Thanks,
Marwa
ElDiwinyBlockedHi Hugo,
I am still stumbling how I can add the bbox=”0 0 0 1 1 1″ in the rootnode, could you please elaborate more in a written example?
Thanks!
-
AuthorPosts