Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Vehicle and camera (port 5000)

These endpoints belong to the legacy API on port 5000. They may be replaced by v2 endpoints in a later release. Responses use the port 5000 format: check that code is SUCCESS.

Cyclops needs two configurations: a vehicle configuration, which describes how the camera is mounted relative to the flight controller, and a camera calibration. Use these endpoints to read, upload, and select them.

The easiest way to create both is in Vozilla. See Vehicle configuration and Camera calibration. The endpoints below let your GCS install and select configurations you already have.

Method
Path
Purpose

GET

/api/vehicle/list

List vehicle configurations

GET

/api/vehicle/current

Read the active vehicle configuration

POST

/api/vehicle/upload

Upload a vehicle configuration

POST

/api/vehicle/set

Select the active vehicle configuration

GET

/api/camera/list

List camera calibrations

GET

/api/camera/current

Read the active camera calibration

POST

/api/camera/upload

Upload a camera calibration

POST

/api/camera/set

Select the active camera calibration

All paths are on port 5000, for example http://192.168.218.100:5000/api/vehicle/list.

Vehicle configurations

List vehicle configurations

GET /api/vehicle/list

{
  "code": "SUCCESS",
  "data": [
    {
      "name": "my_quad",
      "is_system": false,
      "b_T_vb": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
    }
  ]
}
Field
Description

name

Configuration name. Use it to select the configuration.

is_system

true for configurations installed with Cyclops, false for uploaded ones.

b_T_vb

Camera mount transform. See Vehicle configuration file.

Read the active vehicle configuration

GET /api/vehicle/current

current_vehicle is null when none is selected.

Vehicle configuration file

A YAML file. The key Cyclops needs is b_T_vb: 16 numbers that form a 4×4 transform in row-major order. The top-left 3×3 block is the camera rotation and the last column holds the camera position in meters. It describes the camera mount relative to the flight controller, in the flight controller's North-East-Down frame.

Create the values with the Vehicles page in Vozilla, then read them back with GET /api/vehicle/list. Do not derive them by hand.

Upload a vehicle configuration

POST /api/vehicle/upload

The request body is the file content. Send the file name in a filename header, and set Content-Type to application/json or application/octet-stream. Do not send it as a form. It must end in .yaml, and the part before .yaml becomes the configuration name. JSON is valid YAML, so you can also send the content as JSON.

Uploading does not select the configuration. An upload with the same name replaces the existing file. The device only checks that the file is valid YAML, so check the values before you select it.

Status
Cause

400

The filename header is missing, or the name does not end in .yaml.

500

The file is not valid YAML, or it could not be saved. message explains why.

Select the active vehicle configuration

POST /api/vehicle/set

Field
Type
Description

params

string

Configuration name. Required.

Set your HTTP client timeout to at least 90 seconds.

Status
Cause

400

params is missing.

404

No configuration with that name exists.

500

The configuration was selected, but Cyclops did not restart. Restart it with POST /api/v2/services/cyclops/restart.

Camera calibrations

List camera calibrations

GET /api/camera/list

Read the active camera calibration

GET /api/camera/current

current_camera is null when none is selected.

Upload a camera calibration

POST /api/camera/upload

Send the calibration as JSON with Content-Type: application/json.

Field
Type
Description

name

string

Calibration name. Required.

resolution

object

width and height of the camera image, in pixels. Required.

intrinsics

object

fx, fy, cx, cy, k1, k2, k3, k4, as produced by the calibration tools. Required. See Manual camera calibration for an example.

extrinsics

object

Camera orientation block. Required. Copy it from an existing calibration in GET /api/camera/list.

distortion_model

string

fisheye_kb4 (default) or pinhole_radtan. Optional.

The device checks the calibration before saving it. Uploading does not select the calibration. An upload with the same name replaces the existing calibration.

If the check fails, the response is HTTP 400 and lists the problems:

Select the active camera calibration

POST /api/camera/set

Field
Type
Description

params

string

Calibration name. Required.

Status
Cause

400

params is missing.

404

No calibration with that name exists.

409

The calibration does not match the connected camera, for example a different resolution. The response lists the problems in the same format as a failed upload.

500

The camera stream did not restart.

Last updated