Table Reporter for Inverse Dynamics in MATLAB

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Ankit Verma
Posts: 11
Joined: Fri Feb 22, 2019 6:12 am

Table Reporter for Inverse Dynamics in MATLAB

Post by Ankit Verma » Mon Jan 27, 2020 12:15 am

Hi Everyone
I was performing Inverse Dynamics simulation to calculate the joint torque required for a trajectory in MATLAB. I have run the Inverse Dynamics Simulation using MATLAB but i not able to export the data to tablereporter. Can someone tell me how to use reporter.

code I am using for running Inverse Dynamics
model.realizeVelocity(state);
appliedMobilityForces = Vector();
appliedBodyForces = VectorOfSpatialVec();
knownUdot = Vector(state.getNU(), 0.0);
knownUdot.set(0, 1.0);
knownLambda = Vector();
residualMobilityForces = Vector();
smss = model.getMatterSubsystem();
smss.calcResidualForce(state, appliedMobilityForces, appliedBodyForces, ...
knownUdot, knownLambda, residualMobilityForces);


How can I export the result (joint forces/torque) into .sto file

Tags:

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

Re: Table Reporter for Inverse Dynamics in MATLAB

Post by Ayman Habib » Mon Jan 27, 2020 11:54 am

Hi Ankit,

If the plan is to generate a sto file with inverseDynamics output then you may be better off using the InverseDynamicsTool that handles the files reading/writing for you at a higher level. If however you need to use the results from inverse dynamics live then it makes sense to use the low level simbody calls as shown in your code.

TableReporters report values of outputs from the model, the test case below from our code base should give you an idea how to wire it
https://github.com/opensim-org/opensim- ... orter.java

Hope this helps,
-Ayman

User avatar
Ratna Sambhav
Posts: 42
Joined: Sat Jan 12, 2019 10:16 am

Re: Table Reporter for Inverse Dynamics in MATLAB

Post by Ratna Sambhav » Thu May 14, 2020 8:05 pm

Hi Ayman Habib,

You said that this code can be used to calculate joint moment live.
I have angle and speed values of both the joints of arm26 model saved in an excel file. Can that be used to calculate the value of joint moment at every instance?
Do I need to calculate mass matrix and other jacobians separately, and use them to calculate elbow joint moment, or does the InverseDynamicsSolver (or any other) will be able to do that internally after I assign these values to the state of the model.

Thanks
Ratna Sambhav

POST REPLY