Hello,
I'm working on a project where I try to customize a Component in order to add state variables to compute a spindle behaviour.
I'm working with Opensim 4.2 in a Python 3.7 environment.
My issue is that I can't find the corresponding python method to AddStateVariable found in the C++ Opensim API here :
https://simtk.org/api_docs/opensim/api_ ... 35d22014da
I checked the .py files in the sdk and printed the content of the Opensim modules thanks to the help("nameofthemodule") method but I still can't find the existence of the addStateVariable() method.
Does anyone know how to use this method in a Python environment ?
Thanks for your help,
Louis
AddStateVariable() method Python API
- louis labadie
- Posts: 5
- Joined: Wed Feb 03, 2021 5:21 am
- louis labadie
- Posts: 5
- Joined: Wed Feb 03, 2021 5:21 am
Re: AddStateVariable() method Python API
Hi again,
Sorry to bother people on the forum with that but I could really need some help on this point.
I tried calling the addStateVariable method through opensim.common.Component.Add... path but I get the following error message " type object 'Component' has no attribute 'addStateVariable'".
Thanks by advance,
Louis
Sorry to bother people on the forum with that but I could really need some help on this point.
I tried calling the addStateVariable method through opensim.common.Component.Add... path but I get the following error message " type object 'Component' has no attribute 'addStateVariable'".
Thanks by advance,
Louis
- Thomas Uchida
- Posts: 1792
- Joined: Wed May 16, 2012 11:40 am
Re: AddStateVariable() method Python API
As far as I know, the API does not support adding state variables from Python. Customizing a Component is typically done by building a plugin. Resources for building/using plugins can be found in the documentation:
- "Creating Plugins", https://simtk-confluence.stanford.edu/d ... ng+Plugins
- "Using Plugins", https://simtk-confluence.stanford.edu/d ... ng+Plugins
There are also a few examples in the "Resources" directory (e.g., C:\OpenSim4.0\Resources\Code\CPP\Plugins).
- "Creating Plugins", https://simtk-confluence.stanford.edu/d ... ng+Plugins
- "Using Plugins", https://simtk-confluence.stanford.edu/d ... ng+Plugins
There are also a few examples in the "Resources" directory (e.g., C:\OpenSim4.0\Resources\Code\CPP\Plugins).
- louis labadie
- Posts: 5
- Joined: Wed Feb 03, 2021 5:21 am
Re: AddStateVariable() method Python API
Thank you for the clarification !