Advice is required for building a controller

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
fady alnajjar
Posts: 10
Joined: Wed Mar 02, 2011 2:19 am

Advice is required for building a controller

Post by fady alnajjar » Wed May 25, 2011 10:35 pm

Hi All,
I have some questions regarding building a controller using opensim. I am very sorry that my knowledge in opensim is very limited. Any information will be highly appreciated.

I am a very beginner SIMM user, in SIMM I have built a body model that stands on treadmill. I have created a motion file that moves the treadmill to one direction. Since the model feet have been fixed on the treadmill, the movement of the treadmill generates a response in the body model that I have calculated by the inverse/forward dynamics.
Since such a resulted motion in the body has a no exact control system (just a response to spring rule, as far as I understand), my plan is to test some strategies (program a controller) that change the body response based on the body center of mass (COM). For example, if the COM reaches to a range of value, run strategy one (move both arms in specific direction, for example), if COM goes far the above range, then run a strategy 2 (step with one leg in to a point X, for example).

My questions are:
Does opensim capable to program such a controller? where exactly to change or build such controller? Any guide?

Thank you very much for your help in advance.

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

RE: Advice is required for building a controller

Post by Ayman Habib » Thu May 26, 2011 12:07 am

Hi Fady,

Well, no relation between SIMM and OpenSim other than that we can import models built in SIMM. Proceeding with OpenSim, you can write a controller and use it in a forward simulation indeed. Two options are available, and both will require some C++ programming:
1. Write a main program, following the example included with the distribution under \sdk\APIExamples\ControllerExample

2. Write a plugin Controller class and specify it in the setup file for forward simulation.

Option 1. above requires less work as you don't need to worry about serialization to/from files etc. at the expense of a few more lines of code to setup and run a forward simulation.

Please consult the developer's guide and the example above in the distribution and let us know if you have any questions.

Best regards,
-Ayman

User avatar
fady alnajjar
Posts: 10
Joined: Wed Mar 02, 2011 2:19 am

RE: Advice is required for building a controller

Post by fady alnajjar » Thu May 26, 2011 12:26 am

Thank you Dr. Ayman.
I will go ahead for your 1 option, and let you know the process.
thanks

POST REPLY