Force value from a Physics Engine

Typically: "How do I... ", "How can I... " questions
Post Reply
antoronson
Posts: 51
Joined: 12 Mar 2015, 14:21

Force value from a Physics Engine

Post 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 ?

coppelia
Site Admin
Posts: 10505
Joined: 14 Dec 2012, 00:25

Re: Force value from a Physics Engine

Post 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

Post Reply