Developer's Guide Creating a Controller: .sto

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Nashwa Elaraby
Posts: 13
Joined: Fri Apr 09, 2010 8:00 am

Developer's Guide Creating a Controller: .sto

Post by Nashwa Elaraby » Mon Apr 11, 2011 8:57 am

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

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

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

Post by Ayman Habib » Mon Apr 11, 2011 3:06 pm

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

User avatar
Nashwa Elaraby
Posts: 13
Joined: Fri Apr 09, 2010 8:00 am

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

Post by Nashwa Elaraby » Wed Apr 20, 2011 10:09 am

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

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

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

Post by Ayman Habib » Thu Apr 21, 2011 9:55 am

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

POST REPLY