Hi all,
I am trying to create my own controller. How can I script with Matlab a new class inherited from the OpenSim Controller class as shown in the developer's guide (https://simtk-confluence.stanford.edu/d ... r+Part+One) ?
Any advice or example code would be of great help!
Thanks
Marina
New Matlab controller
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: New Matlab controller
It is not currently possible to create new components in Matlab. If you want to create a custom controller class, you must do this in C++.
- Marina Guihard
- Posts: 5
- Joined: Tue Jul 18, 2017 3:32 am
Re: New Matlab controller
Thank you for your reply.
Is it then possible to add a custom controller class built in C++ into the opensim Matlab library ? Do you have any advice on how to do that?
Thanks again for your help
Marina
Is it then possible to add a custom controller class built in C++ into the opensim Matlab library ? Do you have any advice on how to do that?
Thanks again for your help
Marina
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: New Matlab controller
You can load OSIM files in Matlab that contain your custom controller. Make sure to load the library containing your custom controller in Matlab; the line is something like `org.opensim.modeling.Model.LoadOpenSimLibrary(<path-to-library>)`. If using 3.3, leave off the extension (e.g., ".dll").
You can not create or access your custom controller using Matlab code.
You can not create or access your custom controller using Matlab code.
- Marina Guihard
- Posts: 5
- Joined: Tue Jul 18, 2017 3:32 am
Re: New Matlab controller
Thanks. That's clear for me now.
I will try to create my custom controller and load the library in Matlab.
I will certainly get back to you
Marina
I will try to create my custom controller and load the library in Matlab.
I will certainly get back to you
Marina
- Marina Guihard
- Posts: 5
- Joined: Tue Jul 18, 2017 3:32 am
Re: New Matlab controller
Hello,
Since my last post, I currently develop my own controller using the platform OpenSim/Matlab.
I would like to calculate the moment (muscle force * moment arm) of each muscle seperately to provide a torque feedback to my controller. I don't know exactely which method I should use to get a muscle total force and moment arm for a given state. I found a quite similar question on the forum called "Problem with muscle analysis" but the links to the matlab example (provided by James Dunne) are unfortunately no more available.
Can anybody help me ?
Thanks
Marina
Since my last post, I currently develop my own controller using the platform OpenSim/Matlab.
I would like to calculate the moment (muscle force * moment arm) of each muscle seperately to provide a torque feedback to my controller. I don't know exactely which method I should use to get a muscle total force and moment arm for a given state. I found a quite similar question on the forum called "Problem with muscle analysis" but the links to the matlab example (provided by James Dunne) are unfortunately no more available.
Can anybody help me ?
Thanks
Marina