DAVID4 SDK  1.8.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
JsonRPC protocol specification

Specification of communication protocol between a DAVID client and a DAVID Enterprise Server using JsonRPC remote procedure calls. More...

Namespaces

 david::jsonrpc
 Specifications for DAVID remote procedure calls in JSON RPC 2.0.
 

Enumerations

enum  david::jsonrpc::JsonRpcFunctions {
  david::jsonrpc::david_Connect = 1, david::jsonrpc::david_Disconnect, david::jsonrpc::david_RequestBinaryChannel, david::jsonrpc::david_ShowMainWindow,
  david::jsonrpc::david_HideMainWindow, david::jsonrpc::david_ShowMenus, david::jsonrpc::david_HideMenus, david::jsonrpc::david_StopServer
}
 A list of supported JSON RPC 2.0 functions in namespace david. More...
 
enum  david::jsonrpc::JsonRpcFunctions_sls {
  david::jsonrpc::david_sls_SetScreenID = 300, david::jsonrpc::david_sls_GetAvailableCameraNames, david::jsonrpc::david_sls_SelectCamera, david::jsonrpc::david_sls_CheckCamera,
  david::jsonrpc::david_sls_SetCameraProperty, david::jsonrpc::david_sls_GetCameraProperty, david::jsonrpc::david_sls_GetCameraPropertyNames, david::jsonrpc::david_sls_SelectImageSequence,
  david::jsonrpc::david_sls_GetLiveImage, david::jsonrpc::david_sls_SetCodedLightPhaseShiftMode, david::jsonrpc::david_sls_GetCodedLightPhaseShiftParams, david::jsonrpc::david_sls_SetResultFiltering,
  david::jsonrpc::david_sls_GetResultFiltering, david::jsonrpc::david_sls_ImportCalibration, david::jsonrpc::david_sls_ExportCalibration, david::jsonrpc::david_sls_Calibrate,
  david::jsonrpc::david_sls_Scan, david::jsonrpc::david_sls_GrabTexture, david::jsonrpc::david_sls_AutoWhiteBalance, david::jsonrpc::david_sls_AddScanToShapeFusion,
  david::jsonrpc::david_sls_ExportMesh, david::jsonrpc::david_sls_ExportBackgroundDepthmap, david::jsonrpc::david_sls_ImportBackgroundDepthmap
}
 A list of supported JSON RPC 2.0 functions in namespace david::sls. More...
 
enum  david::jsonrpc::JsonRpcFunctions_turntable { david::jsonrpc::david_turntable_Setup = 400, david::jsonrpc::david_turntable_Rotate }
 A list of supported JSON RPC 2.0 functions in namespace david::turntable. More...
 
enum  david::jsonrpc::JsonRpcFunctions_shapefusion {
  david::jsonrpc::david_shapefusion_ImportMesh = 500, david::jsonrpc::david_shapefusion_ExportMesh, david::jsonrpc::david_shapefusion_DuplicateMesh, david::jsonrpc::david_shapefusion_DeleteAllMeshes,
  david::jsonrpc::david_shapefusion_DeleteMesh, david::jsonrpc::david_shapefusion_GetMeshBuffer, david::jsonrpc::david_shapefusion_GetTextureImage, david::jsonrpc::david_shapefusion_GetPose,
  david::jsonrpc::david_shapefusion_SetPose, david::jsonrpc::david_shapefusion_Rotate, david::jsonrpc::david_shapefusion_Translate, david::jsonrpc::david_shapefusion_ReduceMeshDensity,
  david::jsonrpc::david_shapefusion_CombineMeshes, david::jsonrpc::david_shapefusion_UncombineMeshes, david::jsonrpc::david_shapefusion_AlignPairCoarse, david::jsonrpc::david_shapefusion_AlignPairFine,
  david::jsonrpc::david_shapefusion_AlignGlobalFine, david::jsonrpc::david_shapefusion_Fuse
}
 A list of supported JSON RPC 2.0 functions in namespace david::shapefusion. More...
 
enum  david::jsonrpc::JsonRpcFunctions_measure { david::jsonrpc::david_measure_ComputeSurfaceDistances = 600 }
 A list of supported JSON RPC 2.0 functions in namespace david::measure. More...
 

Detailed Description

Specification of communication protocol between a DAVID client and a DAVID Enterprise Server using JsonRPC remote procedure calls.

Enumeration Type Documentation

