sim.readForceSensor

Reads the force and torque applied to a force sensor (filtered values are read)

Synopsis

int result, list forceVector, list torqueVector = sim.readForceSensor(int objectHandle) int result, float[3] forceVector, float[3] torqueVector = sim.readForceSensor(int objectHandle)

Arguments

  • objectHandle: handle of the object (must be a force sensor). Can be combined with sim.handleflag_rawvalue (simply add sim.handleflag_rawvalue to objectHandle), 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

  • result: bit-coded:
    • bit 0 set (1): force and torque data is available, otherwise it is not (yet) available (e.g. when not enough values are present for the filter)
  • forceVector: array of 3 values (applied forces along the sensor's x, y and z-axes)
  • torqueVector: array of 3 values (applied torques about the sensor's x, y and z-axes)


See also: