score-back/API.md
amukhamadiev e9e15a20a2
Some checks failed
Verification / Is-Buildable (push) Failing after 2m4s
[fix] compilation of this tag on windows
2026-04-14 00:12:16 +03:00

1.9 KiB

JSON-RPC API Documentation

The Cloud Point RPC server implements the JSON-RPC 2.0 protocol over TCP.

NOTE 1: Base64 encoding of data should be implemented on Unity Side.

NOTE 2: Unit Tests were not written for the described API yet

General Format

All requests and responses are JSON objects.

Request

{
  "jsonrpc": "2.0",
  "method": "<method_name>",
  "params": {}, 
  "id": <integer|string>
}

Note: params is currently ignored by the implemented methods but is part of the standard.

Response (Success)

{
  "jsonrpc": "2.0",
  "result": <method_specific_result>,
  "id": <matching_request_id>
}

Response (Error)

{
  "jsonrpc": "2.0",
  "error": {
    "code": <integer>,
    "message": "<string>"
  },
  "id": <matching_request_id>
}

Methods

get-intrinsic-params

Retrieves the intrinsic camera parameters as a flat 3x3 matrix (row-major).

Request:

{
  "jsonrpc": "2.0",
  "method": "get-intrinsic-params",
  "id": 1
}

Response:

{
  "jsonrpc": "2.0",
  "result": <base64-encoded-array>,
  "id": 1
}

Type: vector<double> (size 9) encoded as base64

get-extrinsic-params

Retrieves the extrinsic camera parameters as a flat 4x4 matrix (row-major).

Request:

{
  "jsonrpc": "2.0",
  "method": "get-extrinsic-params",
  "id": 2
}

Response:

{
  "jsonrpc": "2.0",
  "result": <base64-encoded-array>,
  "id": 2
}

Type: vector<double> (size 16) encoded as base64

get-cloud-point

Retrieves the current field of view point cloud.

Request:

{
  "jsonrpc": "2.0",
  "method": "get-cloud-point",
  "id": 3
}

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "width": int,
    "height": int,
    "data": <base64-encoded-array>
  },
  "id": 3
}

Type of data: matrix WxH (List of [x, y, z] points) encoded as base 64