RRA tool Matlab Help

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Yong Cho
Posts: 27
Joined: Wed Sep 21, 2016 4:45 pm

RRA tool Matlab Help

Post by Yong Cho » Fri Feb 10, 2017 10:27 am

I am trying to do part C of the example problem of this link [url]http://simtk-confluence.stanford.edu:80 ... +in+Stance[/url which is to run the RRA tool on Matlab. However, I am having trouble setting up the code to run this problem. The code below is what I have for now, any help or suggestions will be appreciated. Thank you.

Code: Select all

import org.opensim.modeling.*

[genericSetupForIK,genericSetupPath,FilterIndex] = uigetdir('*.xml', 'C:\Users\Yong Cho\Documents\MATLAB\OpenSim 3.3\Models\Leg6Dof9Musc\Stance\leg69_Tracking_Tasks.xml')

[modelFile,modelFilePath,FilterIndex] = uigetdir('*.osim', 'C:\Users\Yong Cho\Documents\MATLAB\OpenSim 3.3\Models\Leg6Dof9Musc\leg6dof9musc.osim')

RRATool = RRATool([genericSetupPath genericSetupForIK]);
% Load model and initialize

model = Model([modelFilePath modelFile]);
model.initSystem();

% Tell RRA tool to use the loaded model

RRATool.setModel(model);

%Sets kinematics

RRATool.setDesiredKinematicsFileName('C:\Users\Yong Cho\Documents\MATLAB\OpenSim 3.3\Models\Leg6Dof9Musc\Stance\leg69_IK_stance.mot')
RRATool.setTaskSetFileName('C:\Users\Yong Cho\Documents\MATLAB\OpenSim 3.3\Models\Leg6Dof9Musc\Stance\leg69_Tracking_Tasks.xml')


User avatar
Thomas Uchida
Posts: 1780
Joined: Wed May 16, 2012 11:40 am

Re: RRA tool Matlab Help

Post by Thomas Uchida » Fri Feb 10, 2017 12:59 pm

First, you can add the line to run RRA:

Code: Select all

RRATool.run();
You will also need to adjust the mass of the pelvis. You may need to read the new mass from the out.log file generated by RRA. Setting a new pelvis mass looks something like the following:

Code: Select all

pelvis = model.updBodySet().get('pelvis');
pelvis.setMass(newMass);
The doxygen (https://simtk.org/api_docs/opensim/api_ ... ATool.html) and "Scripting with Matlab" documentation (http://simtk-confluence.stanford.edu:80 ... ith+Matlab) might be useful.

Also, you might consider first running through the example using the GUI to get a better idea of what steps you will need to perform in scripting.

POST REPLY