Page 1 of 1

Inverse Kinematics Error Calculations

Posted: Tue Nov 28, 2017 5:59 am
by godfreap
I am running a lot of inverse kinematics, and would like to keep track of the error. I've seen in other threads that you can output the marker file locations when running IK (and have successfully done so in the past), but this time I have a few problems with it. First, it doesn't let you change the name of that output, and I'm trying to batch-process several traces at a time. Second, it doesn't even output the file half the time, instead crashing out on an OpenSim API error. (this might be because of issues in specific trace files, but the IK will run when not asked to output marker location, so it seems a little suspect) Regardless of my specific errors, I think having an answer to this issue would benefit the forum, since error reporting doesn't really appear addressed here otherwise.

I'm using Python to run the IKs - is there any way to catch the console output? Or, alternatively, is there a way I can calculate the error myself within the API, during the IK, to avoid needing the tracked marker location files to begin with?
Thanks!

Re: Inverse Kinematics Error Calculations

Posted: Tue Nov 28, 2017 3:01 pm
by jimmy
First, it doesn't let you change the name of that output, and I'm trying to batch-process several traces at a time.
Unfortunately, the Model markers output file name is hardcoded as 'ik_model_marker_locations.sto'.

Code: Select all

Storage::printResult(modelMarkerLocations, "ik_model_marker_locations", getResultsDir(), -1, ".sto");
Second, it doesn't even output the file half the time, instead crashing out on an OpenSim API error.
The design of the IK tool was originally meant to be only used by the GUI and from command line. When you use the tool through these, and specify a <results_directory> and <report_marker_locations>, the writing of files is consitent. It is when you try using the IK Tool through the API (invoking run()) does there seem to be an issues. The file management system seems to be buggy and has been noted before.
I'm using Python to run the IKs - is there any way to catch the console output?
The console output should be wrtten to out.log and/or err.log.

If you are wanting/needing the marker errors and model marker files, you could just use the IKSolver directly. The tool is a wrapping around the solver and you can mimick that in Matlab/Python.

It would be great if, when you run into bugs like these, you could file them in the bug tracker;https://simtk.org/tracker/?atid=322&gro ... unc=browse