Skip to content
GitHub

Installation

Pinkrab needs Python 3.12 or later and ROS 2 Jazzy, and the installation method depends on where you get ROS. ROS for macOS is not shipped as an operating system package, so it is installed from RoboStack conda packages; in that case ROS, LeRobot, and MuJoCo all live in a single Python interpreter. On Ubuntu, ROS is installed with apt. That ROS is built against the system’s Python 3.12, so the Pinkrab packages are installed into a venv created from that same Python.

Choose your operating system once in the tabs below, and every step on the page switches to that operating system.

RoboStack distributes ROS 2 Jazzy as conda packages. Installing these packages requires conda; if you install Miniforge, you get conda and also mamba, a faster installer.

Terminal window
brew install miniforge
conda init "$(basename "$SHELL")"

After installation you must open a new terminal before the conda command works in your shell.

Create the RoboStack environment from requirements/environment.yml. This environment holds ROS 2 Jazzy from the robostack-jazzy channel, colcon, LeRobot, and MuJoCo on a single Python 3.12, and the Pinkrab packages are installed into it in editable mode.

Terminal window
git clone https://github.com/woolimi/pinkrab.git
cd pinkrab
mamba env create -f requirements/environment.yml
mamba activate pinkrab
pip install -e src/pinkrab_core -e src/pinkrab_cli -e src/pinkrab_mujoco \
-e src/pinkrab_studio -e src/pinkrab_umi -e src/pinkrab_policy -e lerobot-plugin

The RoboStack environment already contains all the ROS dependencies, so rosdep is not used. When building, you tell CMake the environment’s Python and NumPy paths directly; without them, CMake may find a different python3 first and the pinkrab_interfaces build can fail.

Terminal window
colcon build --symlink-install --cmake-args \
-DPython3_EXECUTABLE="$CONDA_PREFIX/bin/python3" \
-DPython3_NumPy_INCLUDE_DIRS="$CONDA_PREFIX/lib/python3.12/site-packages/numpy/_core/include"
source install/setup.zsh

If your shell is bash, source install/setup.bash on the last line.

Once built with --symlink-install, changes to Python code take effect immediately without rebuilding. Rebuild only when you add a new file, an entry point, or a launch file.

The servo boards and cameras open without any extra setup. The foot pedal can only be opened with root privileges, so studio runs it with sudo -n; to avoid a password prompt, add one allow rule to sudoers. Run the commands below with the conda environment activated.

Terminal window
echo "$USER ALL=(root) NOPASSWD: $CONDA_PREFIX/bin/pinkrab-footswitch" | sudo tee /etc/sudoers.d/pinkrab-footswitch
sudo chmod 440 /etc/sudoers.d/pinkrab-footswitch
sudo visudo -c

Running the pedal as root is not enough: the app that launched studio also needs the Input Monitoring permission before macOS lets it read pedal input. In System Settings → Privacy & Security → Input Monitoring, turn on the terminal app you use and restart the terminal.

To randomize the background of gripper video when building a dataset, you need SAM 3, which finds the task objects in the video. If you do not plan to change the background, skip this step. SAM 3 uses a newer torch than LeRobot allows, so it is installed separately from the Pinkrab environment, in ~/pinkrab/sam3-env. The SAM 3 installed is sam3-silicon-mac, modified to run on both macOS (MPS) and CUDA.

Terminal window
uv venv --python 3.12 ~/pinkrab/sam3-env
uv pip install --python ~/pinkrab/sam3-env/bin/python "torch>=2.15" torchvision \
"sam3[video] @ git+https://github.com/woolimi/sam3-silicon-mac.git"

The SAM 3 weights can only be downloaded after approval on Hugging Face. Request access at facebook/sam3, and once approved, log in once. The weights are downloaded the first time they are used.

Terminal window
~/pinkrab/sam3-env/bin/hf auth login

If you plan to run SAM 3 on another computer with a GPU, you do not need to install it on this one. Studio creates the same environment on that computer (the computer that runs SAM 3).

SAM 3 and its weights are covered by Meta’s SAM License. The Pinkrab repository contains neither SAM 3’s code nor its weights.

Terminal window
pinkrab doctor

pinkrab doctor checks the environment, the servo boards, and the description without moving the robot. If anything is missing, it tells you what is missing along with the command to fix it.