sim.getJointForce

Retrieves the force or torque applied to a joint along/about its active axis. This function retrieves meaningful information only if the joint is prismatic or revolute, and is dynamically enabled. With the Bullet, MuJoCo and Newton engine, this function returns the force or torque applied to the joint motor (torques from joint limits are not taken into account). With the ODE and Vortex engine, this function returns the total force or torque applied to a joint along/about its z-axis

Synopsis

float forceOrTorque = sim.getJointForce(int jointHandle) float forceOrTorque = sim.getJointForce(int jointHandle)

Arguments

  • jointHandle: handle of the joint. Can be combined with sim.handleflag_rawvalue (simply add sim.handleflag_rawvalue to jointHandle), if you wish to access the raw values generated by each individual dynamic simulation step (by default, there are 10 dynamic simulation steps for each simulation step). Raw values can only be accessed from inside a callback function triggered by the physics engine.

Return values

  • forceOrTorque: force or the torque applied to the joint along/about its z-axis, or None/nil if no value is available yet.


See also: