Page 1 of 1

Force value from a Physics Engine

Posted: 22 Sep 2015, 09:55
by antoronson
Hello all
I got a small query with the force calculated. When my simulation time step is 10ms, the Physics engine runs for 2 times between these time step as per the tutorial. Now each time the force applied is maximum(ref.callback script) and when we request joint force, it returns the actual force. But how is this actual force calculated as we get force only after the physics engine runs min 2 times. Is this force an average or the second applied force. If so what is the case with the first applied force ?

Re: Force value from a Physics Engine

Posted: 23 Sep 2015, 08:31
by coppelia
Hello,

when you read a joint force from a child script, then you will read the average value. In addition, when you read it from the sensing phase, it is the one computed in the current simulation step. If you read it from the actuation phase, it will be the one computed in previous simulation step. Refer to the main script for details on when the physics engine is being called.

When you read a joint force from a joint control callback script, then you will not read an average value, but the force computed in last physics engine calculation step.

Cheers