What is the command to append actuators to the CMC tool in the MATLAB API?
Also, how do you directly load a CMC setup file into the MATLAB API? I have the following code but CMC either does not load the file info or MATLAB completely crashes at the line "cmc = CMCTool(setup)"
import org.opensim.modeling.*
model = Model('C:\Users\NeuRRo Lab\Desktop\armModel\CMC_Matlab\MoBL_ARMS_module6_7_CMC_TOMEDITS.osim');
setup = 'C:\Users\NeuRRo Lab\Desktop\armModel\CMC_Matlab\CMC_setup_reaching';
cmc = CMCTool(setup);
cmc.setModel(model);
state = model.initSystem();
I attached the files I'm using as well if anybody wants to give it a try. The set-up file was built (and tested) and saved in the GUI.
Append actuators to CMC Tool in MATLAB
- Tom Augenstein
- Posts: 38
- Joined: Thu May 03, 2018 8:19 am
Append actuators to CMC Tool in MATLAB
- Attachments
-
- reaching_trial.zip
- (91.15 KiB) Downloaded 22 times
Tags:
- Thomas Uchida
- Posts: 1792
- Joined: Wed May 16, 2012 11:40 am
Re: Append actuators to CMC Tool in MATLAB
Looks like you're missing the ".xml" extension. There are example scripts on the "Scripting with Matlab" page in the Confluence documentation (https://simtk-confluence.stanford.edu/d ... ith+Matlab).setup = 'C:\Users\NeuRRo Lab\Desktop\armModel\CMC_Matlab\CMC_setup_reaching';
- Tom Augenstein
- Posts: 38
- Joined: Thu May 03, 2018 8:19 am
Re: Append actuators to CMC Tool in MATLAB
Sorry, the missing ".xml" happened when I copied in a different file while posting the question, the ".xml" appears in my MATLAB script and the same fatal error still occurs.
I looked at the "Scripting with MATLAB" page, but as far as I can tell I reference the set-up file the same way in the same way that the example scripts do.
I looked at the "Scripting with MATLAB" page, but as far as I can tell I reference the set-up file the same way in the same way that the example scripts do.
- Thomas Uchida
- Posts: 1792
- Joined: Wed May 16, 2012 11:40 am
Re: Append actuators to CMC Tool in MATLAB
There is no model specified in your CMC setup file, yet the second argument to the CMCTool's constructor is "true" (default). The Tool is attempting to load a model whose filename is null. You should either provide "false" as the second argument to the constructor (line 4 of your script), or edit line 5 of your setup file. https://simtk.org/api_docs/opensim/api_ ... c57dffee23
- Tom Augenstein
- Posts: 38
- Joined: Thu May 03, 2018 8:19 am
Re: Append actuators to CMC Tool in MATLAB
Ok, that makes sense. Thanks for the help