matlab opensim pipline examples

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
z imn
Posts: 35
Joined: Sun Sep 17, 2017 7:11 am

matlab opensim pipline examples

Post by z imn » Mon Feb 12, 2018 3:51 am

hello everyone
i want to run the matlab opensim pipeline examples. when i input the static data(c3d file) i have no error but i get this message :


'scale' is not recognized as an internal or external command,
operable program or batch file.

and when i run the matlab code for dynamic c3d file i get this error


'ik' is not recognized as an internal or external command, [/b]
operable program or batch file.
Error using readtext (line 142)
Trying to open C:\Program
Files\MATLAB\MatlabOpensimPipelineTools-latest\MatlabOpensimPipelineTools-latest\MatlabOpensimPipelineExample\MU2392 Tim Dorn Test
Data\ExampleData\testWalking_ik.mot: No such file or directory

Error in load_sto_file (line 21)
[file_data,s_data]= readtext(file, '\t', '', '', 'empty2NaN');

Error in MU_walk_pipeline (line 88)
D = load_sto_file([data.TRC_Filename(1:end-4) '_ik.mot']);

User avatar
Thomas Uchida
Posts: 1790
Joined: Wed May 16, 2012 11:40 am

Re: matlab opensim pipline examples

Post by Thomas Uchida » Mon Feb 12, 2018 11:00 am

It would help to narrow down whether this is an OpenSim installation issue, a MATLAB configuration issue, an issue with the script, etc. Did you encounter any issues when configuring MATLAB? Please see the "Scripting with Matlab" page in the Confluence documentation for reference (https://simtk-confluence.stanford.edu:8 ... ith+Matlab).

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: matlab opensim pipline examples

Post by Christopher Dembia » Mon Feb 12, 2018 11:01 am

I don't think these scripts use the OpenSim Matlab API.

The issue is likely that the path to OpenSim command-line tools is not on the system's PATH environment variable.

User avatar
z imn
Posts: 35
Joined: Sun Sep 17, 2017 7:11 am

Re: matlab opensim pipline examples

Post by z imn » Mon Feb 12, 2018 12:35 pm

thank you for your attention
i could successfuly run it with no error and when i run the "model = org.opensim.modeling.Model()" i get no error
but i have another question...
how i can open a model from models in opensim
i run this model = org.opensim.modeling.Model('gait2392_simbody.osim')
but i got the error
Java exception occurred:
java.io.IOException: Object: ERR- Could not open file gait2392_simbody.osim. It may not exist or you don't have permission to read
it.

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

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


how can i solve this problem?
thank you

User avatar
Thomas Uchida
Posts: 1790
Joined: Wed May 16, 2012 11:40 am

Re: matlab opensim pipline examples

Post by Thomas Uchida » Mon Feb 12, 2018 2:35 pm

Could not open file gait2392_simbody.osim. It may not exist or you don't have permission to read
it.
You may be encountering read/write permission issues if your models and scripts reside in a protected system directory like Program Files on Windows. It is also possible that the gait2392_simbody.osim model file is simply not in the current directory. Your MATLAB code should look something like this:

Code: Select all

import org.opensim.modeling.*
cd('C:\OpenSim 3.3\Models\Gait2392_Simbody');
model = Model('gait2392_simbody.osim');
% ...
state = model.initSystem();
% ...

User avatar
z imn
Posts: 35
Joined: Sun Sep 17, 2017 7:11 am

Re: matlab opensim pipline examples

Post by z imn » Tue Feb 13, 2018 8:13 am

thank you dear
you helped me alot of and now i have no error.
but i am beginner in using opensim-matlab api
i searched alot of about it .... but i dont understand how to do different stages(like scaling, inverse kinematic , inverse dynamic, static optimization, rra and cmc )in matlab? :roll:
please give me a little information..
king regards

User avatar
Thomas Uchida
Posts: 1790
Joined: Wed May 16, 2012 11:40 am

Re: matlab opensim pipline examples

Post by Thomas Uchida » Tue Feb 13, 2018 11:45 am

i searched alot of about it .... but i dont understand how to do different stages(like scaling, inverse kinematic , inverse dynamic, static optimization, rra and cmc )in matlab?
Please see the example scripts on the "Scripting with Matlab" page in the Confluence documentation (https://simtk-confluence.stanford.edu:8 ... ith+Matlab).

User avatar
z imn
Posts: 35
Joined: Sun Sep 17, 2017 7:11 am

Re: matlab opensim pipline examples

Post by z imn » Tue Feb 13, 2018 12:10 pm

thank alot

excuse me

when i run the osimModel.initSystem(); command i got this error


Error using my_matlab_program (line 5)
Java exception occurred:
java.lang.RuntimeException: SimTK Exception thrown at VisualizerProtocol.cpp:157:
Error detected by Simbody method VisualizerProtocol::ctor(): Unable to spawn executable 'simbody-visualizer' from directories:
c:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\win64\
c:\OpenSim 3.3\bin\bin\
D:/Dev/OpenSim33/installx64/Simbody/bin/
C:\Program Files\Simbody\bin\
C:\Program Files\SimTK\bin\
Final system error was errno=2 (No such file or directory).
(Required condition 'status == 0' was not met.)


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


at org.opensim.modeling.Model.initSystem(Model.java:179)

User avatar
Thomas Uchida
Posts: 1790
Joined: Wed May 16, 2012 11:40 am

Re: matlab opensim pipline examples

Post by Thomas Uchida » Tue Feb 13, 2018 9:12 pm

Error detected by Simbody method VisualizerProtocol::ctor(): Unable to spawn executable 'simbody-visualizer' from directories:
It looks like the visualizer could not be opened. You might try running your script without the visualizer to determine whether the issue is with the visualizer specifically or with the OpenSim installation in general.

User avatar
z imn
Posts: 35
Joined: Sun Sep 17, 2017 7:11 am

Re: matlab opensim pipline examples

Post by z imn » Wed Feb 14, 2018 1:01 am

i think the error is related to my windows because without this command i have no error
is there any way to correct it? :?:

POST REPLY