Page 1 of 1

Newbie issue - Cannot open file... It may not exist or you do not have permission to read it

Posted: Fri Nov 22, 2019 9:21 am
by joseph.kopke
Hello all,

New user and new install. Windows 10, Matlab R2017a. I have OpenSim/bin in my environment path and the OpenSim models and code folder in my matlab path.

I get the correct output when I ask for the version and the code works when I run model=org.opensim.modeling.Model()

but if I try to run any code that tries to open .osim files, I get a Java exception error similar to below. This is true for any script for any model that I have including tugofwar.

What would be causing this and how do I fix it? Does it not recognize the name or is it not looking in the right place?

Additionally,
model.initSystem(); which crashes matlab.
Not sure if that is helpful.


Thanks!
Joe

Error using das3driver>das3driver_OpeningFcn (line 141)
Java exception occurred:
java.io.IOException: Object: Cannot open file ../OpenSim_model/das3.osim. It
may not exist or you do not have permission to read it.
Thrown at object.cpp:105 in Object().

at org.opensim.modeling.opensimSimulationJNI.new_Model__SWIG_1(Native
Method)

at org.opensim.modeling.Model.<init>(Model.java:783)

Re: Newbie issue - Cannot open file... It may not exist or you do not have permission to read it

Posted: Fri Nov 22, 2019 10:05 am
by aymanh
Hello,

The fact that the error message shows a relative path for the model file (starting with '../') suggests that your assumption about working directory is incorrect, please use a full (absolute) path instead or set working directory for Matlab accordingly.

Please let us know how that goes,
-Ayman

Re: Newbie issue - Cannot open file... It may not exist or you do not have permission to read it

Posted: Fri Nov 22, 2019 1:16 pm
by joseph.kopke
I did not realize that the osim files had to be in the current folder / working directory as opposed to just in the Matlab path. It is working now if I work out of the folder with the osim files.

Thanks!