Skip to content

OptoFly Documentation

Real-time tracking and closed-loop optogenetic stimulation system for flying insects.

New to OptoFly? Start here.

Getting Started walks through the whole pipeline in order, from a fresh checkout to a running experiment: install, calibrate every camera and the liquid lens, align the arena, bench-test the LED, then run. Each step links to the reference doc below for full detail.

Reference

Document Description
Getting Started Installation, the full calibration pipeline in order, and running experiments
Calibration Every calibration procedure in depth: camera intrinsics, Braid, liquid lens, camera FOV, arena heading
Architecture System architecture, data flow, and ZMQ topology
Visual Stimuli — Panda3D Developer guide for the Panda3D stimulus pipeline (current, used by main.py)
Camera Ximea high-speed camera system
Opto Trigger Arduino LED firmware and serial protocol
Troubleshooting Common issues and fixes

System Overview

OptoFly integrates multiple hardware and software components for automated closed-loop behavioral experiments:

  • Braid Tracking — Real-time 3D fly tracking at 100fps
  • Trigger Handler — Spatial/temporal gating with heading detection
  • Ximea Camera — High-speed (500fps) triggered video recording
  • Optogenetic Trigger — LED stimulation control via Arduino
  • Liquid Lens — Dynamic autofocus with optional predictive tracking
  • Visual Stimuli — Configurable Panda3D patterns (background, looming, oscillating square)
  • Latency Logger — Per-trial end-to-end latency records (latency.csv) for opto, visual, and lens triggers