Page 1 of 1

using CMC through OpenSim API

Posted: Sun Aug 15, 2021 3:44 am
by hesamb1997
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

Re: using CMC through OpenSim API

Posted: Mon Aug 23, 2021 10:44 am
by ongcf
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.

Re: using CMC through OpenSim API

Posted: Tue Aug 24, 2021 8:23 am
by hesamb1997
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?

Re: using CMC through OpenSim API

Posted: Wed Sep 01, 2021 12:37 pm
by j_sturdy
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

Re: using CMC through OpenSim API

Posted: Mon Sep 06, 2021 11:06 am
by hesamb1997
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=