Page 1 of 1

Developer's Guide Creating a Controller: .sto

Posted: Mon Apr 11, 2011 8:57 am
by nelaraby
Hi,

I tried this exercise and it worked fine, but when I tried to apply it on another model, I found that I need the "desired_motion.sto" file to have nonzero translations, and to create the motion file.
I have two questions and would really appreciate any help:

1. As long as the function of the required motion is given in the .cpp file why isn't the .sto file created when running the solution file?

2. Is there a way I can create the desired_motion.sto file by adding a code to the .cpp file?

Thank you,
Nashwa

RE: Developer's Guide Creating a Controller: .sto

Posted: Mon Apr 11, 2011 3:06 pm
by aymanh
Hi Nashwa,

Which OpenSim version are you using and where did you get the source for the Controller example (as things have moved around over the last couple releases)?

In general you can create a "Storage" object programmatically and add data to it. Please consult the Doxygen documentation corresponding to the version you have (the top level html file is under the directory sdk/doc). If you need to write the "Storage" object into a ".sto" file then you can call the print function (also described in Doxygen).

Good luck and please let me know if you have questions,
-Ayman

RE: Developer's Guide Creating a Controller: .sto

Posted: Wed Apr 20, 2011 10:09 am
by nelaraby
Thank you Dr. Habib for your reply.

I am using OpenSim 2.2.0. I am trying to simulate the rotation motion of the eye, using two musclethe lateral and medial rectus muscles. I have tried to use the controller code with some modifications. The solution file compiles successfully, but the motion and storage files are not created. What am I possibly missing?

Thank you,
Nashwa

RE: Developer's Guide Creating a Controller: .sto

Posted: Thu Apr 21, 2011 9:55 am
by aymanh
Hi Nashwa,

Can you please tell us where in the distribution is the controller example you started from? It's also a little hard to debug code remotely since there's so many variables and environment specific issues. For example, are you running from VisualStudio? What's your working directory? Can you create other files?

Please give us more details so that we can help.

Best regards,
-Ayman