Does joint::GetForce retrieve the total force applied on a joint ?

asked 2019-10-29 04:08:30 -0600

Clément Rolinat gravatar image

I'm not sure to understand the returned value of joint::GetForce(). It seems to be a recurrent question, but the other questions related to this method are quite old and sometime don't have any answer.

Does GetForce() return the total force applied on the joint during the previous timestep ? Or does it return the current accumulated force on the joint during the current timestep, but may be different from the total force if a force is added after the call to GetForce() ? Or does it return something else ?

I need to simulate a joint torque servoing, so I need to know somehow the total torque applied on the joint at each timestep. Maybe I should use an other function ?

I am using Gazebo 9.11 with DART physics engine.

Thank you for your answers.

edit retag flag offensive close merge delete


From what I've learn during some tests, it returns (at least during callback bound to ConnectWorldUpdateBegin event) accumulated force. Solution may be load this plugin as last or use ConnectWorldUpdateEnd.

m.bahno gravatar imagem.bahno ( 2022-03-08 08:33:47 -0600 )edit