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
outputting controls to sto files
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
RE: outputting controls to sto files
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
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
Re: outputting controls to sto files
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
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