Load plugin into Python with opensim 3.2

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Anthony Gatti
Posts: 4
Joined: Tue Jun 07, 2016 2:50 pm

Load plugin into Python with opensim 3.2

Post by Anthony Gatti » Fri May 10, 2019 3:13 pm

Hi all,

Im curious if it is possible and how one would go about loading a plugin into opensim when using the python api in opensim 3.2?

I have tried using the LoadOpenSimLibrary() function from the 3.2 API (see link at end). However, this doesnt seem to exist in my built version of opensim 3.2 - I've looked through the opensim.py file and cant find anything.

Any thoughts or suggestions would be greatly appreciated.

Thanks!

Anthony.

https://simtk.org/api_docs/opensim/api_ ... 4ed662af58

Tags:

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Load plugin into Python with opensim 3.2

Post by Thomas Uchida » Mon May 13, 2019 4:32 pm

Any thoughts or suggestions would be greatly appreciated.
I would try upgrading at least to 3.3.

User avatar
Anthony Gatti
Posts: 4
Joined: Tue Jun 07, 2016 2:50 pm

Re: Load plugin into Python with opensim 3.2

Post by Anthony Gatti » Tue May 14, 2019 8:23 am

Thomas,

Thanks for the prompt reply!
I have 4.0 running and have used that. However, I have purposefully downgraded to 3.2 to allow use of the SynergyOptimization plugin (https://simtk.org/projects/synergy), which is specific to 3.2 release - there are bugs when it is used with 3.3.

I have however found a workaround for loading the libraries that seems to work. See my response to my own question on github at (https://github.com/opensim-org/opensim-core/issues/2445). Essentially, the LoadOpenSimLibrary() was not included properly in the swig interface file. I added a line for that and re-built and this module is now available in the python API and now allows me to load in libraries.

However, I will note that I am getting wonky results from the library (which I dont get on the GUI), so I am unsure if my hack to load the library had unintended consequences... or if I went wrong somewhere while building the plugin (I had to build for linux).

Any thoughts or suggestions would be greatly appreciated.

Anthony.

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Load plugin into Python with opensim 3.2

Post by Thomas Uchida » Tue May 14, 2019 8:42 am

Any thoughts or suggestions would be greatly appreciated.
There are a couple strategies you might consider.
1. Use OpenSim 3.3. You would need to build the SynergyOptimization plugin for 3.3, which might require some upgrading (or you might contact the author to ask whether an upgraded version is available).
2. There are many possible explanations for why the library is not functioning correctly. To investigate, you might try testing a very simple plugin and gradually building up the complexity until an issue is found. If Python wasn't supported, that means the interface wasn't tested so you would need to build up your own suite of tests. I would expect this strategy to take longer than upgrading the plugin.

POST REPLY