Page 1 of 2

MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Wed Jan 07, 2015 2:24 pm
by justinwager
Hi,

I have MATLAB calling the IK tool successfully, but was wondering if there is a command to return the marker error and RMS values that are normally returned in the "Messages" window. I don't see anything that looks to be of use in the methods list.

Thanks,
Justin

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Wed Jan 07, 2015 3:27 pm
by modenaxe
Hi Justin,

calling the dos command in Matlab with '-echo' option should work:

Code: Select all

[status, log_mes]=dos('IK -S IK_Setup_file.xml','-echo');
I hope this helps,

Luca

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Thu Jan 08, 2015 8:00 am
by justinwager
Thanks Luca, that did the trick. For anyone else using this command for the first time, make sure that your setup file (.xml) and model file (.osim) are in your working directory or specified with the full path.

Also, "IK" in the command is case sensitive, so if it is in your [InstallDir]/bin as "ik", you must use "ik" in the command.
The "-echo" turned out to be unnecessary as the dos command returns the error values in the log_mes variable.

Code: Select all

[status, log_mes]=dos('ik -S IK_Setup_file.xml');
Thanks again, Luca.

Justin

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Sat Jan 23, 2016 4:17 pm
by andrewlapre
Hi,

I'm currently running batch ik processing as given in the examples and it runs great. I'm having a problem getting the marker error and rms to show up to the command window. Using the dos command as described, leaves me with this error:

InverseKinematicsTool Failed: Object: ERR- Could not open file Unassigned. It may not exist or you don't have permission to read it.
Exception in IK: InverseKinematicsTool Failed, please see messages window for details...

Any ideas? I've tried to change the directories I have it in, with no luck. Ideally I need to save the error and rms to a file, but this is the first step.

Any help would be appreciated.
Thanks
-Andy

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Mon Jan 25, 2016 1:53 pm
by justinwager
Hey Andy,

It's been some time since I worked with the batch IK, but I remember getting this error a number of times. If you want to send the code you're using to setup the IK Tool, I am happy to take a quick look to see if I can spot the error. Feel free to email/PM me if you want.

Justin

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Wed Sep 28, 2016 7:57 am
by matarqui
Hi everybody,

I am trying and run the IK tool from cmd in windows and/or from Matlab and extract the OpenSim output message with marker errors.
I have exactly the same problem as Andrew, i.e. the following error:

InverseKinematicsTool Failed: Object: ERR- Could not open file Unassigned. It may not exist or you don't have permission to read it.
Exception in IK: InverseKinematicsTool Failed, please see messages window for details...

Could you finally manage to solve the issue?

Thanks in advance for your support.

Best,
Matteo

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Wed Sep 28, 2016 11:44 pm
by mitkof6
The model path is not correct. You can check the log file and see the path that IK uses and correct it accordingly in your xml.

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Thu Oct 06, 2016 1:57 am
by samhyb
Hello everyone,

I am also trying to compute errors between experimental/IK-positioned markers, but I would like to get more than the "total squared error / RMS and max marker errors" that the 'echo' option computes at each frame.
That is why I would like to know if some of you managed to store (as IK output) the calculated position of markers from IK (that must be computed in the IK algorithm since the GUI allows to visualize IK results with markers..).
This topic was addressed here (viewtopicPhpbb.php?f=91&t=2094) but I did not manage to make it work because I do not know how to specify the output storage file of the <IKTrial> option.

Did anyone already face this issue ?

Thanks for your help,

Samuel

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Thu Oct 06, 2016 5:07 am
by mitkof6
You can try the attached code. If you are not using c++ API, then you should port the code as an analysis plugin.

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Posted: Thu Oct 06, 2016 7:56 am
by samhyb
Thanks a lot for your quick answer !

Actually I am not using C++ API, only running the OS tools from Matlab. I have to admit that I am not familiar with C++.. Do I have to build a .dll library from the files you sent, in order to use it as plug-in ? Is there a particular procedure to do so ?