A list of supported JSON RPC 2.0 functions in namespace david.

Enumerator
david_Connect 

Initializes connection between client and server.

"method": "david::Connect"
--> "params" : {"clientVersion" : double}
<-- "result" : {"serverVersion" : string, "licenseOk" : bool}
<-- "error" : {"code" : int, "message" : string}

Parameters

clientVersion Version of the client software represented as a double (like 1.1).

Return Values

serverVersion Version of the server software.
licenseOk Is license of server ok?

Error Codes

david::Error_RpcClientVersion Client version not compatible.
david_Disconnect 

Informs the server that the client is going to disconnect.

"method": "david::Disconnect"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}
david_RequestBinaryChannel 

Requests IP address and port for setting up a binary channel over TCP/IP.

"method": "david::RequestBinaryChannel"
--> "params" : null
<-- "result" : {"port" : uint16_t}
<-- "error" : {"code" : int, "message" : string}

Return Values

port Server port for the connection of the binary channel.

Error Codes

david::Error_BinarySetup Binary channel not supported.
david_ShowMainWindow 

Shows the main window of DAVID Server.

"method": "david::ShowMainWindow"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}
david_HideMainWindow 

Hides the main window of DAVID Server.

"method": "david::HideMainWindow"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}
david_ShowMenus 

Shows the GUI menus in DAVID Server.

"method": "david::ShowMenus"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}
david_HideMenus 

Hides the GUI menus in DAVID Server.

"method": "david::HideMenus"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}
david_StopServer 

Stops the DAVID SDK Server.

"method": "david::StopServer"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Definition at line 57 of file JsonRpcFunctions.h.

A list of supported JSON RPC 2.0 functions in namespace david::measure.

Enumerator
david_measure_ComputeSurfaceDistances 

Computes signed distance values for each vertex of 'MeasureTestObject' relative to 'MeasureReferenceObject'.

Note: If SDK Server is not licensed, part of the distance values (sent over binary channel) will be ZEROES only.
"method": "david::measure::ComputeSurfaceDistances"
--> "params" : {"meshID1" : int, "meshID2" : int, "distThresh" : double}
<-- "result" : {"vertexCount": uint32_t, "size" : uint32_t}
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID1 ID of the mesh that is the test object.
meshID2 ID of the other mesh that is the reference object.
distThresh Distance threshold: Distance values are limited to the range [-distThresh, distThresh].

Return Values

vertexCount Number of vertices for mesh
size Size of float array in bytes to be transmitted over binary channel.

Error Codes

david::Error_InvalidMeshId One or both of the mesh IDs was invalid.

Definition at line 1338 of file JsonRpcFunctions.h.

A list of supported JSON RPC 2.0 functions in namespace david::shapefusion.

Enumerator
david_shapefusion_ImportMesh 

Imports a mesh into the mesh list from a file given by 'filename'.

See documentation of DAVID software for supported file formats.

Warning
File paths like "c:\\meshes\\myobject.obj" are interpreted as files located on the server. For files located on the client you have to use a shared network path like "\\\\mycomputer\\meshes\\myobject.obj".
"method": "david::shapefusion::ImportMesh"
--> "params" : {"filename" : string}
<-- "result" : int
<-- "error" : {"code" : int, "message" : string}

Parameters

filename Filename of the mesh to be imported.

Return Values

ID of the mesh.

Error Codes

david::Error_NoAccess No access to path.
david::Error_InvalidPath Specified path is invalid.
david::Error_MissingFilename Specified path misses file name.
david::Error_DirectoryNotFound Specified directory does not exist.
david::Error_FileNotFound Specified file does not exist.
david_shapefusion_ExportMesh 

Exports a mesh.

This mesh can be an item of the scan list or the fusion result. Just provide a valid 'meshID'. See documentation of DAVID software for supported file formats. Note: If SDK Server is not licensed, saving will not be possible, and david::Error_NotLicensed will be returned.

Warning
File paths like "c:\\meshes\\myobject.obj" are interpreted as files located on the server. For files located on the client you have to use a shared network path like "\\\\mycomputer\\meshes\\myobject.obj".
"method": "david::shapefusion::ExportMesh"
--> "params" : {"meshID" : int, "filename" : string}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of the mesh to be exported.
filename Filename of the mesh to be exported.

Error Codes

