Environment Setup
These are things every repo in this project needs. Do this once per machine, before setting up any individual tool.
1. Install uv
uv is the tool all 7 repos use to install their Python dependencies. It
replaces pip and virtual environment management with one command.
curl -LsSf https://astral.sh/uv/install.sh | sh
Confirm it worked:
uv --version
You should see something like uv 0.x.y.
⚠️ Common failure:
uv: command not foundright after installing — the installer addeduvto a directory not yet on your shell'sPATH(the list of folders your terminal searches when you type a command name). Close and reopen your terminal, or runsource ~/.bashrc(or~/.zshrcif you use zsh).
2. Set up a shared source directory
Some repos expect their sibling repos checked out next to them (for example,
liquid-lens-calibration and optofly both load optotune-lens from
../optotune-lens). Clone all repos into the same parent directory:
mkdir -p ~/src
cd ~/src
git clone git@github.com:mpinb/optofly.git
git clone git@github.com:mpinb/optotune-lens.git
git clone git@github.com:mpinb/liquid-lens-calibration.git
git clone git@github.com:mpinb/basler-charuco-calibrator.git
git clone git@github.com:mpinb/ximea-py.git
git clone git@github.com:elhananby/braid-opto-power-measure.git
git clone git@github.com:elhananby/optofly-analysis.git
After this, you should see all seven as sibling folders:
ls ~/src
# basler-charuco-calibrator braid-opto-power-measure liquid-lens-calibration optofly optofly-analysis optotune-lens ximea-py
Note: unlike the other five,
braid-opto-power-measureandoptofly-analysisstill live under a personal GitHub account (elhananby), not thempinborganization — neither has been moved there yet. Neither needs to be a sibling directory for any dependency to resolve either (both have no local path dependencies); cloning them alongside the rest here is just for consistency.⚠️ Common failure:
git cloneasks for a username and password, then fails — you're using the HTTPS URL without credentials set up. Use thegit@github.com:...(SSH) URL shown above, and make sure you've added an SSH key to your GitHub account first (GitHub's own SSH key setup guide covers this).
3. Hardware SDKs
Two repos need vendor SDKs installed system-wide (not through uv) before
uv sync will fully work. On a completely fresh machine, neither SDK is
installed yet — do both of these before anything else in this section.
- Basler Pylon SDK — required by
basler-charuco-calibratorandliquid-lens-calibration(both use Basler cameras).
Braid (the tracking system this project builds on) only supports up to Pylon 7.3 — do not install a newer version. Download it directly from Basler's downloads page, pinned to version 7.3.0.
- Download the Linux
.tar.gzfile. If you're offered a choice of "architecture," pick x86-64 (also writtenamd64) — that's what this project's machines use, unless you know yours is different. - Open a terminal in the folder you downloaded it to (in most Ubuntu
file managers: right-click the empty space in the folder → Open
Terminal Here), then unzip (extract) the archive —
taris Linux's built-in tool for this,-xzfmeans "extract, and the file is gzip-compressed":tar -xzf basler_pylon_*.tar.gz - This creates a new folder. Move into it and read the install
instructions file it contains:
Basler's own
cd pylon-* # the folder tar just created ls # confirm you see a file named INSTALL cat INSTALL # prints the instructions to followINSTALLfile has the exact steps for your system — follow those rather than a single command documented here, since they can change between Pylon releases.
⚠️ Common failure: picking the newest Pylon version instead of 7.3 — Braid won't work with it. Double-check the version number on the downloaded filename before installing.
- XIMEA xiAPI runtime (
libm3api.so.2) — required byliquid-lens-calibration(uses a XIMEA camera to measure focus sharpness) and byximea-py, the driver library it talks to that camera through. Install the latest driver using the install script shipped in theoptoflyrepo (not from XIMEA's site directly):
cd ~/src/optofly/scripts
sudo ./install_ximea_driver.sh
sudo runs the command with administrator privileges — required here
because the script installs files outside your home folder. It will
prompt for your account password; nothing appears on screen as you
type it, which is normal, not an error.
You need optofly already cloned first — see
step 2 below if you haven't done
that yet.
- NI-VISA — required by
braid-opto-power-measureto talk to the Thorlabs PM100D power meter. The Python driver it uses (pyThorlabsPM100x) only supports the console's NI-VISA mode, not its other "TLPM" USB mode — the PM100D's own front-panel menu has a setting to switch between the two.
Not verified: this wiki hasn't confirmed NI-VISA is installed on any of this project's machines yet, or documented the install steps for it — the
braid-opto-power-measureREADME doesn't mention NI-VISA at all. Before relying on this, check whether NI-VISA is already present (python3 -c "import pyvisa; pyvisa.ResourceManager()"inside that repo'suvenvironment will raise a clear error naming the missing backend if not), and confirm the PM100D's mode from its own front-panel menu. Update this section once verified.
These are one-time, per-machine installs — you won't need to repeat them when setting up an individual repo below.
4. Braid
Several tools in this project assume Braid (the multi-camera 3D tracking system this project builds on) is already installed and running. Braid is a separate, external project — installing it is outside the scope of this wiki. See Braid's own documentation for setup instructions.
5. udev rules (device permissions and names)
Ubuntu doesn't let normal users access USB devices like the cameras or Arduino by default, and doesn't guarantee they get the same device name every time you plug them in. This machine already has the rules needed for every device this project uses — see udev Rules for what they do and how to add one if you swap in a replacement device.
Next step
Once this is done, follow the setup page for whichever tool you need:
- udev Rules — device permissions, only needed if you're setting up a new machine or replacing hardware
- Basler ChArUco Calibrator — camera calibration (do this first)
- Liquid Lens Calibration — lens calibration (after Braid is tracking)
- OptoFly — running experiments (set up last)
- Optotune Lens — the lens driver library (usually installed automatically as a dependency of the two tools above, not run standalone)
- Ximea Py — the XIMEA camera driver library used by
liquid-lens-calibration(usually installed automatically as a dependency, not run standalone) - Braid Opto-Power Measure — occasional QC check of arena light power, not part of the required calibration sequence
- OptoFly Analysis — post-hoc analysis of finished recordings, not part of the required calibration sequence