Hardware Requirements
Before starting the software installation, ensure you have the following hardware components:Computing Platform
Raspberry Pi (3B+ or newer recommended)
- 1GB+ RAM
- MicroSD card (16GB minimum)
- Raspberry Pi OS (Bullseye or newer)
VEX Robotics Platform
VEX IQ2 Brain
- 4x VEX Motors (Base, Shoulder, Elbow, Gripper)
- Inertial Sensor
- 2x Distance Sensors
- Bumper Switch
- Touchled RGB indicator
Camera System
USB Camera
- Compatible with V4L2
- Minimum 720p resolution
- USB 2.0 or higher
Connectivity
Serial Connection
- USB cable (Raspberry Pi ↔ VEX Brain)
- Stable power supply for both devices
Software Dependencies
The system requires Python 3.9+ with various libraries for computer vision, robotics control, and AI inference.Key Dependencies
Core Python Libraries
Core Python Libraries
- Python 3.9+ — Main programming language
- pyserial 3.5 — Serial communication with VEX Brain
- numpy 1.24.2 — Numerical computing for image processing
- opencv-python 4.11.0.86 — Computer vision and camera interface
AI & Machine Learning
AI & Machine Learning
- torch 2.6.0 — PyTorch deep learning framework
- torchvision 0.21.0 — Computer vision models and transforms
- ultralytics 8.3.77 — YOLO object detection framework
- ncnn 1.0.20241226 — High-performance neural network inference
Raspberry Pi Hardware
Raspberry Pi Hardware
- picamera2 0.3.25 — Raspberry Pi camera interface (if using Pi Camera)
- gpiozero 2.0.1 — GPIO pin control
- lgpio 0.2.2.0 — Low-level GPIO library
- RPi.GPIO — Alternative GPIO library
Audio & Speech (Optional)
Audio & Speech (Optional)
- SpeechRecognition 3.14.1 — Voice command processing
- PyAudio 0.2.14 — Audio input/output
Data Visualization (Optional)
Data Visualization (Optional)
- matplotlib 3.10.0 — Plotting and visualization
- streamlit 1.41.1 — Web-based UI dashboard
- plotly 6.0.0 — Interactive plots
Raspberry Pi Installation
Update System Packages
Start by updating your Raspberry Pi OS to ensure all system packages are current:
This may take several minutes depending on your internet connection and installed packages.
Create Virtual Environment (Recommended)
Create an isolated Python environment to avoid dependency conflicts:
Always activate the virtual environment before running the system:
Install Python Dependencies
Install all required Python packages from the requirements file:
Installation may take 30-60 minutes on Raspberry Pi due to compiling some packages from source.
Configure Camera
Verify your camera is detected:Test camera capture:
Using Raspberry Pi Camera Module
Using Raspberry Pi Camera Module
If using the official Pi Camera, ensure the camera interface is enabled:Then install picamera2:
Configure Serial Port
Enable serial hardware and disable serial console:Verify the serial port:Add your user to the dialout group for serial access:
The default serial port in the code is
/dev/ttyACM1. You may need to adjust this in arm_system/communication/serial_manager.py:23 based on your setup.Download YOLO Model (Optional)
The system uses YOLO11s for object detection. The model will be downloaded automatically on first run, or you can download it manually:
Custom Model Training
Custom Model Training
To use your own trained YOLO model:
- Train your model using Ultralytics YOLO
- Export to NCNN format for Raspberry Pi optimization
- Place model files in
arm_system/perception/vision/detection/models/ - Update the model path in
model_loader.py
VEX Brain Setup
Install VEX Coding Studio
Download and install VEX Coding Studio on your development computer:
- Download from: https://www.vexrobotics.com/vexcode
- Choose VEX IQ Python for the IQ2 brain
- Install the software following the platform-specific instructions
Connect VEX Brain to Computer
Connect your VEX IQ2 Brain to your development computer via USB.Verify the connection:
- VEX Brain screen should show “Connected”
- VEX Coding Studio should detect the brain
Open VEX Project
Open the VEX Brain code from the repository:In VEX Coding Studio:
- Click File → Open
- Navigate to
arm_system/vex_brain/ - Open the project
Upload Code to VEX Brain
Build and upload the program:
- In VEX Coding Studio, click Download button
- Wait for compilation and upload to complete
- Verify “Download Successful” message
- The program will start automatically
The VEX Brain will show a white LED when initialized and waiting for serial commands from the Raspberry Pi.
System Verification
Connect Hardware
- Power on the VEX Brain
- Connect USB cable from Raspberry Pi to VEX Brain
- Verify the serial connection:
Test Camera Capture
Verify the camera and image processor:Check that an image file was created in the output directory.
Run Complete System Test
Start the main robot controller:You should see:Test each command:
- [c] Check Service: Verifies all hardware
- [s] Safety Service: Moves arm to safe position
- [n] Scan Service: Performs 360° scan with object detection
- [p] Pick & Place: Executes pick and place operation
Troubleshooting
Serial Connection Issues
Serial Connection Issues
Problem: Cannot connect to VEX BrainSolutions:
- Check USB cable connection
- Verify serial port name:
- Ensure user is in dialout group:
- Try different USB port on Raspberry Pi
- Update port in code if needed:
Camera Not Detected
Camera Not Detected
Problem: Camera initialization failsSolutions:
- Check camera connection and power
- List available cameras:
- Test with different camera index:
- Verify camera permissions:
YOLO Model Errors
YOLO Model Errors
Problem: Object detection model fails to loadSolutions:
- Verify model files exist:
- Check PyTorch installation:
- Reinstall ultralytics:
- Reduce confidence threshold if no detections:
Motor Control Issues
Motor Control Issues
Problem: Motors not responding or moving incorrectlySolutions:
- Run check service to verify hardware:
- Verify motor port connections match code
- Check VEX Brain battery level
- Recalibrate inertial sensor:
- Test individual motors in VEX Coding Studio
Installation Dependency Errors
Installation Dependency Errors
Problem: pip install fails for certain packagesSolutions:
- Update pip:
- Install problematic packages separately:
- Use system packages where available:
- For PyTorch issues on Raspberry Pi:
Configuration Files
Next Steps
Now that your system is installed and verified, you can:Quick Start Tutorial
Run your first complete scan and pick operation
Hardware Setup Guide
Learn about assembly and component details
API Documentation
Explore the complete API reference
Vision System Details
Deep dive into computer vision and YOLO models
Pro Tip: Join the community discussions and share your builds! Check the GitHub repository for issues, contributions, and updates.