using CMC through OpenSim API

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
hesam boroomand
Posts: 9
Joined: Tue May 19, 2020 3:33 am

using CMC through OpenSim API

Post by hesam boroomand » Sun Aug 15, 2021 3:44 am

Hello to everybody.
I am trying to control a prosthesis in MATLAB and to do this, i want to use reduced gait models of opensim. in this stage i got some problems with CMC. i use OpenSim API in MATLAB. despite the fact that information about CMC class is available on OpenSim API documentation, i could not use methods and constructors of this class in order to do CMC through Matlab and i get "unrecognized function or variable" error. it seems that this class is not usable with OpenSim API.can anyone guess whats happening?
i am sorry for my english
Thank you in advance

Tags:

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

Re: using CMC through OpenSim API

Post by Carmichael Ong » Mon Aug 23, 2021 10:44 am

CMC can be difficult to get right using the API and can take some time to debug. One way to work around this is to use MATLAB/Python tools to update a XML setup file and then load the setup file. You can also do a hybrid approach, using a setup file that has almost everything filled out, and then use the CMC API to make small changes to your setup.

User avatar
hesam boroomand
Posts: 9
Joined: Tue May 19, 2020 3:33 am

Re: using CMC through OpenSim API

Post by hesam boroomand » Tue Aug 24, 2021 8:23 am

Thank you very much for your answer.
What i inferred from your reply is that the problem with using CMC in opensim api is with its setup XML file which must be updated.
Am i right?

User avatar
Jordan Sturdy
Posts: 9
Joined: Fri Sep 22, 2017 8:56 am

Re: using CMC through OpenSim API

Post by Jordan Sturdy » Wed Sep 01, 2021 12:37 pm

Hesam,
I am able to use the CMCTool() method and configure the related properties just fine in both the 3.3 and 4.2 API using MATLAB or Python. Can you attach the code that is giving you an error so we can give some more specific advice?
This sounds like you are missing the "import org.opensim.modeling.*" line in your MATLAB script. In 4.2 I've found that when you are stepping through code rather than running it all at once, MATLAB somehow loses the link to the OpenSim libraries. So for troubleshooting, I paste the import line at the top of every code chunk.

Jordan

User avatar
hesam boroomand
Posts: 9
Joined: Tue May 19, 2020 3:33 am

Re: using CMC through OpenSim API

Post by hesam boroomand » Mon Sep 06, 2021 11:06 am

Dear Jordan
Thanks a lot for your replying.As it was really time-consuming process to find out what the problem exactly is, i passed this issue by using GUI and i faced to some other problems which is related to implementing forward scheme and integrating external actuator to gait model. if you think that could help me, i would be glad to see your suggestions. here is my question in the forum :
viewtopicPhpbb.php?f=91&t=13826&p=39728&start=0&view=

POST REPLY