03 Multi-Camera Control Tutorial

Learn how to build a C++ application that simultaneously controls multiple Sol3 camera modules with synchronized settings.

Prerequisites

Overview

This tutorial shows how to build and deploy a multi-camera control application that runs on Sol3 hardware to configure and synchronize multiple cameras simultaneously.

Important

This application runs on the Sol3 device, not on your development machine. It requires deploying the application container to Sol3 hardware following the deployment workflow.

Tutorial Code

The SDK includes a complete multi-camera control tutorial at:

sol3-sdk/apps/tutorials/03_multi_camera_control.cpp

Note

This tutorial requires Sol3 hardware. The x64 mock camera server (see tutorial 01) serves only a single camera and cannot exercise the multi-camera flow.

How It Works

The multi-camera control application demonstrates coordinated control of multiple cameras.

The client:

  1. Connects to the camera control shared memory endpoint

  2. Creates control message outputs for each specified camera ID

  3. Configures all cameras with identical settings (exposure, ISO, frame rate)

  4. Publishes control messages simultaneously to all cameras

  5. Supports both periodic capture and single snapshot modes

Build and Deploy

Step 1: Build Application Image

Build the ARM64 container image for Sol3:

sol3_build_app_image tutorial_03_multi_camera_control arm64 --cmake-preset arm64 --tag latest

Step 2: Deploy to Sol3 Device

Deploy the image to your Sol3 device:

sol3_deploy_app_image tutorial-03-multi-camera-control-arm64:latest <USER@HDK_IP>

Step 3: Run on Sol3 Device

SSH to the Sol3 device and run the application.

# SSH to device
ssh <USER@HDK_IP>

# Run the multi-camera control client
docker run --rm \
  -v /run/sol3:/run/sol3 \
  -v /dev:/dev \
  --privileged \
  localhost:5000/tutorial-03-multi-camera-control-arm64:latest <ARGS>

Usage Examples

All commands below run on the Sol3 device after SSH connection.

For brevity, the commands below use <MULTI-CAMERA-CMD> to represent:

docker run --rm \
  -v /run/sol3:/run/sol3 \
  -v /dev:/dev \
  --privileged \
  localhost:5000/tutorial-03-multi-camera-control-arm64:latest <ARGS>

Control Two Cameras

Configure cameras 1 and 2 at 5 FPS with default settings:

<MULTI-CAMERA-CMD> --camid 1 2 --fps 5

Control Multiple Cameras with Custom Settings

Set cameras 1, 2, and 3 with specific exposure and ISO:

<MULTI-CAMERA-CMD> --camid 1 2 3 --fps 10 --exposure_ns 20000000 --iso 400

Synchronized Snapshot

Capture a synchronized snapshot from all cameras at a specific time:

<MULTI-CAMERA-CMD> --camid 1 2 --abs-time $(date -d '+5 seconds' +%s)

High Frame Rate Capture

Configure multiple cameras for high-speed capture:

<MULTI-CAMERA-CMD> --camid 1 2 3 --fps 30 --exposure_ns 5000000 --iso 800