OpenSim v.2.3.1
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: OpenSim v.2.3.1
Joint torque is not a state variable but an input or an output depending your simulation. You can run inverse dynamics (ID) on your motion file + any external force and compute the joint torques. Otherwise if you perform forward dynamics you can also run ID on the simulated movement afterwards.
- sariah Mghames
- Posts: 23
- Joined: Thu Jun 30, 2016 5:56 am
Re: OpenSim v.2.3.1
Yes, in fact I am performing Forward dynamics with already built S function to be used in Simulink. The output state vector contains joints position and velocity.
I was trying to avoid running inverse dynamics tool to get the joint torques out of: position, velocities, accelerations. But as you said it seems there is no other solution.
The inverseDynamicsTool of opensim takes as input the motion file containing the joint trajectories. But I am working in simulink , so I want to perform real time inverse dynamics. The problem is that I can call the inverseDynamicsTool in simulink but I can't input a motion file to it, since I have real time output trajectories generating.
I am not sure till now if I can call the ID Tool from Simulink matlab function and tell it to get the input trajectories from the input port of the block instead of specifying a .mot file to the Tool
Thanks again
I was trying to avoid running inverse dynamics tool to get the joint torques out of: position, velocities, accelerations. But as you said it seems there is no other solution.
The inverseDynamicsTool of opensim takes as input the motion file containing the joint trajectories. But I am working in simulink , so I want to perform real time inverse dynamics. The problem is that I can call the inverseDynamicsTool in simulink but I can't input a motion file to it, since I have real time output trajectories generating.
I am not sure till now if I can call the ID Tool from Simulink matlab function and tell it to get the input trajectories from the input port of the block instead of specifying a .mot file to the Tool
Thanks again
Re: OpenSim v.2.3.1
You don't necessarily have to use the IDTool. You can try and use the InverseDynamicsSolver directly.
- sariah Mghames
- Posts: 23
- Joined: Thu Jun 30, 2016 5:56 am
Re: OpenSim v.2.3.1
Thanks for pointing me out IDSolver()
by taking a look at it, the function solve:
virtual SimTK::Vector solve(SimTK::State &s, const SimTK::Vector &udot = SimTK::Vector(0))
It takes state ( position, velocity, time) and acceleration as input principally and gives torque as output
The acceleration is defibìned to be a variable sized vector and the output torque also. But since I am working in simulink the acceleration should be 1 dimensional at each time step( real time simulation) and the torque output also. As I understood from defining acceleration udot as Vector(0) it should be Ok my case of having acceleration as 1 dimensional and getting 1 dimensional torque as output.
Any idea If what I am saying is right ?
by taking a look at it, the function solve:
virtual SimTK::Vector solve(SimTK::State &s, const SimTK::Vector &udot = SimTK::Vector(0))
It takes state ( position, velocity, time) and acceleration as input principally and gives torque as output
The acceleration is defibìned to be a variable sized vector and the output torque also. But since I am working in simulink the acceleration should be 1 dimensional at each time step( real time simulation) and the torque output also. As I understood from defining acceleration udot as Vector(0) it should be Ok my case of having acceleration as 1 dimensional and getting 1 dimensional torque as output.
Any idea If what I am saying is right ?