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
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
| Command | Effect |
|---|---|
voxl-configure-cameras <id> | Set up a numbered config, for example 27 or 46A |
voxl-configure-cameras custom | Set up the custom config in /data/modalai/custom_camera_config.txt (also C) |
voxl-configure-cameras <id> disable | Set up the config but leave voxl-camera-server disabled |
voxl-configure-cameras <id> --dry-run | Print the cameras and drivers the config would use, and change nothing |
voxl-configure-cameras help | Show 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
- Writes
/etc/modalai/voxl-camera-server.confwith defaults for every camera in the config. - Sets the frame sync options (
fsync_en,fsync_gpio) when the config uses them. - 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. - 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.
| Field | Values |
|---|---|
_SENSOR | Sensor type, for example ar0144-fsin-combo or imx412-fpv. Leave empty for an unused connector. |
_NAME | Camera name, used for the MPA pipe, for example tracking_front |
_ROTATE | true or false to rotate the image 180°. For a stereo pair, first-only or second-only rotates one camera. |
_COMBO_MODE | Required for combo sensors: left-right or right-left for a stereo pair, independent for two separate cameras, single when only one camera is connected |
_NAME2 | Name of the second camera in independent combo mode |
_EXPOSURE_SHARE_CAM | Camera ID to copy exposure and gain from, instead of running its own auto-exposure |
_ROTATE_IMX412 | For 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 connector | Slot |
|---|---|
| J6 lower | 0 |
| J6 upper | 1 |
| J7 lower | 2 |
| J7 upper | 3 |
| J8 lower | 4 |
| J8 upper | 5 |
J6 lower, second camera of a combo flex (J6_LOWER_COMBO1_) | 6 |
With the M0173 front end, as on Starling 2 and Seeker:
| M0173 connector | Slot | Custom config prefix | Starling 2 camera |
|---|---|---|---|
| J1 | 0 | J6_LOWER_ | Front tracking |
| J4 | 1 | J6_UPPER_ | Hires |
| J5 | 2 | J7_LOWER_ | Rear tracking |
| J3 | 3 | J7_UPPER_ | Time of flight |
| J2 | 6 | J6_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-camerasassigns 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.