Tracking Simulation - Coordinate Actuator

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Nicos Haralabidis
Posts: 196
Joined: Tue Aug 16, 2016 1:46 am

Tracking Simulation - Coordinate Actuator

Post by Nicos Haralabidis » Tue Jul 31, 2018 4:36 am

Hi all,

I currently have a 6 DoF model that is actuated by 6 coordinate actuators, and I am attempting to perform a tracking simulation to minimise the difference between ID joint moments and coordinate actuators. I am, however, currently struggling to find a method to obtain the coordinate actuator generalised forces through the Matlab-OpenSim API.

Is it possible to obtain the coordinate actuator generalised forces after computing the stateVariableDerivatives through the Matlab-OpenSim API? For example, I can access the state derivatives by using osimState.getYDot().

Kind regards,

Nicos Haralabidis

Tags:

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Tracking Simulation - Coordinate Actuator

Post by Dimitar Stanev » Wed Aug 01, 2018 12:47 am

I am, however, currently struggling to find a method to obtain the coordinate actuator generalised forces through the Matlab-OpenSim API.
I suppose you are performing forward dynamics simulation. In this case the coordinate actuator forces are the input to the model and since they are ideal actuators you can assign any value without worrying whether the value is achieved. It may be that your confusing with a motion tracking controller, where you are comparing the desired acceleration with the simulated one. In this case, you need to access the simulated variables. Please let me know if I am not misunderstanding your question.
Is it possible to obtain the coordinate actuator generalised forces after computing the stateVariableDerivatives through the Matlab-OpenSim API? For example, I can access the state derivatives by using osimState.getYDot().
The Matlab API as it stands now is not conveniently designed to enable this kind of simulations.

User avatar
Nicos Haralabidis
Posts: 196
Joined: Tue Aug 16, 2016 1:46 am

Re: Tracking Simulation - Coordinate Actuator

Post by Nicos Haralabidis » Tue Aug 07, 2018 7:58 am

Good afternoon Dimitar,

Thank you for your reply.

I do not think I was particularly clear with my question.

After adding and updating my Model's coordinate actuator controls' I wanted to then obtain their resulting torque output at a particular instance in time during my simulation and compare with the outputs from an Inverse Dynamics Analysis.

I came up with the following in the end to solve my problem:

for i = 0:nActuators-1
torque(1,i+1) = actuators.get(i).getForce(osimState);
end

Kind regards,

Nicos Haralabidis

POST REPLY