david::Error_NoAccess No access to path.
david::Error_InvalidPath Specified path is invalid.
david::Error_MissingFilename Specified path misses file name.
david::Error_DirectoryNotFound Specified directory does not exist.
david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_NotLicensed SDK Server is not licensed to save.
david_shapefusion_DuplicateMesh 

Duplicate mesh with mesh ID 'sourceMeshID'.

"method": "david::shapefusion::DuplicateMesh"
--> "params" : {"sourceMeshID" : int}
<-- "result" : int
<-- "error" : {"code" : int, "message" : string}

Parameters

sourceMeshID ID of the mesh to be duplicated.

Return Values

ID of the newly created mesh.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david_shapefusion_DeleteAllMeshes 

Deletes all meshes in 'Shape Fusion'.

"method": "david::shapefusion::DeleteAllMeshes"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}
david_shapefusion_DeleteMesh 

Deletes a specific mesh of the mesh list.

"method": "david::shapefusion::DeleteMesh"
--> "params" : {"meshID" : int}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of the mesh.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david_shapefusion_GetMeshBuffer 

Gets a selected data (array buffer like vertex positions) from a specified mesh.

Note: If SDK Server is not licensed, part of the vertex coordinates / normals (sent over binary channel) will be ZEROES only.
"method": "david::shapefusion::GetMeshBuffer"
--> "params" : {"meshID" : int, "bufferType" : string}
<-- "result" : {"vertexCount": uint32_t, "triangleCount:" uint32_t, "size" : uint32_t}
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of the mesh that owns the requested buffer.
bufferType Type of the buffer to be transmitted over binary channel:
VertexPositions Positions of all vertices as float triples (x,y,z).
VertexNormals Normals of all vertices as float triples (nx,ny,nz).
VertexTexCoords Texture coordinates of all vertices as float pairs (u,v).
Triangles Triangle indices (indexed face set) as int32_t triples (id1,id2,id3).
[coordinateSystem] Coordinates should be relative to which coordinate system. World is assumed by default.
WorldCoordinates Coordinates are given with respect to world (global coordinates).
LocalCoordinates Coordinates are given with respect to local object coordinate system.

Return Values

vertexCount Number of vertices for requested mesh.
triangleCount Number of triangles for requested mesh.
size Size of the buffer in bytes to be transmitted over binary channel.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_InvalidArgument Invalid buffer type.
david_shapefusion_GetTextureImage 

Gets the texture image of a mesh as binary data.

Each pixel is represented by 3 bytes in BGR order. The pixels are ordered row by row, from top to bottom, each row from left to right. The data size is (3*width*height) bytes.

"method": "david::shapefusion::GetTextureImage"
--> "params" : {"meshID" : int, "sendData" : bool}
<-- "result" : {"width": uint32_t, "height:" uint32_t, "size" : uint32_t}
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of the mesh that owns the requested buffer.
sendData Send image data over binary channel?

Return Values

width Width of the texture image in [px].
height Height of the texture image in [px].
size Size of the buffer in bytes to be transmitted over binary channel.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_MissingObject Specified mesh has no texture.
david_shapefusion_GetPose 

Gets the current transformation (position+rotation) of a mesh.

Initially, an imported mesh has no transformation. The transformation depends on previous calls of the Align... functions, or the Rotate or Translate functions. The position is returned in vector (px, py, pz). The rotation is returned in three different representations which are equivalent: A rotation matrix (n,o,a), roll-pitch-yaw angles, and a quaternion. Note: If SDK Server is not licensed, this function will return the error code david::Error_NotLicensed.

"method": "david::shapefusion::GetPose"
--> "params" : {"meshID" : int}
<-- "result" : {"px": double, "py": double, "pz": double,
"nx": double, "ny": double, "nz": double,
"ox": double, "oy": double, "oz": double,
"ax": double, "ay": double, "az": double,
"roll": double, "pitch": double, "yaw": double,
"quat0": double, "quat1": double, "quat2": double, "quat3": double}
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of the mesh whose pose to retrieve.

Return Values

px, py, pz position vector of the current mesh pose.
nx, ny, nz 1st column of the rotation matrix.
ox, oy, oz 2nd column of the rotation matrix.
ax, ay, az 3rd column of the rotation matrix.
roll, pitch, yaw roll, pitch, yaw angles in [RAD], assuming this multiplication order: RotZ(yaw)*RotY(pitch)*RotX(roll).
quat0, quat1, quat2, quat3 Quaternion represention of the mesh rotation (quat0 + i*quat1 + j*quat2 + k*quat3).

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_NotLicensed SDK Server is not licensed.
david_shapefusion_SetPose 

