get Marker Error running IK from Matlab using API

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Alice Mantoan
Posts: 29
Joined: Fri Feb 24, 2012 11:51 am

get Marker Error running IK from Matlab using API

Post by Alice Mantoan » Wed Apr 16, 2014 9:53 am

Hi all,

I'm trying to perform the IK on multiple trials running a script in Matlab that exploits OpenSim API, as recommend (http://simtk-confluence.stanford.edu:80 ... +Questions, How should I do batch processing for the OpenSim tools (e.g. IK, ID, CMC) with a script?). I'm following the available example "setupAndRunIKBatchExample.m".

However, I would like to know the marker error (RMS and the max) for each performed IK, to understand if I can keep the results. Running python scripts from the OpenSim GUI, or just using parsing XML file approach in Matlab, the error is shown in the Messages Window and in the Command Window respectively.
Is there a way to retrieve this information exploiting the API from Matlab?I can't figure out a possible solution...

Thanks a lot.
Regards,
Alice

User avatar
Ayman Habib
Posts: 2235
Joined: Fri Apr 01, 2005 12:24 pm

Re: get Marker Error running IK from Matlab using API

Post by Ayman Habib » Tue Apr 22, 2014 11:23 am

Hi Alice,

If you're using the InverseKinematicsSolver directly, you can use the API to get the current marker errors for the current frame by calling computeCurrentSquaredMarkerErrors() and checking for maximum, that's what the tool is doing anyway. You'll have to do it frame by frame since the solver works frame by frame and not over a full trial.

Hope this helps,
-Ayman

User avatar
Alice Mantoan
Posts: 29
Joined: Fri Feb 24, 2012 11:51 am

Re: get Marker Error running IK from Matlab using API

Post by Alice Mantoan » Wed Apr 23, 2014 2:59 am

Dear Ayman,

thanks a lot for your reply.
I'm using the InverseKinematicsTool as in the example setupAndRunIKBatchExample.m.
As a temporary solution, I just copied the out.log file in my output folder.

I saw that the InverseKinematicSolver has that method, I will try to follow your hint for a better implementation.

Thanks again.

Regards,

Alice

POST REPLY