Page 1 of 1

outputting controls to sto files

Posted: Tue Nov 10, 2009 1:39 am
by twdorn
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 :)

RE: outputting controls to sto files

Posted: Mon Nov 16, 2009 1:49 pm
by aymanh
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

Re: outputting controls to sto files

Posted: Mon Apr 30, 2012 9:12 am
by romleberre
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