Guides / Solved with the SDK

Integrate a new camera

Fit a better camera and gimbal by editing the vehicle profile, not the app.

Available Aerial · Ground Intermediate

The story at a glance

  1. 1 · Mission A sharper camera for a new contract
  2. 2 · Outcome New camera, same software
  3. 3 · Obstacle Every camera streams its own way
  4. 4 · How the SDK solves it Edit the profile, not the app

1 · The mission

An inspection company's client wants sharper images from a better camera on a stabilised gimbal. The brief: new camera, same software, by next week.

2 · The outcome

The camera swap takes a day. Without the SDK, the software swap takes weeks.

The obstacle Without the SDK With the SDK
Time to swap Weeks of software work A day: the hardware only
Codec, port and model Change them in the app Set them in the profile
Gimbal control New code per gimbal Same Gimbal calls
Software versions One per camera One for every camera
Unsupported camera Write and maintain a driver Ask us to add it

Why this works: the hardware is described once, in data. The code depends on what the robot can do, not which brand of camera is fitted.

The brief is met: the new camera and gimbal fly by next week, on the app the team already uses.

3 · The obstacle

Every camera streams its own way, and every gimbal is controlled differently. Without the SDK:

  • Every codec, port and model the app assumes has to change
  • A new gimbal means new control code
  • Each camera needs its own software version

4 · How the SDK solves it

The camera lives in the vehicle's profile. Its type picks the SDK adapter, so Camera and Gimbal work the same for every camera. Not supported yet? Ask us to add it.

  1. Set the camera's type and codec in the Dashboard. The app reads them from the profile.
  2. CSI, USB, RealSense, SIYI or DJI: Camera streams, photographs and records the same way.
  3. Commands a gimbal can't use are ignored, not errors.
camera_capture.cpp
// No camera model named anywhere
Camera* cam = vehicle->GetCamera(0);
cam->SetCodec(vehicle->GetCameraConfig(0).codec);
cam->Start();  // receives on UDP 5600

Camera::Status s = cam->GetStatus();
// s.kind: CSI, USB, RealSense, SIYI, DJI ...
cam->TakePhoto();  // same for every camera

auto& gimbal = vehicle->GetGimbal();
if (gimbal.IsAvailable())
    gimbal.SetAttitude(-45.0F, 0.0F, 0.0F);

The camera profile

Pick a camera to see its block in the vehicle profile and what it supports. Only this block changes; the code above stays the same.

CSI camera

CsiCamera

identity.json · CSI camera
"cameras": [
  {
    "id": "csi_camera",
    "type": "CsiCamera",
    "csi_port": "cam1",
    "primary": false,
    "width": 1920,
    "height": 1080,
    "framerate": 30,
    "video_codec": "H264",
    "bitrate_kbps": 5000,
    "preview_width": 1920,
    "preview_height": 1080,
    "preview_framerate": 10,
    "preview_bitrate_kbps": 1500
  }
]
Works with
BotsU IMX412 CSI camera, Raspberry Pi Camera v1 (OV5647)
Runs on
Raspberry Pi 5, NVIDIA Jetson Xavier NX
Needs
GStreamer

USB / UVC camera

UsbCamera

identity.json · USB / UVC camera
"cameras": [
  {
    "id": "usb_camera",
    "type": "UsbCamera",
    "primary": false,
    "width": 1920,
    "height": 1080,
    "framerate": 30,
    "video_codec": "H264",
    "bitrate_kbps": 5000,
    "preview_width": 1920,
    "preview_height": 1080,
    "preview_framerate": 10,
    "preview_bitrate_kbps": 1500
  }
]
Runs on
Raspberry Pi 5, NVIDIA Jetson Xavier NX, Linux PC (x86_64)
Needs
GStreamer

Intel RealSense D4xx

RealsenseStreamingCamera

identity.json · Intel RealSense D4xx
"cameras": [
  {
    "id": "realsense",
    "type": "RealsenseStreamingCamera",
    "video_codec": "H264",
    "width": 640,
    "height": 480,
    "framerate": 15,
    "bitrate_kbps": 3000,
    "depth_width": 640,
    "depth_height": 480,
    "depth_framerate": 15,
    "align_depth_to_color": true,
    "cloud_emit_rgb": true,
    "primary": false
  }
]
Works with
Intel RealSense D435i, Intel RealSense D455, Intel RealSense D456
Runs on
Raspberry Pi 5, NVIDIA Jetson Xavier NX, Android device (DJI RC / phone), Linux PC (x86_64)
Needs
GStreamer, librealsense2
Setup notes
Colour goes to the operator's video; depth, point cloud and IMU go to the perception service, which you configure separately.

SIYI A8 Mini camera

SiyiCamera

identity.json · SIYI A8 Mini camera
"cameras": [
  {
    "id": "siyi_a8",
    "type": "SiyiCamera",
    "primary": false,
    "width": 1920,
    "height": 1080,
    "framerate": 30,
    "video_codec": "H264",
    "bitrate_kbps": 5000,
    "preview_width": 1920,
    "preview_height": 1080,
    "preview_framerate": 10,
    "preview_bitrate_kbps": 1500,
    "gimbal": {
      "type": "SiyiA8Mini"
    }
  }
]
Works with
SIYI A8 Mini
Runs on
Raspberry Pi 5, NVIDIA Jetson Xavier NX, Linux PC (x86_64)
Needs
GStreamer

5 · Try it yourself

Run sample 01 with your own camera

Same sample, any camera: no codec, port or gimbal code to change, and one software version for all of them. Uses Camera, Gimbal and PayloadController. Set up your vehicle with Defining Your Vehicle in the Dashboard.

Get sample 01 Ask us to add hardware

← All guides