This project aims to track and analyse robots in FIRST Robotics Competition (FRC) matches using computer vision techniques. It provides tools for object detection, tracking, and visualisation, including heatmap generation.
- Robot detection and tracking in FRC match videos
- Heatmap generation to visualise robot movement patterns
- Velocity and acceleration measurement (WIP, the velocity and acceleration measurements in
bytrack.pyare currently inaccurate due to skewing problems.) - Integration with FRC API and The Blue Alliance API for scoring data analysis (planned)
-
Clone the repository:
git clone https://github.com/qualk/frc-robot-tracking.git cd frc-robot-tracking -
Set up a virtual environment (recommended):
Using
uv(requires separate installation):uv venv --python 3.11
Then activate the environment (regardless of the option).
If you are using Windows, use
venv\Scripts\activate.
If using Linux or MacOS, usesource .venv/bin/activate. This might differ based on your shell. -
Install the required packages:
uv pip install -r requirements.txt
-
Copy the
.env.examplefile to.envand fill in your Roboflow and TBA API keys.
In order to use a dedicated NVIDIA GPU, make sure that you have installed CUDA:
sudo apt install nvidia-cuda-toolkit cudnn9-cuda-12 libcudnn9-cuda-12To track robots in a video:
python bytetrack.py video.mp4 result.mp4This script uses box annotator, trace annotator, and label annotator to mark detected robots in the video.
To generate a heatmap of robot detections:
python heatmap.pyThis script analyses the file "video.mp4" and produces a heatmap visualisation of robot positions throughout the match.
Note: This feature is currently under development and does not produce accurate results due to skewing issues.
python bytrack.pyContributions to this project are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Roboflow for hosting the object detection model
- FIRST Robotics Competition for providing the data and inspiration
- The Blue Alliance for additional FRC data and API access