Page 1 of 1

Analyze API problems

Posted: Thu Feb 09, 2017 1:30 am
by julian_atkinson
Hi there

I am using matlab to run the API for analysis. If I try and pass a xmltemplate file into the analyze tool it does not work. It is clear that it does not like the placeholder files that I have placed in my template. I have seen this error in other forums, but in those cases it seems to be when the tool is being run, not before setting the paramters. The following error is given.

analyzeTool=AnalyzeTool(XMLTemplate);

Error:

Java exception occurred:
java.io.IOException: Object: ERR- Could not open file CMC_Actuators.xml. It may not exist or you don't have permission to read it.

at org.opensim.modeling.opensimModelJNI.new_AnalyzeTool__SWIG_2(Native Method)

at org.opensim.modeling.AnalyzeTool.<init>(AnalyzeTool.java:69)


In addition to this, If I use a real path for the actuators file then matlab crashes.

Thank you

Re: Analyze API problems

Posted: Thu Feb 09, 2017 3:17 am
by mitkof6
The error is due to the fact that the path to the file is not correct. If matlab crashes this can be caused by some internal error in OpenSim, which was caused by a bad xml file. Try to use some predefined .xml to check if it will crash again and then iteratively find the cause of the problem in your xml file.

Re: Analyze API problems

Posted: Thu Feb 09, 2017 3:26 am
by julian_atkinson
Thanks Dimitar

I have tested it a number of times, even with xml files that I have run with the OpenSim GUI. I have made sure my path is correct, however it still crashes. Perhaps it is an xml version issue?

Anyway, my alternative if I cannot use an xmlTemplate to set some of the values, I could pass values in manually, however I am struggling on how to perform some of the boolean settings. Most importantly setting "compute_moments" to true in the Muscle Analysis, Analysis set. I am not sure if this is possible through the API.

Thank you for your help.

Julian