Home › Forum › SOFA › Programming with SOFA › SOFA in C++ and Code Optimization Tips
Tagged: 64_bits, Linux_ubuntu, SOFA_1806
- This topic has 3 replies, 3 voices, and was last updated 5 years, 11 months ago by Damien Marchal.
-
AuthorPosts
-
2 November 2018 at 17:54 #12325ThassyoBlocked
Hi everyone,
I am currently trying to use SOFA with an external library built in C++ for evolving Artificial Neural Networks. The best solution so far seems to be implementing the SOFA simulation in C++ for flexible integration. I have used Bullet Physics in the past with same approach, and I would like to get similar results with SOFA as my simulation environment this time.
A few notes first:
– I am already familiar with the XML scenes and Python scenes files for the runSofa binary
– I also know about the PythonScriptController for modifying/accessing simulation data from .pyscn files during animation
– I have studied most of the C++ examples at application/tutorials folder
– I am using cmake to compile and link my SOFA/ANN cpp filesThe problem is that many SOFA examples that I am interested in (including plugin-based ones) are not provided in C++, so I have been spending some time doing reverse engineering from Python wrapped code to C++.
Questions:
1) What are other available resources that I can use to help with my C++ implementation?
2) Also, I have been using the SOFA base modules in my C++ code. Should I switch to using the SimpleAPI library or SceneCreator plugin instead for code optimization (shortening code length as well)?22 November 2018 at 19:26 #12519HugoKeymasterHi @thassyo
1) Resources for SOFA :
– follow the online documentation
– watch our first Tutorials on YouTube
– start using SOFA, running the examples/Tutorials
– read a reference paper about SOFA
– browse the SOFA API2) SOFA base modules in my C++ code is fine for your purposes at my best knowledge
best wishes
Hugo
19 December 2018 at 23:45 #12629Damien MarchalBlockedHi Thassyo,
It is great to see how deep you already have learned about Sofa.
On my side I rarely use Sofa directly using the c++ interface but I appreciate a lot the SimpleApi to create scenes in c++.
SceneCreator is now deprecated, it is just there of backward compatibility (and it actually implemented on top of the SimpleApi).
The design rational behind the SimpleApi was to make it looking more like the python API. In case you would like to see more function in SimpleApi, don’t hesitate to pass by the github because this is where the software development happens.
https://github.com/sofa-framework/sofaIn case you have specific question on that, feel free to ask.
Regards,
16 January 2019 at 14:20 #12792Damien MarchalBlockedHi @Thassyo,
Did you made any progress on that topic because I have here someone that is starting to work on NN & Sofa and may be interested with what you experienced.
Regards,
Damien -
AuthorPosts
- You must be logged in to reply to this topic.