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
Joint Reaction Force File Matlab
- Maria Isabel Orselli
- Posts: 39
- Joined: Wed Mar 17, 2010 5:30 pm
Re: Joint Reaction Force File Matlab
Hi Alessandro,
to solve this problem I:
loaded a generic setup file:
then I got the property by its index
and with the PropertyHelper I could change the name of the file
Hope it helps,
Bel
to solve this problem I:
loaded a generic setup file:
Code: Select all
analyzeTool = AnalyzeTool(genericSetupFile);
Code: Select all
x=analyzeTool.getAnalysisSet().get(0).getPropertyByIndex(5);
Code: Select all
PropertyHelper.setValueString('new file',x);
Bel
- Alessandro Navacchia
- Posts: 7
- Joined: Wed Sep 11, 2013 2:11 pm
Re: Joint Reaction Force File Matlab
It was very helpful! Thanks a lot.
Alessandro
Alessandro