MATLAB Scripting: Inverse Kinematics Marker Error & RMS
- Justin Wager
- Posts: 6
- Joined: Sun Jun 09, 2013 10:08 pm
MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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
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
- Luca Modenese
- Posts: 43
- Joined: Wed Jan 21, 2009 9:16 am
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
Hi Justin,
calling the dos command in Matlab with '-echo' option should work:
I hope this helps,
Luca
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');
Luca
- Justin Wager
- Posts: 6
- Joined: Sun Jun 09, 2013 10:08 pm
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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.
Thanks again, Luca.
Justin
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');
Justin
- ANDREW LAPRE
- Posts: 29
- Joined: Tue Dec 04, 2012 11:10 am
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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
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
- Justin Wager
- Posts: 6
- Joined: Sun Jun 09, 2013 10:08 pm
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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
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
- Matteo Arquilla
- Posts: 2
- Joined: Mon Jun 06, 2016 2:49 am
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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
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
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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.
- Samuel Hybois
- Posts: 15
- Joined: Mon Nov 02, 2015 3:55 am
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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
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
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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 106 times
-
- MarkerPositionAnalysis.cpp
- (3.07 KiB) Downloaded 109 times
- Samuel Hybois
- Posts: 15
- Joined: Mon Nov 02, 2015 3:55 am
Re: MATLAB Scripting: Inverse Kinematics Marker Error & RMS
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 ?
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 ?