Hi dear all.
I was wondering how can i get the absolute position of two points on two different bodies at each time during forward simulation for use in controller written in c++?(for example can i put two marker on desired positions,and get the position of markers(x,y,z) at each time?If that is possible how can i do that?
and also how can i get the force produced by actuator during forward simulation at each time?(_model->getActuators().get(); is used to get the position of actuator but i need the force produced by actuator at each time.)
Best regards.
getting the force and position in force controller
- mohamad rasool mohamadi
- Posts: 14
- Joined: Tue Oct 17, 2017 12:59 am
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: getting the force and position in force controller
The following function returns the position of a station point on a body as measured in the ground frame:
https://simtk.org/api_docs/opensim/api_ ... a8ee4bcd72
In a forward dynamic simulation, the input is the muscle excitation. When the state is realized to dynamics stage, then the muscle forces are computed and applied to the model in order to calculate the acceleration that is being integrated numerically. You can get the muscle forces using the computeActuation method:
https://simtk.org/api_docs/opensim/api_ ... 38f652cc82
https://simtk.org/api_docs/opensim/api_ ... a8ee4bcd72
In a forward dynamic simulation, the input is the muscle excitation. When the state is realized to dynamics stage, then the muscle forces are computed and applied to the model in order to calculate the acceleration that is being integrated numerically. You can get the muscle forces using the computeActuation method:
https://simtk.org/api_docs/opensim/api_ ... 38f652cc82
- mohamad rasool mohamadi
- Posts: 14
- Joined: Tue Oct 17, 2017 12:59 am
Re: getting the force and position in force controller
thank u so much.
Is there any example including this functions? (I'm not sure how should i write it in c++.)
best regards.
Is there any example including this functions? (I'm not sure how should i write it in c++.)
best regards.