Devpost | gurt.tech (Robot is currently decommissioned so website will not work D: rest in piece gurt)
- Real-time Video Feed: Low latency streaming from Pi using a custom-built QNX camera driver (optimized from ~3fps to being able to run consistent 30fps).
- Low Latency Control: WebSocket-based control loop.
- Hardware Integration: Real-world hardware control with Raspberry Pi 4 and Arduino.
- Two Game Modes:
- Casual: Free to play.
- Ranked: Pay 0.1 SOL Entry Fee -> Win -> Get 0.18 SOL Payout.
- Leaderboard: Track top pilots.
This project implements a real-time remote control system with video streaming using WebSockets. It consists of a central FastAPI server, a web-based client for control, and a hardware client running on a Raspberry Pi 4.
Our system uses a dual-controller architecture for reliability and performance:
- Raspberry Pi 4 (Main Controller):
- OS: QNX 8 (Unix-based RTOS).
- Responsibilities: Runs the Python client (
pi_client.py), handles WebSocket communication, and streams video. - Custom Camera Driver: To overcome QNX's default limitations, we developed a native camera driver that boosted frame rates from a stuttering 3 FPS to a smooth 30 FPS. Code adapted from camera_example3_viewfinder
- Arduino (Motor Controller):
- Responsibilities: Receives serial commands from the Pi to control the physical motors of the robot.
- Logic: Located in
turning.ino.
- Python 3.8+
- Hardware setup (optional, simulation supported):
- Raspberry Pi 4 with QNX 8
- Arduino (for motor control)
- Webcam / Camera Module
-
Clone the repository:
git clone <repository_url> cd uottahack-8
-
Create and activate a virtual environment:
# Windows python -m venv venv .\venv\Scripts\activate # macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Solana Devnet Setup: The server acts as the "House" and needs a wallet to hold entry fees and pay out winnings.
- Start the server (step below).
- Look for the
[SOLANA] House Wallet Public Keyin the terminal output. - Send Devnet SOL to this address so it has funds to pay out winners!
- You can get Devnet SOL from faucet.solana.com.
This starts the central communication hub.
python server.pyOpen your browser and navigate to http://localhost:8000.
This runs on the Raspberry Pi 4. It connects to the server, receives control commands, and streams video using our custom QNX driver.
python pi_client.pyWe have implemented 2 camera methods. The primary method opens a camera using OpenCV, which will works on most OSes (Windows, MacOS) as well as Linux based OSes. For QNX, we have developed our own camera driver as a secondary method. This requires the camera_example3_viewfinder binary which we have precompiled in this repository.
Note: You can also run this on your laptop for testing; it will fallback to your webcam.
- Ensure both the Server and Pi Client are running.
- Open the web interface (http://localhost:8000).
- The web interface sends control data to the server.
- The server relays these controls to the
pi_client.py. - The
pi_client.pyforwards motor controls to the Arduino and streams video back.
- Port 8000 already in use: Edit
server.pyand change the port inuvicorn.run(..., port=8000). - No Webcam: The
pi_client.pywill automatically fall back to generating visual noise if no webcam is detected. - Connection Refused: Ensure the server is running before starting the client.