Sets the current transformation (position+rotation) of a mesh.

Initially, an imported mesh has no transformation. The transformation depends on previous calls of the Align... functions, or the Rotate or Translate functions. The position is returned in vector (px, py, pz). The rotation is returned in three different representations which are equivalent: A rotation matrix (n,o,a), roll-pitch-yaw angles, and a quaternion. Note: If SDK Server is not licensed, this function will return the error code david::Error_NotLicensed.

"method": "david::shapefusion::SetPose"
--> "params" : {"meshID" : int,
"px": double, "py": double, "pz": double,
"nx": double, "ny": double, "nz": double,
"ox": double, "oy": double, "oz": double,
"ax": double, "ay": double, "az": double}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of the mesh whose pose to retrieve.
px, py, pz position vector of the current mesh pose.
nx, ny, nz 1st column of the rotation matrix.
ox, oy, oz 2nd column of the rotation matrix.
ax, ay, az 3rd column of the rotation matrix.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_NotLicensed SDK Server is not licensed.
david_shapefusion_Rotate 

Rotates a mesh around specified axis by given degrees.

"method": "david::shapefusion::Rotate"
--> "params" : {"meshID" : int, "transformType" : string, "degrees" : double }
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of mesh to be transformed.
transformType Selects axis and coordinate system of rotation:
TransformGlobalX Rotate around global (world) x axis.
TransformGlobalY Rotate around global (world) y axis.
TransformGlobalZ Rotate around global (world) z axis.
TransformMeshX Rotate around mesh's x axis.
TransformMeshY Rotate around mesh's y axis.
TransformMeshZ Rotate around mesh's z axis.
degrees Amount of rotation in degrees

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_InvalidArgument Invalid transform type.
david_shapefusion_Translate 

Translates a mesh along specified axis by given degrees.

"method": "david::shapefusion::Translate"
--> "params" : {"meshID" : int, "transformType" : string, "amount" : double }
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of mesh to be transformed.
transformType Selects axis and coordinate system of translation:
TransformGlobalX Translate along global (world) x axis.
TransformGlobalY Translate along global (world) y axis.
TransformGlobalZ Translate along global (world) z axis.
TransformMeshX Translate along mesh's x axis.
TransformMeshY Translate along mesh's y axis.
TransformMeshZ Translate along mesh's z axis.
amount Amount of translation. Typically in mm.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_RpcInvalidParams Invalid transform type.
david_shapefusion_ReduceMeshDensity 

Reduces the density of a mesh.

"method": "david::shapefusion::ReduceMeshDensity"
--> "params" : {"meshID" : int, "factor" : float }
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of mesh to be reduced.
factor Factor of reduction, between 0 and 1.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_InvalidArgument Invalid factor value.
david_shapefusion_CombineMeshes 

Combines several meshes into one group.

"method": "david::shapefusion::CombineMeshes"
--> "params" : {"meshIDs" : int[]}
<-- "result" : int
<-- "error" : {"code" : int, "message" : string}

Parameters

meshIDs IDs of the meshes to be combined (must contain at least 2 IDs).

Return Values

Mesh ID of the combined mesh.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david::Error_InvalidArgument Invalid number of IDs.
david_shapefusion_UncombineMeshes 

Uncombines a groups of meshes into seperate meshes.

"method": "david::shapefusion::UncombineMeshes"
--> "params" : {"meshID" : int}
<-- "result" : int[]
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID ID of the mesh group to be uncombined.

Return Values

Array of Mesh IDs of the separated meshes.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist, or is no group.
david_shapefusion_AlignPairCoarse 

Coarse alignment of a pair of meshes.

