Regular API function

simCreateForceSensor / sim.createForceSensor

Description Creates a force sensor.
C/C++
synopsis
simInt simCreateForceSensor(simInt options,const simInt* intParams,const simFloat* floatParams,const float* reserved)
C/C++
parameters
options: bit-coded options:
bit 0 set (1): force threshold enabled
bit 1 set (2): torque threshold enabled
intParams (input): 5 integer parameters:
intParams[0]: filter type (0=average, 1=median)
intParams[1]: value count the filter operates on
intParams[2]: number of consecutive threshold violation for the sensor to break
intParams[3]: reserved. Set to 0
intParams[4]: reserved. Set to 0
floatParams (input): 5 floating point parameters:
floatParams[0]: sensor size
floatParams[1]: force threshold value
floatParams[2]: torque threshold value
floatParams[3]: reserved. Set to 0.0
floatParams[4]: reserved. Set to 0.0
reserved: set to nullptr
C/C++
return value
-1 if operation was not successful, otherwise the handle of the force sensor
Lua
synopsis
int sensorHandle=sim.createForceSensor(int options,int[5] intParams,float[5] floatParams)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Similar to the C-function counterpart
Python
synopsis
int sensorHandle=sim.createForceSensor(int options,list intParams,list floatParams)