Page 1 of 1

Using the Forward Tool with Matlab

Posted: Tue Mar 08, 2016 2:23 pm
by nihar
Hi all,
I want to use the forward tool of open sim with matlab while using a control law of my own. I went through the Dynamic walking tutorial and was able to figure out how to use my control law to drive the actuators using the matlab's integrator but I can't figure out a way to use the forward tool along with my control law in matlab. Can anyone please point me in the right direction?

Thank You,
-Nihar

Re: Using the Forward Tool with Matlab

Posted: Thu Mar 10, 2016 11:46 am
by bradh
Nihar,

I believe you have to do the following to use the Forward Dynamics tool (or at least this is the way that works for me):
1) Your controller needs to be written in C++ and compiled and registered with OpenSim (Let OpenSim know it exists).
2) Add the controller to your model (.osim file)
3) Then you can run FD using the MATLAB API and calling your model. The MATLAB API does not know about your custom controller, so it can't directly interact with it, but it can run a model that has it.

Or you have to work in MATLAB, implement the controller there, and use MATLAB's integrators or OpenSim API to work step wise (as it is done in the dynamic walking tutorial).

In reviewing the OpenSim 4.0 release notes though, it sounds like you might be closer to what you want to do with that coming release (manipulate custom components/classes via Python).

Brad