"method": "david::shapefusion::AlignPairCoarse"
--> "params" : {"meshID1" : int,
"meshID2" : int,
"texturePercentage" : int,
"motionInfo" : {"angleKnown" : bool,
"axisDirKnown" : bool,
"angle" : double,
"angleTolerance" : double,
"axisDir" : [double,double,double]},
"qualityFactor" : float }
<-- "result" : double
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID1 ID of the mesh that is to be aligned.
meshID2 ID of the other mesh.
[texturePercentage] Percentage of texture influence on alignment (0-99). Only used if value is higher than 0 [optional, default 0].
[motionInfo] MotionInfo: Additional information about motion between two meshes [optional].
angleKnown Is rotation 'angle' around motion axis known?
axisDirKnown Is direction vector 'axisDir' of motion axis is known?
angle Angle of rotation in degrees.
angleTolerance Tolerance of angle in degrees.
axisDir 3D direction vector (x,y,z) of motion axis w.r.t. world coordinates.
[qualityFactor] Quality parameter for alignment. 1 is recommended. Larger values like 5 or 10 may create better results for symmetric objects, but increase computation time. Lower values like 0.01 to 0.1 decrease computation time, but may result in wrong alignment results [optional, default 1].

Return Values

Quality of alignment result as percentage of contact, in range [0,100]=[bad,good].

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david_shapefusion_AlignPairFine 

Fine alignment of a pair of meshes.

"method": "david::shapefusion::AlignPairFine"
--> "params" : {"meshID1" : int, "meshID2" : int, "texturePercentage" : int, "maxNumIterations" : int}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

meshID1 ID of the mesh that is to be aligned.
meshID2 ID of the other mesh.
[texturePercentage] Percentage of texture influence on alignment (0-99). Only used if value is higher than 0 [optional, default 0].
[maxNumIterations] Maximum number of iterations to run [optional, default 100].
[maxTranslation] Maximum allowed drift[mm] of mesh center [optional, default = 0 = no limit]. Alignment will stop when this limit is reached.
[maxRotation_deg] Maximum allowed rotation of mesh in degree [optional, default = 0 = no limit]. Alignment will stop when this limit is reached.

Error Codes

david::Error_InvalidMeshId Specified meshID does not exist.
david_shapefusion_AlignGlobalFine 

Global fine alignment of all visible meshes.

"method": "david::shapefusion::AlignGlobalFine"
--> "params" : {"texturePercentage" : int, "numIterations" : int}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

