Run these commands on your Raspberry Pi
Raspberry Pi OS requires using a virtual environment:
cd ~/EDTH2025/Erewhon
# Create virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate
# Upgrade pip
pip install --upgrade pipInstall in two steps (different package sources):
# Step 2a: Install PyTorch from pytorch.org
pip install -r requirements_pi_pytorch.txt --index-url https://download.pytorch.org/whl/cpu
# Step 2b: Install other packages from piwheels/PyPI
pip install -r requirements_pi_others.txtWhat this installs:
- PyTorch (CPU version for ARM)
- torchvision
- numpy, opencv-python, pyserial
- draccus (LeRobot config system)
- huggingface-hub (model loading)
Time: ~5-10 minutes
# Add to .bashrc for permanent setup
cat >> ~/.bashrc << 'EOF'
# ACT Inference Environment
export PYTHONPATH=~/EDTH2025/Erewhon/src/policies/ACT/lerobot/src:$PYTHONPATH
alias act-env='cd ~/EDTH2025/Erewhon && source venv/bin/activate'
EOF
# Reload
source ~/.bashrc
# Activate environment
act-envNow you can always run act-env to activate the inference environment!
cd ~/EDTH2025/Erewhon
./test_pi_model.shExpected output:
✅ Model loaded successfully!
Quantization mode: static
# Make sure venv is activated
act-env
cd ~/EDTH2025/Erewhon/src/robots/rover
python src/inference/act_inference_quantized.py \
--checkpoint models/best_model_static_quantized.pth \
--benchmark \
--iterations 1000Expected results:
- Mean latency: 25-35 ms
- P95 latency: <50 ms
- Throughput: 25-35 FPS
- Control rate: 25-30 Hz ✅
python src/inference/act_inference_quantized.py \
--checkpoint models/best_model_static_quantized.pth \
--camera_id 0Press 'q' to quit.
python src/inference/act_inference_quantized.py \
--checkpoint models/best_model_static_quantized.pth \
--camera_id 0 \
--arduino_port /dev/ttyUSB0 \
--control_freq 30pip3 install draccus huggingface-hubsudo usermod -a -G video $USER
# Log out and back insudo usermod -a -G dialout $USER
# Log out and back inls /dev/video*
# Try different camera_id if multiple camerasls /dev/ttyUSB* /dev/ttyACM*
# Use the port that appearsAll commands assume you're in ~/EDTH2025/Erewhon/src/robots/rover
See PI_COMMANDS.md for more detailed commands.