Joint Reaction Force File Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Alessandro Navacchia
Posts: 7
Joined: Wed Sep 11, 2013 2:11 pm

Joint Reaction Force File Matlab

Post by Alessandro Navacchia » Fri Feb 14, 2014 3:34 pm

Hello,

I am using the OpenSim Matlab API to build a for loop and perform IK, ID, Static Optimization and AnalyzeTool-Reaction Forces 100 times. I managed to perform the first 3 steps (IK, ID and SO) but I got stuck with the Reaction Forces Analysis inside the AnalyzeTool because there is no public function that allows me specifying the Force File (storage file from the Static Optimization results). I cannot specify a static Force File for all the simulations because the file changes every time. Doing it manually (adding the path of the file in the .xml setup) is too time-consuming.

On the documentation I saw that there is a method called loadForcesFromFile(string) that probably does what I need, but it is protected.

Therefore I have the following questions:
1) How can I use a protected method?
2) If I cannot use a protected method, how can I solve my problem without changing manually every .xml setup file?

Thank you very much in advance!

Alessandro

User avatar
Maria Isabel Orselli
Posts: 36
Joined: Wed Mar 17, 2010 5:30 pm

Re: Joint Reaction Force File Matlab

Post by Maria Isabel Orselli » Fri May 30, 2014 3:52 pm

Hi Alessandro,

to solve this problem I:

loaded a generic setup file:

Code: Select all

analyzeTool = AnalyzeTool(genericSetupFile);
then I got the property by its index

Code: Select all

 x=analyzeTool.getAnalysisSet().get(0).getPropertyByIndex(5);
and with the PropertyHelper I could change the name of the file

Code: Select all

PropertyHelper.setValueString('new file',x);
Hope it helps,

Bel

User avatar
Alessandro Navacchia
Posts: 7
Joined: Wed Sep 11, 2013 2:11 pm

Re: Joint Reaction Force File Matlab

Post by Alessandro Navacchia » Sat Aug 16, 2014 3:00 pm

It was very helpful! Thanks a lot.

Alessandro

POST REPLY