Page 1 of 1

Advice is required for building a controller

Posted: Wed May 25, 2011 10:35 pm
by fadyalnajjar
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.

RE: Advice is required for building a controller

Posted: Thu May 26, 2011 12:07 am
by aymanh
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

RE: Advice is required for building a controller

Posted: Thu May 26, 2011 12:26 am
by fadyalnajjar
Thank you Dr. Ayman.
I will go ahead for your 1 option, and let you know the process.
thanks