Skip to content Link Search Menu Expand Document
ModalAI DOCS
Store

Configure Cameras

Set voxl-camera-server up for the cameras plugged into VOXL with voxl-configure-cameras, from a numbered config or a custom one.

Table of contents

  1. Usage
  2. Camera config IDs
    1. Hardware sub-revisions
    2. IMX664 or IMX412 hires
  3. What it does
  4. Custom camera configs
  5. Camera slots
  6. Camera ID, slot, and sensor ID

voxl-configure-cameras tells VOXL which cameras are plugged into which connectors. It ships with voxl-camera-server.

You do not normally run it yourself. voxl-configure-mpa runs it with the camera config from the SKU at the end of every SDK install. If you change the cameras on a drone, the cleanest fix is to update the camera config in the SKU with voxl-configure-sku and run voxl-configure-mpa again. Run voxl-configure-cameras directly to try a config, or on a board without a SKU.

Usage

Run without arguments, it lists the configs for your board and asks for one:

voxl-configure-cameras
CommandEffect
voxl-configure-cameras <id>Set up a numbered config, for example 27 or 46A
voxl-configure-cameras customSet up the custom config in /data/modalai/custom_camera_config.txt (also C)
voxl-configure-cameras <id> disableSet up the config but leave voxl-camera-server disabled
voxl-configure-cameras <id> --dry-runPrint the cameras and drivers the config would use, and change nothing
voxl-configure-cameras helpShow the help text and the config list

Power cycle VOXL after running it. The new camera drivers do not load until a full power cycle.

Camera config IDs

Each numbered config is a known set of sensors on known connectors. The list depends on the board, so run this on VOXL to see the configs for your hardware:

print-camera-configs
  • VOXL 2 and VOXL 2 Mini (M0054, M0104, M0205): the list depends on the platform config in /sys/module/voxl_platform_mod/parameters/config. Platform config 0 is the original breakout-board set (M0074, M0135), 1 is the coax front-end set (M0173, M0181, M226), and 2 is the VOXL 2 Mini set (M0188, M0195).
  • M0197: its own set.

VOXL 2 Camera Configs describes the common configs and their wiring.

Hardware sub-revisions

Some configs have a lettered variant, such as 46A, for a hardware sub-revision. The letter comes from the SKU’s hardware version (V6A gives A), and voxl-configure-mpa adds it to the camera config ID for you. If no lettered config exists, voxl-configure-cameras prints a warning and uses the base config. print-camera-configs lists only the base configs.

IMX664 or IMX412 hires

Configs named “IMX664 or IMX412” work with either hires sensor. voxl-configure-cameras probes the hires slot, installs the driver for the sensor it finds, and falls back to IMX664 if nothing answers. Plug the camera in before you run it.

What it does

  1. Writes /etc/modalai/voxl-camera-server.conf with defaults for every camera in the config.
  2. Sets the frame sync options (fsync_en, fsync_gpio) when the config uses them.
  3. Removes every camera driver (com.qti.sensormodule*) from /usr/lib/camera/ and copies in only the ones the config needs, along with the default ISP tuning file.
  4. Enables the voxl-camera-server service.

Running it again overwrites voxl-camera-server.conf. To change resolutions, encoders, or exposure afterwards, edit that file; see voxl-camera-server.

Custom camera configs

If your cameras do not match a numbered config, describe them in a custom config file instead of editing voxl-camera-server.conf by hand:

cp /usr/share/modalai/voxl-camera-server/custom_camera_config.txt /data/modalai/
vi /data/modalai/custom_camera_config.txt
voxl-configure-cameras custom --dry-run
voxl-configure-cameras custom

The file sets a group of fields for each connector, prefixed with the connector name (J6_LOWER_, J6_UPPER_, and so on; J3_, J4_, J5_ on M0197). The comments at the top of the file list the supported sensor types.

FieldValues
_SENSORSensor type, for example ar0144-fsin-combo or imx412-fpv. Leave empty for an unused connector.
_NAMECamera name, used for the MPA pipe, for example tracking_front
_ROTATEtrue or false to rotate the image 180°. For a stereo pair, first-only or second-only rotates one camera.
_COMBO_MODERequired for combo sensors: left-right or right-left for a stereo pair, independent for two separate cameras, single when only one camera is connected
_NAME2Name of the second camera in independent combo mode
_EXPOSURE_SHARE_CAMCamera ID to copy exposure and gain from, instead of running its own auto-exposure
_ROTATE_IMX412For imx664-or-imx412: rotate value to use when an IMX412 is found

FSYNC_GPIO and FSYNC_EN set frame sync for the whole config. To start from a working example, copy the numbered config closest to your hardware from /usr/share/modalai/voxl-camera-server/standard_configs/ and edit it.

To make the custom config permanent, set the SKU’s camera config to CC, for example MRB-D0005-4-V2-CC. voxl-configure-mpa then uses the custom file.

Camera slots

Each connector is a hardware slot. The custom config file names connectors; debugging tools report slots.

VOXL 2 connectorSlot
J6 lower0
J6 upper1
J7 lower2
J7 upper3
J8 lower4
J8 upper5
J6 lower, second camera of a combo flex (J6_LOWER_COMBO1_)6

With the M0173 front end, as on Starling 2 and Seeker:

M0173 connectorSlotCustom config prefixStarling 2 camera
J10J6_LOWER_Front tracking
J41J6_UPPER_Hires
J52J7_LOWER_Rear tracking
J33J7_UPPER_Time of flight
J26J6_LOWER_COMBO1_Down tracking

VOXL 2 J8 lower and upper (slots 4 and 5) stay free for M0076 or M0135 flexes. J8 upper needs a kernel change with M0173 because of a different reset line mapping. See Coax Camera Bundles for the cables.

Camera ID, slot, and sensor ID

  • Slot ID: the hardware port. It does not change when other cameras are added or removed.
  • Camera ID: the software ID assigned as cameras are probed, starting from 0 with no gaps. Adding a camera can shift the IDs of the others. voxl-configure-cameras assigns them for you.
  • Sensor ID: the value of the sensor’s ID register, read over I2C (CCI) when camera server probes. See Sensor ID to sensor type mapping.