Home › Forum › SOFA › Building SOFA › [SOLVED] Using SoftRobots + SofaPython3
Tagged: 64_bits, GCC, Linux_ubuntu, Plugin_SoftRobots, SOFA_2006
- This topic has 9 replies, 5 voices, and was last updated 4 years, 5 months ago by Hugo.
-
AuthorPosts
-
15 July 2020 at 19:19 #16881jlorenzeBlocked
Hello,
I am trying to get SOFA set up to use the SoftRobots plugin as well as the SofaPython3 plugin, and am having some issues. I was hoping someone could clear up the confusion.
To start, I am using the master branch of Sofa and am up to date on the SofaPython3, SoftRobots, and STLIB plugins.
Here is what I have tried so far:
1. Building Sofa with PLUGIN_SOFAPYTHON enabled, adding the paths of the plugins to SOFA_EXTERNAL_DIRECTORIES, and enabling SOFA_BUILD_METIS. Following all standard instructions for Sofa on the website. This works, but of course is not using SofaPython3 plugin.
2. Try to do out-of-tree build of SofaPython3, following instructions from this thread: https://github.com/SofaDefrost/plugin.SofaPython3/issues/137#issuecomment-571128647. In particular after building Sofa with make I did “make install”, then for building SofaPython3 I set the CMAKE_PREFIX_PATH=/home/jlorenze/sofa/build/install. I was able to build SofaPython3, and then did the linking procedure described in the thread.
ln -sFfv $(find $SP3_BLD/lib/site-packages -maxdepth 1 -mindepth 1 -not -name “*.py”) $(python3 -m site –user-site)
However, when I try to then test via ./$SOFA_BLD/bin/runSofa -l $SP3_BLD/lib/libSofaPython3.so it fails. Presumably this is because I have enabled the plugin SofaPython when I built Sofa?
So what I was wondering was what the proper procedure for getting SoftRobots and SofaPython3 setup together is. The dilemma seems to be that SofaPython can’t be enabled to use SofaPython3, but SofaPython also seems to need to be enabled to install SoftRobots because it requires STLIB, which requires SofaPython.
Is there some workaround?
I can definitely provide any additional information or particular errors, but am not too sure which would be useful at the moment. Thanks for your help!
16 July 2020 at 11:04 #16883jnbrunetModeratorHey @jlorenze,
Unfortunately, SofaPython(2) is indeed incompatible with SofaPython3 as it would be a lot of work to make sure there isn’t mix-ups between the two when they are both loaded in memory, and I’m not even sure python’s libraries allow it.
For the migration SoftRobot and STLIB to SofaPython3, maybe @damien-marchaluniv-lille1-fr or @bmarques would have an idea of the current progression state.
Converting a scene from SofaPython(2) to SofaPython3 doesn’t look too difficult. You can have a look at this PR for an example.
Small note: The SofaPython3 repository from SofaDefrost Github has been deprecated as its development is now part of SOFA consortium, make sure you are using the new repository here.
J-N
16 July 2020 at 19:32 #16891jlorenzeBlockedHey @jnbrunet thanks for the quick response!
Sorry for the confusion! I don’t care about running SofaPython(2) alongside SofaPython3. All I want to do is run SofaPython3 with SoftRobots. The trouble is that I don’t know how to get this set up since STLIB requires SofaPython to build? Is there a way to install STLIB and SoftRobots without enabling SofaPython(2)?
17 July 2020 at 09:40 #16894jnbrunetModeratorYeah I completely understand your issue. Like I said, I have no clue on where the migration towards SofaPython3 of STLIB and SofaRobots stands right now. I am sure the devs are eager to do the swap to SP3, but they might be running low on available time.
We will have to wait for @damien-marchaluniv-lille1-fr or @bmarques or someone in the Defrost team to give us some feedback.
17 July 2020 at 18:06 #16898jlorenzeBlockedOkay great thank you for the information! I’ll stay tuned for more info from the Defrost team.
18 July 2020 at 08:44 #16899sescaidaBlockedHello @jlorenze,
I’m sorry that you have this issue, which can be a little bit frustrating!
Since STLIB is all SofaPython(2), it is not compatible with SofaPython3, as stated before. However, it is actually _not_ strictly necessary to have STLIB to compile SoftRobots. I think that during Cmake configuration it will give you a strong warning, but not necessarily fail. Otherwise, there is a flag in SoftRobots that is called “SOFTROBOTS_IGNORE_ERRORS”, which you can set and see if that circumvents the problem. In other words, remove the STLIB plugin from the configuration to resolve any errors generated due to its dependency on Python 2 and try again.
Overall, if you manage to compile, you should be able to adapt the simple examples in SoftRobots to work with SofaPython3. Hopefully, from there you can do your own scenes. We are currently making some porting efforts, but are lagging behind.
I hope this helps!
Best
Stefan
20 July 2020 at 10:15 #16904Damien MarchalBlockedHi all,
We really need to upgrade SoftRobot so it use SofaPython3…any volunteer ?
DM 🙂
20 July 2020 at 21:32 #16910jlorenzeBlockedThank you for the help, using SOFTROBOTS_IGNORE_ERRORS seems to have done the trick!
21 July 2020 at 21:15 #16929sescaidaBlocked21 July 2020 at 21:41 #16930 -
AuthorPosts
- You must be logged in to reply to this topic.