Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
Tim Dorn
- Posts: 125
- Joined: Tue Feb 26, 2008 10:14 pm
Post
by Tim Dorn » Tue Nov 10, 2009 1:39 am
Hi! I thought I would start using the developers forum for queries relating to code implementation.
Following the optimization that Sam presented at the developers workshop, I was wondering how to output the controls to an controls.sto file. I can't find any getControlStorage() method in the manager and unsure where to look in Intellisence. Any suggestions??
Also if I was to change the objective function to minimise the forward velocity of the whole body CoM (rather than from one segment), is there a method to compute the CoM of the whole model?
Thanks for anyone's help
![Smile :)](./images/smilies/icon_e_smile.gif)
-
Ayman Habib
- Posts: 2235
- Joined: Fri Apr 01, 2005 12:24 pm
Post
by Ayman Habib » Mon Nov 16, 2009 1:49 pm
Tim,
The Manager has a ControllerSet and that has a method storeControls() that saves the controls to a storage object, then printControlStorage() writes the controls to a file.
There's a method on the class SimbodyEngine that returns inertia properties (getSystemInertia).
-Ayman
-
Romain LEBERRE
- Posts: 12
- Joined: Fri Feb 24, 2012 11:47 am
Post
by Romain LEBERRE » Mon Apr 30, 2012 9:12 am
Hi,
I'm new to c++ and even opensim and I am actually practicing with API examples.
I am trying to output controls to a "controls.sto" file. It worked perfectly for the MainExample using osimModel.printControlStorage() after integration, but using the same method within the Arm26Optimization example, "controls.sto" file seems to contain all stored time/control data issued from each optimization step while I just want to output the LAST optimized control set.
Is there a control Storage automatically created? Do I have to reset this Storage at each optimization step?
In the previous post, it is said that the Manager has a ControllerSet and that has a method storeControls(). But I don't know how to get the ControllerSet from the manager and do not understand what storeControls() method exactly do.
I have another question, in the same example, how could I obtain velocity(or any state value) from any previous time step?
Thank you for your help.
Romain