Skip to content

Repository files navigation

FRC Robot Tracking and Analysis

License: MIT Python 3.11 Contributions Welcome GitHub issues GitHub stars

Overview

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.

Features

  • 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.py are currently inaccurate due to skewing problems.)
  • Integration with FRC API and The Blue Alliance API for scoring data analysis (planned)

Requirements

Setup

  1. Clone the repository:

    git clone https://github.com/qualk/frc-robot-tracking.git
    cd frc-robot-tracking
  2. 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, use source .venv/bin/activate. This might differ based on your shell.

  3. Install the required packages:

    uv pip install -r requirements.txt
  4. Copy the .env.example file to .env and fill in your Roboflow and TBA API keys.

GPU support

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-12

Usage

Robot Tracking

To track robots in a video:

python bytetrack.py video.mp4 result.mp4

This script uses box annotator, trace annotator, and label annotator to mark detected robots in the video.

Heatmap Generation

To generate a heatmap of robot detections:

python heatmap.py

This script analyses the file "video.mp4" and produces a heatmap visualisation of robot positions throughout the match.

Velocity and Acceleration Measurement

Note: This feature is currently under development and does not produce accurate results due to skewing issues.

python bytrack.py

Contributing

Contributions to this project are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • 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

About

Tracking and analysing FRC robots.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages