Regular API function

simGetVisionSensorDepthBuffer / sim.getVisionSensorDepthBuffer

Description Deprecated. Use sim.getVisionSensorDepth instead
C/C++
synopsis
simFloat* simGetVisionSensorDepthBuffer(simInt sensorHandle)
C/C++
parameters
sensorHandle: handle of the vision sensor. Can be combined with sim.handleflag_depthbuffermeters (simply add sim.handleflag_depthbuffermeters to sensorHandle), if you wish to retrieve values in meters.
C/C++
return value
depth buffer (buffer size is resolutionX*resolutionY) or nullptr in case of an error. The user is in charge of releasing the returned buffer with simReleaseBuffer. Returned values are in the range of 0-1 (0=closest to sensor (i.e. close clipping plane), 1=farthest from sensor (i.e. far clipping plane)). If the sim.handleflag_depthbuffermeters was specified, then individual values are expressed as distances in terms of meters.
Lua
synopsis
float[]/buffer depthBuffer=sim.getVisionSensorDepthBuffer(int sensorHandle,int posX=0,int posY=0,int sizeX=0,int sizeY=0)
Lua
parameters
sensorHandle: same as for the C function. Additionally, can also be combined with sim.handleflag_codedstring (simply add sim.handleflag_codedstring to sensorHandle), if you wish to retrieve a string buffer (sim.buffer_float) instead of a table. In that case, refer also to sim.transformBuffer.
posX / posY: position of the depth buffer portion to retrieve. Zero by default.
sizeX / sizeY: size of the depth buffer portion to retrieve. Zero by default, which means that the full depth buffer should be retrieved
Lua
return values
depthBuffer: table containing depth values (sizeX*sizeY), or a string containing coded depth values. Returned values are in the range of 0-1 (0=closest to sensor (i.e. close clipping plane), 1=farthest from sensor (i.e. far clipping plane)). If the sim.handleflag_depthbuffermeters was specified, then individual values are expressed as distances in meters.
Python
synopsis
list/bytes depthBuffer=sim.getVisionSensorDepthBuffer(int sensorHandle,int posX=0,int posY=0,int sizeX=0,int sizeY=0)