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
Load plugin into Python with opensim 3.2
- Anthony Gatti
- Posts: 4
- Joined: Tue Jun 07, 2016 2:50 pm
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: Load plugin into Python with opensim 3.2
I would try upgrading at least to 3.3.Any thoughts or suggestions would be greatly appreciated.
- Anthony Gatti
- Posts: 4
- Joined: Tue Jun 07, 2016 2:50 pm
Re: Load plugin into Python with opensim 3.2
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.
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.
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: Load plugin into Python with opensim 3.2
There are a couple strategies you might consider.Any thoughts or suggestions would be greatly appreciated.
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.