New Matlab controller

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Marina Guihard
Posts: 5
Joined: Tue Jul 18, 2017 3:32 am

New Matlab controller

Post by Marina Guihard » Thu Mar 01, 2018 8:31 am

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

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: New Matlab controller

Post by Christopher Dembia » Thu Mar 01, 2018 10:37 am

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++.

User avatar
Marina Guihard
Posts: 5
Joined: Tue Jul 18, 2017 3:32 am

Re: New Matlab controller

Post by Marina Guihard » Fri Mar 02, 2018 2:15 am

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

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: New Matlab controller

Post by Christopher Dembia » Sun Mar 04, 2018 11:45 pm

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.

User avatar
Marina Guihard
Posts: 5
Joined: Tue Jul 18, 2017 3:32 am

Re: New Matlab controller

Post by Marina Guihard » Mon Mar 05, 2018 2:38 am

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

User avatar
Marina Guihard
Posts: 5
Joined: Tue Jul 18, 2017 3:32 am

Re: New Matlab controller

Post by Marina Guihard » Mon May 14, 2018 4:59 am

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

POST REPLY