A vision system
- Install Ubuntu on your device.
- Download and install Conda or Anaconda:
👉 Download here - Create a Python 3.11 environment:
conda create -n blackhole_vision python=3.11
- Open a terminal and run:
git clone https://github.com/Geoffrey-8814/BlackholeVision2.git
- Install nano (text editor):
sudo apt update sudo apt install nano
- Activate your Conda environment:
conda activate blackhole_vision
- Navigate to the project directory:
cd BlackholeVision2 - Install dependencies:
pip install -r requirements.txt
- Install RobotPy (for FRC support):
python3 -m pip install --extra-index-url=https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025/simple robotpy
- Install PyTorch:
- With CUDA 11.8:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
- With CUDA 12.6:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
- Without CUDA:
pip3 install torch torchvision torchaudio
- With CUDA 11.8:
-
Open the
config.jsonfile in a text editor:nano config.json
-
Modify the following fields:
- Replace BlackholeVision with your device name.
- Replace 10.12.34.2 with your roboRIO IP. Use the following format:
- Team number 4321 →
10.43.21.2 - Team number 12345 →
10.123.45.2
- Team number 4321 →
-
Save and exit (
CTRL+X, thenY, thenEnter).
- Connect a camera to your device.
- Run the following command to get the USB port details:
udevadm info --name=/dev/video0 --attribute-walk
- Look for an ID that looks like
/usb1/1-2/1-2.1/1-2.1:1.0. - Extract the port ID (e.g.,
1-2.1from1-2.1:1.0).
- Open the USB rules file:
sudo nano /etc/udev/rules.d/99-usb-cameras.rules
- Add the following rule, replacing 1-2.1 with your port ID and PORTNAME with your desired name:
SUBSYSTEM=="video4linux", KERNELS=="1-2.1", SYMLINK+="PORTNAME"
- Save and exit (
CTRL+X, thenY, thenEnter).
sudo udevadm control --reload-rulesls -l /dev/PORTNAME- If a camera is detected, the port assignment is successful.
- Repeat these steps for additional cameras.
- Open a terminal and edit the sudoers file:
sudo visudo
- Scroll to the bottom and add this line, replacing $USER with your actual username:
$USER ALL=(ALL) NOPASSWD: ALL - Save and exit (
CTRL+X, thenY, thenEnter). - Open a new terminal and test:
sudo visudo
- If no password is required, the setup is successful.
-
Open a terminal and create a script:
nano ~/startBlackholeVision.sh -
Add the following lines:
# Navigate to the project directory cd BlackholeVision2 # Apply USB rules sudo udevadm trigger # Run the program (replace with your Conda Python path) /path/to/conda/envs/blackhole_vision/bin/python __init__.py
-
Save and exit (
CTRL+X, thenY, thenEnter). -
Make the script executable:
sudo chmod +x ~/startBlackholeVision.sh
- Open Startup Applications on Ubuntu.
- Click Add.
- Enter the command:
./startBlackholeVision.sh
- Click Add to confirm.
Follow this guide or:
- Open Settings > System.
- Select Users.
- Click Unlock (top-right corner) and enter your password.
- Select the user account you want to log in automatically.
- Enable Automatic Login.
🚀 Setup Complete! Now your BlackholeVision system will start automatically upon boot. 🚀