Clarification regarding OpenSim Controllers

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
jeevan jayasuriya
Posts: 7
Joined: Wed Jan 12, 2022 5:34 am

Clarification regarding OpenSim Controllers

Post by jeevan jayasuriya » Mon Apr 04, 2022 10:23 am

I am trying to print the following C++ example as an OSIM file and use the controller in the code for simulations in the OpenSim GUI environment.

(...\Documents\OpenSim\4.3\Code\CPP\ControllerExample)

When attempting to open the resulting OSIM file, I am getting the error shown by the 1st snapshot attached. I am wondering if the reason is the warning of C++ code shown by the 2nd snap.

I would like to know whether this is a possible approach to insert a custom controller into OpenSim GUI. If so, any clue to fix this issue is highly appreciated.

Otherwise, could you please suggest to me a way that I could insert custom controllers into the OpenSim GUI.

Your help is much appreciated.
Attachments
1.PNG
1.PNG (12.42 KiB) Viewed 297 times
2.PNG
2.PNG (635.36 KiB) Viewed 297 times

Tags:

User avatar
Carmichael Ong
Posts: 378
Joined: Fri Feb 24, 2012 11:50 am

Re: Clarification regarding OpenSim Controllers

Post by Carmichael Ong » Wed Apr 06, 2022 9:53 am

The model cannot load in the GUI because the libraries for the GUI are not aware of "TugOfWarController". You would need to build the new class as a plugin and then load the plugin in the GUI. Some info on plugins: https://simtk-confluence.stanford.edu:8 ... ng+Plugins

The message in the second picture is unrelated. The visual studio IDE will often get confused by the macros we use to declare new objects, but there should be no issues when compiling.

User avatar
jeevan jayasuriya
Posts: 7
Joined: Wed Jan 12, 2022 5:34 am

Re: Clarification regarding OpenSim Controllers

Post by jeevan jayasuriya » Fri Apr 08, 2022 8:40 am

Thank you very much for letting me know and saving lots of time that could have wasted trying to insert a customized controller without plugin. I will have a look at the link you have mentioned, hope it'd help.

In parallel to this approach, I am trying to get the MEX interface working which is available in the following link which may enables designing custom controllers for OpenSim model in MATLAB Simulink environment.

https://simtk.org/projects/opensimmatlab

However, different errors comes for different combinations of software versions (Visual Studio, MATLAB, CMake, OpenSim, SimBody). Have you had a look at this previously by any chance? If so, please kindly let me know with what software version combination it worked properly.

Thanks in advance.

POST REPLY