[texturePercentage] Percentage of texture influence on alignment (only used if value is higher than 0 [optional, default 0].
[numIterations] Number of iterations to run [optional, default 20].
[maxTranslation] Maximum allowed drift[mm] of any mesh center [optional, default = 0 = no limit]. Global Fine Alignment will not rotate any scan more than this.
[maxRotation_deg] Maximum allowed rotation[deg] of any mesh in degree [optional, default = 0 = no limit]. Global Fine Alignment will not rotate any scan more than this.
david_shapefusion_Fuse 

Fuses all visible meshes of the mesh list.

"method": "david::shapefusion::Fuse"
--> "params" : {"resolution" : int, "closeHoles" : bool, "sharpness" : int}
<-- "result" : int
<-- "error" : {"code" : int, "message" : string}

Parameters

resolution Limits the maximum resolution and thus the required memory usage.
holeSizeThresRel Holes, which have a smaller area than holeSizeThresRel * size of original data surface, will be closed. 0 = open all holes. 1 = close all holes.
sharpness Fusion sharpness in [-3,+5]. Negative values for smoothing. Default 1.

Return Values

Mesh ID of the fusion result.

Definition at line 805 of file JsonRpcFunctions.h.

A list of supported JSON RPC 2.0 functions in namespace david::sls.

Enumerator
david_sls_SetScreenID 

Sets the new screen ID.

"method": "david::sls::SetScreenID"
--> "params" : {"screenID" : int}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

screenID ID of the screen used for displaying structured light patterns, or 0 for OFF.

Error Codes

david::Error_InvalidArgument Invalid screen ID.
david_sls_GetAvailableCameraNames 

Gets a list of available cameras.

"method": "david::sls::GetAvailableCameraNames"
--> "params" : null
<-- "result" : {"names" : string[]}
<-- "error" : {"code" : int, "message" : string}

Return Values

names Array of strings, containing the names of the cameras.
david_sls_SelectCamera 

Selects a new camera.

Note: For using pre-recorded image files, please see david::sls::SelectImageSequence.
"method": "david::sls::SelectCamera"
--> "params" : {"cameraName" : string, "format" : {"width" : uint32_t, "height" : uint32_t, "fps" : double, "pixelFormat" : string}}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

cameraName Name of the camera.
[imageFormat] Desired camera format [optional].
width Desired width. Set 0 for default.
height Desired height. Set 0 for default.
fps Desired frames per second. Set 0 for default.
pixelFormat Pixel format type:
Default Use default pixel format.
Y800 Standard 8bit grayscale format.
BY8 Standard 8bit Bayer format.
RGB24 Red, green, and blue 8bit color components for each pixel.
YUY2 16bit color format. Byte 0=8-bit Y'0; Byte 1=8-bit Cb; Byte 2=8-bit Y'1; Byte 3=8-bit Cr.

Error Codes

david::Error_DeviceNotAvailable Selected camera is not available.
david::Error_FormatNotAvailable Selected camera image format is invalid.
david_sls_CheckCamera 

Checks the state of the camera.

"method": "david::sls::CheckCamera"
--> "params" : null
<-- "result" : bool
<-- "error" : {"code" : int, "message" : string}

Return Values

true Camera is connected and is working correctly.
false Camera is not working correctly or camera is not connected.
david_sls_SetCameraProperty 

Sets the camera property 'propertyName'.

"method": "david::sls::SetCameraProperty"
--> "params" : {"propertyName" : string, "value" : double, "usage" : string}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

propertyName Name of camera property.
value New value of the property.
[usage] Usage for camera property. If usage is omitted, property value is set for all cases.
Scanning Property should be used for scanning only.
Texturing Property should be used for texturing only.

Error Codes

david::Error_DeviceNotAvailable Selected camera is not available.
david::Error_InvalidArgument Invalid property or property is not available.
david_sls_GetCameraProperty 

Gets the camera property 'propertyName'.

"method": "david::sls::GetCameraProperty"
--> "params" : {"propertyName" : string, "usage" : string}
<-- "result" : {"value" : double}
<-- "error" : {"code" : int, "message" : string}

Parameters

propertyName Name of camera property.
usage Usage for camera property. If usage is omitted, property value is set for all cases.
Scanning Property should be used for scanning only.
Texturing Property should be used for texturing only.

Error Codes

david::Error_DeviceNotAvailable Selected camera is not available.
david::Error_InvalidArgument Invalid property or property is not available.

Return Values

value Value of the property.
david_sls_GetCameraPropertyNames 

Gets a list of camera property names.

This list may depend on the used camera.

"method": "david::sls::GetCameraPropertyNames"
--> "params" : {"onlyAvailable" : bool}
<-- "result" : {"names" : string[]}
<-- "error" : {"code" : int, "message" : string}

Return Values

names Array of strings, containing the names of camera properties.
david_sls_SelectImageSequence 

Selects a sequence of image files as "virtual camera".

All images must be located in the same directory. The image file names are chosen automatically:

Image for camera calibration File name must contain "cam_calib"
Pattern images File names must contain "image" and be sorted alphabetically.
Texture image File name must contain "texture"
"method": "david::sls::SelectImageSequence"
--> "params" : {"directory" : string}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

directory Path to the image files.

Error Codes

david::Error_InvalidPath Path invalid.
david::Error_DirectoryNotFound Directory does not exist.
david::Error_DeviceNotAvailable Could not read image sequence.
david_sls_GetLiveImage 

Gets the current grayscale live image from the camera.

"method": "david::sls::GetLiveImage"
--> "params" : null
<-- "result" : {"width" : int, "height" : int, "size" : uint32_t}
<-- "error" : {"code" : int, "message" : string}

Return Values

width Width of the camera image.
height Height of the camera image.
size Size of the pixel buffer in bytes to be transmitted over binary channel.

Error Codes

david::Error_NoLiveImage Live image is not available.
david_sls_SetCodedLightPhaseShiftMode 

Selects scan mode Coded Light + Phase Shift (standard DAVID4 mode) and sets the parameters.

Missing parameters will remain unchanged.
"method": "david::sls::SetCodedLightPhaseShiftMode"
--> "params" : {"inverse" : bool, "shifts" : int, "orientation" : string, "brightness" : int, "noiseReduction" : int}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

[frequencies] Number of pattern frequencies. Default is 0 == auto.
[inverse] Use inverse Coded Light patterns [true|false]. Doubles the amount of Coded Light patterns.
[shifts] Number of sine patterns (Phase Shift shifts) [3-16].
[orientation] Orientation of SL patterns
horizontal Patterns for horizontal setups only (projector and camera are next to each other).
vertical Patterns for vertical setups only (projector and camera are above each other).
both Both pattern orientations (projector and camera are located diagonally).
[brightness] Brightness of the projected patterns [0-255]. Default is [255].
[color] Color of SL patterns. Default is white.
white White (default).
red Red.
green Green.
blue Blue.
[noiseReduction] Amount of noise reduction [0-5].
david_sls_GetCodedLightPhaseShiftParams 

Gets current SLS params for Coded Light and Phase Shift.

"method": "david::sls::GetCodedLightPhaseShiftParams"
--> "params" : null
<-- "result" : {"inverse" : bool, "shifts" : int, "orientation" : string, "brightness" : int, "noiseReduction" : int}
<-- "error" : {"code" : int, "message" : string}

Return Values

inverse Use inverse Coded Light patterns [true|false]. Doubles the amount of Coded Light patterns.
shifts Number of sine patterns (Phase Shift shifts) [3-16].
orientation Orientation of SL patterns
horizontal Patterns for horizontal setups only (projector and camera are next to each other).
vertical Patterns for vertical setups only (projector and camera are above each other).
both Both pattern orientations (projector and camera are located diagonally).
brightness Brightness of the projected patterns [0-255].
noiseReduction Amount of noise reduction [0-5].

s

david_sls_SetResultFiltering 

Sets the result filtering parameters for SL scans.

"method": "david::sls::SetResultFiltering"
--> "params" : {"qualityCheck" : double, "backgroundRemovalEnabled" : bool, "backgroundRemovalEpsilon" : double}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

qualityCheck Quality threshold for 3D data in [0,1] [optional; default: keep current setting].
backgroundRemovalEnabled Enable background removal true/false [optional; default: keep current setting].
backgroundRemovalEpsilon Background removal epsilon in [mm] [optional; default: keep current setting].
outlierRemoval Outlier filter [0,1]. E.g. 0.1=remove all fragments that are smaller than 10% of the largest fragment. [optional; default: keep current setting].
david_sls_GetResultFiltering 

Gets the result filtering parameters for SL scans.

"method": "david::sls::GetResultFiltering"
--> "params" : null
<-- "result" : {"qualityCheck" : double, "backgroundRemovalEnabled" : bool, "backgroundRemovalEpsilon" : double}
<-- "error" : {"code" : int, "message" : string}

Return Values

qualityCheck Quality threshold for 3D data [0,1].
backgroundRemovalEnabled Enable background removal true/false.
backgroundRemovalEpsilon Background removal epsilon in [mm]
outlierRemoval Outlier filter value in [0,1].
david_sls_ImportCalibration 

Imports calibration parameters of camera and projector from an XML files.

Warning
File paths like "c:\\david\\camera.cal" are interpreted as files located on the server. For files located on the client you have to use a shared network path like "\\\\mycomputer\\david\\camera.cal".
"method": "david::sls::ImportCalibration"
--> "params" : {"cameraCalibrationFilename" : string, "projectorCalibrationFilename" : string}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

cameraCalibrationFilename Filename for importing the camera calibration.
projectorCalibrationFilename Filename for importing the projector calibration.

Error Codes

david::Error_CameraCalibration Could not read camera calibration file.
david::Error_ProjectorCalibration Could not read projector calibration file.
david_sls_ExportCalibration 

Exports the current calibration parameters of camera and projector to XML files.

Warning
File paths like "c:\\david\\camera.cal" are interpreted as files located on the server. For files located on the client you have to use a shared network path like "\\\\mycomputer\\david\\camera.cal".
"method": "david::sls::ExportCalibration"
--> "params" : {"cameraCalibrationFilename" : string, "projectorCalibrationFilename" : string}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

cameraCalibrationFilename Filename for the exported camera calibration.
projectorCalibrationFilename Filename for the exported projector calibration.

Error Codes

david::Error_NotCalibrated Scanner is not calibrated.
david_sls_Calibrate 

Triggers automatic calibration of the Structured Light Scanner.

The function returns when calibration is finished or an error occurred.

"method": "david::sls::Calibrate"
--> "params" : {"calibScale" : double}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

calibScale Scale of the calibration pattern. Typically in mm.

Error Codes

david::Error_CameraCalibration Camera calibration failed.
david::Error_ProjectorCalibration Projector calibration failed.
david::Error_NoLiveImage Camera/Grabber is not running.
david_sls_Scan 

Triggers a Structured Light Scan.

The function returns when scanning is finished or an error occurred.

"method": "david::sls::Scan"
--> "params" : {"grabTexture" : bool, "setAsBackground" : bool}
<-- "result" : int
<-- "error" : {"code" : int, "message" : string}

Parameters

[grabTexture] Grab a texture with the scan? [optional, default false]
[setAsBackground] Define the new scan as background, for Background Removal (see SetResultFiltering) [optional, default false]

Return Values

Number of triangulated 3D points.

Error Codes

david::Error_NotCalibrated Cannot scan because scanner is not calibrated.
david::Error_NoLiveImage Camera/Grabber is not running.
david_sls_GrabTexture 

Grabs a new texture.

"method": "david::sls::GrabTexture"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Error Codes

david::Error_NoLiveImage Camera/Grabber is not running.
david_sls_AutoWhiteBalance 

Executes an auto white balancing procedure.

"method": "david::sls::AutoWhiteBalance"
--> "params" : null
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Error Codes

david::Error_NoLiveImage Camera/Grabber is not running.
david_sls_AddScanToShapeFusion 

Adds the current scan to 'Shape Fusion' module.

"method": "david::sls::AddScanToShapeFusion"
--> "params" : null
<-- "result" : int
<-- "error" : {"code" : int, "message" : string}

Return Values

ID of the mesh.

Error Codes

david::Error_MissingObject No scan data at hand.
david_sls_ExportMesh 

Exports the scan as a mesh.

See documentation of DAVID software for supported file formats. Note: If SDK Server is not licensed, the resulting OBJ file will have reduced mesh resolution (like Free Edition).

Warning
File paths like "c:\\meshes\\myobject.obj" are interpreted as files located on the server. For files located on the client you have to use a shared network path like "\\\\mycomputer\\meshes\\myobject.obj".
"method": "david::sls::ExportMesh"
--> "params" : {"filename" : string}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

filename Filename of the mesh to be exported.

Error Codes

david::Error_InvalidPath Export path invalid.
david::Error_DirectoryNotFound Export target directory does not exist.
david::Error_MissingFilename Export path misses file name.
david::Error_MissingObject No scan data at hand.
david_sls_ExportBackgroundDepthmap 

Exports the current background scan as depthmap (PFM file).

Note: If SDK Server is not licensed, this function will not run.
Warning
File paths like "c:\\meshes\\background.pfm" are interpreted as files located on the server. For files located on the client you have to use a shared network path like "\\\\mycomputer\\meshes\\background.pfm".
"method": "david::sls::ExportBackgroundDepthmap"
--> "params" : {"filename" : string}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

filename Filename of the depthmap to be exported (must end with .pfm).

Error Codes

david::Error_InvalidPath Export path invalid.
david::Error_DirectoryNotFound Export target directory does not exist.
david::Error_MissingFilename Export path misses file name.
david::Error_MissingObject No background data at hand.
david::Error_NotLicensed SDK Server is not licensed to save.
david_sls_ImportBackgroundDepthmap 

Imports a background scan from a depthmap (PFM file).

Warning
File paths like "c:\\meshes\\background.pfm" are interpreted as files located on the server. For files located on the client you have to use a shared network path like "\\\\mycomputer\\meshes\\background.pfm".
"method": "david::sls::ImportBackgroundDepthmap"
--> "params" : {"filename" : string}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

filename Filename of the depthmap to be imported (must end with .pfm).

Error Codes

david::Error_InvalidPath Export path invalid.
david::Error_DirectoryNotFound Export target directory does not exist.
david::Error_MissingFilename Export path misses file name.

Definition at line 185 of file JsonRpcFunctions.h.

A list of supported JSON RPC 2.0 functions in namespace david::turntable.

Enumerator
david_turntable_Setup 

Connects or disconnects a turntable.

"method": "david::turntable::Setup"
--> "params" : {"enable" : bool}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

enable True for connect, false for disconnect.

Error Codes

david::Error_DeviceNotAvailable Turntable not available
david_turntable_Rotate 

Rotates the turntable.

The turntable rotates counterclockwise ('degrees' is postive) or clockwise ('degrees' is negative).

"method": "david::turntable::Rotate"
--> "params" : {"degrees" : double}
<-- "result" : null
<-- "error" : {"code" : int, "message" : string}

Parameters

degrees Amount of rotation in degrees.

Error Codes

david::Error_DeviceNotAvailable Turntable not available
david::Error_Fail Rotation of turntable failed.

Definition at line 755 of file JsonRpcFunctions.h.