Home › Forum › SoftRobots › Using SoftRobots › Issues with running examples on SOFA_v20.12.02_Defrost_Linux
Tagged: Linux, SOFA, softrobots
- This topic has 8 replies, 3 voices, and was last updated 3 years, 5 months ago by jnbrunet.
-
AuthorPosts
-
21 May 2021 at 13:00 #19528mohshawBlocked
Dear all,
I have used an old version of SOFA to run SoftRobots library. Nothing works with the provided examples; I open a previous topic in this forum in order to fix the issues but nothing works. I tried my best.
Now, I have downloaded the ‘SOFA_v20.12.02_Defrost_Linux’ as it has all the needed plugins I need to avoid the issues I experienced before, also because this versions is already compiled.
I’m a new used to Linux and I think the binary version of SOFA will be easier to deal with.
Now, with the new binary version I still have issues to open the provided examples in order to run and study them so that I can create my examples later.
Each example I run here shows different error! I tried to read the error message and follow the instructions or try to fix it but still without progress.
The installed Python is 3.7.10.
Currently, I’m trying to run the CableGripper example, the finger.py file and this error appears:
[ERROR] [SofaPython3::SceneLoader] ModuleNotFoundError: No module named 'stlib3' At: finger.py(3): <module> <frozen importlib._bootstrap>(219): _call_with_frames_removed <frozen importlib._bootstrap_external>(728): exec_module <frozen importlib._bootstrap>(677): _load_unlocked <frozen importlib._bootstrap>(696): _load /usr/lib/python3.7/imp.py(171): load_source /usr/lib/python3.7/imp.py(234): load_module <string>(3): <module> [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias] [INFO] [SceneCheckerVisitor] Finished validating node "root". [WARNING] [RealGUI] Global Bounding Box seems very small; Your viewer settings (based on the bbox) are likely invalid, switching to default value of [-1,-1,-1,1,1,1].This is caused by using component which does not implement properly the updateBBox function.You can remove this warning by manually forcing a value in the parameter bbox="minX minY minZ maxX maxY maxZ" in your root node
All the STLIB, SofaPython3, and SoftRobots plugins are imported.
Kindly advise.
Best regards.21 May 2021 at 13:33 #19529Pasquale94BlockedHello @mohshaw ,
I use the binary codes of Sofa with Python3.7 as well.
to make the plugin SofaPython3 work in ubuntu, for the bynary code sofa version i wrote these two lines in the terminal:
export PYTHONPATH=/home/pasquale/SOFA_v20.12.02_Linux/plugins/SofaPython3/lib/python3/site-packages/
then :
export SOFA_ROOT=/home/pasquale/SOFA_v20.12.02_Linux/
then relaunch again sofa with this:
./runSofa -l /home/pasquale/SOFA_v20.12.02_Linux/plugins/SofaPython3/lib/libSofaPython3.so
Let me know if then you can open the python examples without issues.
22 May 2021 at 08:13 #19531mohshawBlockedHello @Pasquale94
Thank you for the update.
I have used the provided procedure, the same error appears.
I’m trying to open this example:
/home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux/plugins/SoftRobots/docs/tutorials/CableGripper/details/sofapython3/finger.pyUnfortunately, trying other examples shows different errors, I think that the issue is general and related to enabling the plugins correctly. But, all the needed plugins are already imported and existed in the Plugin Manager.
BR,
23 May 2021 at 15:57 #19535mohshawBlockedHello @jnbrunet,
I have added the STLIB, SofaPython3, and SoftRobots from the plugin manager. But, the SoftRobots examples do not open, as follows:
(Note that all following files are located in sofaPython3 folders from each example directory).1. cablegripper.py3scn (Cablegripper example) and step1.py3scn (FirstSteps example) show this error:
[ERROR] [SofaPython3::SceneLoader] ModuleNotFoundError: No module named 'stlib3'
2. step1-meshLoading.py3scn (PneunetGripper example) shows this error:
[ERROR] [SofaPython3::SceneLoader] RuntimeError: Unable to resize vector to match list size. Is the data type resizable ? At: step1-meshLoading.py3scn(8): createScene
3. actuatedarm.py (Tripod example) shows this error:
[ERROR] [SofaPython3::SceneLoader] ModuleNotFoundError: No module named 'splib3'
These errors are repeated for other python files also.
Kindly advise.
Best regards.
25 May 2021 at 10:18 #19540jnbrunetModeratorHi @mohshaw,
It looks like the python interpreter embedded inside the SofaPython3 plugin isn’t able to find the
stlib3
python module. Can you try execute the following and give me the output (make sure the first command has a valid path to your SOFA installation):$ export SOFA_ROOT=/home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux $ [ -f $SOFA_ROOT/bin/runSofa ] && echo "Path is good" || echo "Path is not good" $ export PYTHONPATH="$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages:$SOFA_ROOT" $ which python3.7 $ export PYTHONPATH="$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages:$SOFA_ROOT/plugins/SoftRobots/lib/python3/site-packages:$SOFA_ROOT/plugins/STLIB/lib/python3/site-packages:$PYTHONPATH" $ python3.7 -c "import sys; print('\n'.join(sys.path))" $ python3.7 -c "import SofaRuntime;print(SofaRuntime);import softrobots;print(softrobots);import stlib3;print(stlib3)"
25 May 2021 at 13:31 #19546mohshawBlockedHello @jnbrunet,
Thank you for the update.
After running the suggested procedure the error still there.This is the output:
~$ export SOFA_ROOT=/home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux ~$ [ -f $SOFA_ROOT/bin/runSofa ] && echo "Path is good" || echo "Path is not good" Path is good ~$ export PYTHONPATH="$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages:$SOFA_ROOT" ~$ which python3.7 /usr/bin/python3.7 ~$ export PYTHONPATH="$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages:$SOFA_ROOT/plugins/SoftRobots/lib/python3/site-packages:$SOFA_ROOT/plugins/STLIB/lib/python3/site-packages:$PYTHONPATH" ~$ python3.7 -c "import sys; print('\n'.join(sys.path))" /home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux/plugins/SofaPython3/lib/python3/site-packages /home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux/plugins/SoftRobots/lib/python3/site-packages /home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux/plugins/STLIB/lib/python3/site-packages /home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux /usr/lib/python37.zip /usr/lib/python3.7 /usr/lib/python3.7/lib-dynload /home/mohshaw/.local/lib/python3.7/site-packages /usr/local/lib/python3.7/dist-packages /usr/lib/python3/dist-packages ~$ python3.7 -c "import SofaRuntime;print(SofaRuntime);import softrobots;print(softrobots);import stlib3;print(stlib3)" <module 'SofaRuntime' from '/home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux/plugins/SofaPython3/lib/python3/site-packages/SofaRuntime/__init__.py'> <module 'softrobots' from '/home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux/plugins/SoftRobots/lib/python3/site-packages/softrobots/__init__.py'> <module 'stlib3' from '/home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux/plugins/STLIB/lib/python3/site-packages/stlib3/__init__.py'>
BR,
25 May 2021 at 21:01 #19574jnbrunetModeratorHi @mohshaw,
It looks like python is able to find stlib3 from what you showed me (the last line of the output).
Make sure you export the following just before starting runSofa (in the same terminal) :
$ export SOFA_ROOT=/home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux $ export PYTHONPATH="$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages:$SOFA_ROOT/plugins/SoftRobots/lib/python3/site-packages:$SOFA_ROOT/plugins/STLIB/lib/python3/site-packages:$PYTHONPATH" $ $SOFA_ROOT/bin/runSofa -l SofaPython3
27 May 2021 at 09:29 #19583mohshawBlockedHello @jnbrunet,
I have exported the previous lines, now the error is a bit different, it looks like SOFA can access stlib3 now, but not importing what is required from the stlib3. Opening the cablegripper.py3scn shows the following error:
[ERROR] [SofaPython3::SceneLoader] ImportError: cannot import name 'Floor' from 'stlib3.physics.rigid' (/home/mohshaw/Downloads/SOFA_v20.12.02_Defrost_Linux/SOFA_v20.12.00_Linux/plugins/STLIB/lib/python3/site-packages/stlib3/physics/rigid/__init__.py) At: cablegripper.py3scn(3): <module> <frozen importlib._bootstrap>(219): _call_with_frames_removed <frozen importlib._bootstrap_external>(728): exec_module <frozen importlib._bootstrap>(677): _load_unlocked <frozen importlib._bootstrap>(696): _load /usr/lib/python3.7/imp.py(171): load_source /usr/lib/python3.7/imp.py(234): load_module <string>(3): <module>
Similar errors are repeated while opening the other steps of the example CableGripper, where each step shows different missing name:
steps 0 and 6 show:ImportError: cannot import name 'Floor' from 'stlib3.physics.rigid'
step 1 shows:ImportError: cannot import name 'ShowGrid' from 'stlib3.visuals'
steps 2 and 5 show:ImportError: cannot import name 'Node' from 'stlib3.scene'
steps 3 and 4 show:ModuleNotFoundError: No module named 'fixedbox'
BR,
28 May 2021 at 20:27 #19591jnbrunetModeratorWell, everything on the SofaPython3 plugin seems fine. My guest would be that the SoftRobot plugin from the Defrost team hasn’t been completely migrated from SofaPython(2) to SofaPython3.
Maybe @hugo have more insight from the Defrost team on this migration state? I guess this will be a topic in the STC#11 next week.
-
AuthorPosts
- You must be logged in to reply to this topic.