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
Tracking Simulation - Coordinate Actuator
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Tracking Simulation - Coordinate Actuator
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.I am, however, currently struggling to find a method to obtain the coordinate actuator generalised forces through the Matlab-OpenSim API.
The Matlab API as it stands now is not conveniently designed to enable this kind of simulations.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().
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
Re: Tracking Simulation - Coordinate Actuator
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
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