MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Justin Wager
Posts: 6
Joined: Sun Jun 09, 2013 10:08 pm

MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Justin Wager » Wed Jan 07, 2015 2:24 pm

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

User avatar
Luca Modenese
Posts: 43
Joined: Wed Jan 21, 2009 9:16 am

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Luca Modenese » Wed Jan 07, 2015 3:27 pm

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

User avatar
Justin Wager
Posts: 6
Joined: Sun Jun 09, 2013 10:08 pm

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Justin Wager » Thu Jan 08, 2015 8:00 am

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

User avatar
ANDREW LAPRE
Posts: 29
Joined: Tue Dec 04, 2012 11:10 am

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by ANDREW LAPRE » Sat Jan 23, 2016 4:17 pm

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

User avatar
Justin Wager
Posts: 6
Joined: Sun Jun 09, 2013 10:08 pm

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Justin Wager » Mon Jan 25, 2016 1:53 pm

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

User avatar
Matteo Arquilla
Posts: 2
Joined: Mon Jun 06, 2016 2:49 am

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Matteo Arquilla » Wed Sep 28, 2016 7:57 am

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

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Dimitar Stanev » Wed Sep 28, 2016 11:44 pm

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.

User avatar
Samuel Hybois
Posts: 15
Joined: Mon Nov 02, 2015 3:55 am

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Samuel Hybois » Thu Oct 06, 2016 1:57 am

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

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Dimitar Stanev » Thu Oct 06, 2016 5:07 am

You can try the attached code. If you are not using c++ API, then you should port the code as an analysis plugin.
Attachments
MarkerPositionAnalysis.h
(1.17 KiB) Downloaded 77 times
MarkerPositionAnalysis.cpp
(3.07 KiB) Downloaded 77 times

User avatar
Samuel Hybois
Posts: 15
Joined: Mon Nov 02, 2015 3:55 am

Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS

Post by Samuel Hybois » Thu Oct 06, 2016 7:56 am

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 ?

POST REPLY