Cameras¶
MSW records video through a pluggable camera backend declared per setup under
the cameras: block. Two backends ship:
rce- Raspberry Pi camera ensemble (freely moving rigs): one or more networked RPis each running an RCE agent, coordinated by a conductor. Provided byrpi-camera-ensemble.flir_bonsai- FLIR/Spinnaker cameras driven by Bonsai subprocesses (head-fixed rigs, Windows acquisition machines). Provided bymsw-flir-bonsai.
cameras: null (the default) means no cameras are configured and the task runs
without video.
The full key reference for both backends lives in Setup Config → Camera config. This page is the orientation and per-backend bring-up checklist.
Choosing a backend¶
rce |
flir_bonsai |
|
|---|---|---|
| Typical rig | Freely moving | Head-fixed |
| Hardware | Networked RPis + ribbon cameras | FLIR/Spinnaker cameras on the acquisition PC |
| Sync | TTL barcodes per agent | TTL barcodes; per-camera serial sidecar |
| Driver | RCE agent + conductor | Bonsai workflow subprocess per camera |
RCE bring-up (freely moving)¶
- Flash each RPi and install the RCE agent package; bring each Pi onto the rig network with a known, reserved address (reserved in your lab network config).
- Author the ensemble YAML describing each agent (host, camera id, role) and
place it under
msw_configs/device_configs/cameras/. - Point the setup at it:
configis absolute or relative tomsw_configs/. - Verify GPIO in/out, the agent, and the conductor on each Pi before a session.
Record the physical mapping (camera position ↔ camera id ↔ Pi ↔ network address) for your rigs in your lab's private config repo, not here - it is deployment-specific and not part of the published package.
FLIR + Bonsai bring-up (head-fixed)¶
- Install Bonsai and the Spinnaker/FlyCapture SDK on the acquisition PC.
- Resolve the Bonsai executable:
msw flir find-bonsai(or set theBONSAI_EXEenvironment variable). - List cameras to resolve enumeration indices:
msw flir list-cameras. - Configure the setup: One Bonsai subprocess is launched per camera entry. Per-camera optical parameters (gain, shutter, exposure) are set inside the Bonsai workflow XML, not in this config.
- Smoke-test:
msw flir test-record, then run a task with the backend set.
Enumeration index is not guaranteed stable across reboots; the per-camera
serial is recorded in the FLIR session sidecar
(see Setup Config → FLIR session metadata sidecar).
Synchronisation¶
Both backends rely on TTL barcodes for offline alignment of video against Bpod and ephys: the same 37-bit timestamp pulse train is distributed to each camera backend so frames can be matched to behavioural and electrophysiology streams after acquisition.