getting the force and position in force controller

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
mohamad rasool mohamadi
Posts: 14
Joined: Tue Oct 17, 2017 12:59 am

getting the force and position in force controller

Post by mohamad rasool mohamadi » Wed May 22, 2019 12:57 am

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.

Tags:

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

Re: getting the force and position in force controller

Post by Dimitar Stanev » Wed May 22, 2019 7:35 am

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

User avatar
mohamad rasool mohamadi
Posts: 14
Joined: Tue Oct 17, 2017 12:59 am

Re: getting the force and position in force controller

Post by mohamad rasool mohamadi » Sun May 26, 2019 3:23 am

thank u so much.
Is there any example including this functions? (I'm not sure how should i write it in c++.)
best regards.

POST REPLY