Skip to content
Projets

COS301-SE-2026/Gesture-Based-Drone-Control

Voir sur GitHub

À propos

Real-time gesture-to-flight-command pipeline using MediaPipe Hands, rule-based + ML recognition, FastAPI WebSocket backend, and a React/TypeScript telemetry dashboard.

Développement web et applicatif

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
-1

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original
Codex Merchants. Gesture Based Drone Control. Project tagline

Visit the landing page  Open the docs hub  Demo videos on YouTube

Test Lint Site Coverage Issues Uptime


SRS SAS Manual Demo Videos Project Board Brand API Testing


Python FastAPI MediaPipe React Vite PostgreSQL uv Task


Control a drone with your hands. Our system uses real-time computer vision to recognize gestures and translate them into flight commands, with calibration and safety checks built in. Fly in a simulator, compete in gesture-controlled minigames, challenge yourself in testing environments, or switch to a keyboard, gamepad or on-screen controls. From learning the controls to practising flight, the project brings drone interaction into a more intuitive, accessible and interactive experience for pilots of all skill levels.


Watch us take the app beyond just a simulator and fly a real drone:

Real-world drone flight demonstration by Codex Merchants

Watch the full flight  ·  Check out the Codex Merchants YouTube channel

Core intelligence, real-time pipeline, safety first

Website and Documentation

A live landing page landing page serves as an easy place to get acquainted with the system and download the latest release.

The documentation hub hosts every deliverable. All documents also live in the repo under docs/ as Markdown or PDF.

Introduction

Document Purpose
User Manual Installation, calibration and introduction to gesture-based flight controls.
Demo Videos Recorded walkthroughs on the Codex Merchants YouTube channel.
Brand and Design System Visual identity, wireframes, colours and typography.

Requirements and Design

Document Purpose
SRS Functional requirements, use cases, domain model and quality requirements.
SAS Architectural patterns, services, design decisions and diagrams.
Component Reference Frontend components, routing and service adapters.
API Reference REST and WebSocket contracts, schemas and examples.

Development and Quality

Document Purpose
Coding Standards Code conventions, linting rules and review requirements.
Testing Policy Testing types, coverage targets and acceptance criteria.
Testing Manual How to run the test suites and what they cover.
NFR Verification Non-functional requirement evidence and traceability matrix.
Git Conventions Branching, commit messages and pull request rules.
CI/CD Pipeline GitHub Actions workflows and quality gates.

Planning and Project Archives

Document Purpose
Project Plan Roadmap, milestones and demo deliverables.
Demo 1 Archive Archived deliverables from the first demonstration.
Tender Document Original proposal submitted to the client.
GitHub Project Board Live sprint board, backlog and work in progress.

The Team. Codex Merchants

The team
Left to right: Ayush, Shavir, Jaitin, Cameron (Project Mentor), Chinmayi, Diya


Ayush Beekum

Ayush Beekum
u23596351
Team Lead, Computer Vision

View CV

GitHub | LinkedIn
Shavir Vallabh

Shavir Vallabh
u23718146
Backend, Game Dev, HID Integration

View CV

GitHub | LinkedIn
Jaitin Moodally

Jaitin Moodally
u23621372
Systems, DevOps, Low-level

View CV

GitHub | LinkedIn
Diya Narotam

Diya Narotam
u23533596
UI/UX, Data Analysis, Game Dev

View CV

GitHub | LinkedIn
Chinmayi Santhosh

Chinmayi Santhosh
u24585671
Frontend, Testing, User Training

View CV

GitHub | LinkedIn

Why each member is here, click to expand individual profiles.

Ayush Beekum - Team Lead

Has delivered production web applications for real clients using React and Python, demonstrating equal strength on both frontend and backend development. Completed several standalone projects from concept to deployment, including a Python system that fetches real-time data from an API and reflects it live in the application. Language proficiency: Python, JavaScript, TypeScript, SQL, C++, Java, PHP. Works across the entire proposed stack. Consistent integration owner and bug fix go-to.

Shavir Vallabh - Backend, HID integration, Systems Architecture

Strong Currently works part time in the University of Pretoria's Computer Science department on Linux infrastructure, cluster computing, and full-stack internal tools. Strong background in backend development, and architecting systems; with interests in applied AI, cybersecurity, HPC, and software engineering.

Jaitin Moodally - Systems, DevOps, Low Level

Experience across multiple operating systems and environments. Homelab veteran. Runs different applications on resource constrained VMs. Experienced hosting multi user applications and writing low level code. Top stack: Java, C++, C, Python, TypeScript. Interested in Cyber Security, Machine Learning, Artificial Intelligence and Devops.

Diya Narotam - UI/UX and Frontend

Hands on with Python and NumPy for data manipulation. Strong OOP foundations in C++ and Java, proficient SQL. 1st place in a school website update hackathon. UI/UX contributor with PWA experience. Has built offline capable mobile applications. Testing across Playwright, Vitest and Jest gives solid grounding in both unit and end to end testing.

Chinmayi Santhosh - Frontend and Data

Considerable statistical and data analysis skills. UI engineering across React and Tailwind CSS. Writes unit and integration tests to ensure frontend reliability and catch regressions early. Consistent frontend contributor across every university project. Delivers clean, functional interfaces and collaborates well across the stack.


Team Email: [email protected]


System Architecture

The full architecture, from raw camera input through to packaged desktop application and CI/CD automation, with all diagrams, lives in the Software Architecture Specification.

Gesture to Command sequence diagram. Click to expand.
%%{init: {'theme':'dark', 'themeVariables': {
  'primaryColor':'#A4161A','primaryTextColor':'#F5F3F4',
  'actorBkg':'#161A1D','actorBorder':'#A4161A','actorTextColor':'#F5F3F4',
  'signalColor':'#E5383B','signalTextColor':'#F5F3F4',
  'background':'#0B090A','noteBkgColor':'#161A1D','noteTextColor':'#F5F3F4','noteBorderColor':'#A4161A'
}}}%%
sequenceDiagram
    participant User
    participant Camera
    participant HandDetection
    participant GestureEngine
    participant Stabilizer
    participant Calibration
    participant FastAPI
    participant DroneAdapter
    participant Dashboard

    User->>Camera: Performs gesture
    Camera->>HandDetection: Frame
    HandDetection->>GestureEngine: 21 landmarks
    GestureEngine->>GestureEngine: Rule based classify
    GestureEngine->>Stabilizer: Raw gesture
    Stabilizer->>Calibration: Majority voted gesture
    Calibration-->>FastAPI: Gate open once calibrated
    FastAPI->>DroneAdapter: Translated command
    DroneAdapter-->>FastAPI: Telemetry
    FastAPI-->>Dashboard: WebSocket push
    Dashboard-->>User: Live status update

    Note over Stabilizer,FastAPI: Safety layer hovers on tracking loss
System architecture diagram. Click to expand.System Architecture

Gesture vocabulary

The rule-based recognizer classifies six gestures from MediaPipe's 21 hand landmarks for each finger raised, plus an UNKNOWN failure state for low-confidence or unmatched frames. Per-frame classifications pass through the GestureStabilizer, which takes the majority vote from a sliding window of frames.

Calibration gate

Before any flight command is accepted, the user walks the calibration sequence once. This is a safety net that proves the pipeline can read this user's hand under this lighting.

The sequence runs through each gesture, proceeding once the system is confident that a gesture is sufficiently recognised

Hardware Communication

The system allows for seamless integration of more HIDs (Human-Interface Devices) and drones through the use of a unique two-way adapter. Each HID inherits from an abstract InputAdapter class, and each drone inherits from an abstract DroneAdapter class.

This means that adding a new input method or drone implementation requires only one new file; and every existing implementation on the other side of the adapter is automatically guaranteed to work with no further configuration.

API interface

Everything is mounted under the /api prefix. Interactive Swagger docs are served at /docs when the backend is running.

Expand for a summary, or check out each API endpoint in the Hosted Swagger Docs.
Router Endpoints
root GET /api/health
/auth GET /health · POST /login · POST /signup · POST /refresh · POST /logout · GET /me
/drone GET /health · POST /connect · POST /disconnect · GET /status · GET /feed · WS /ws/telemetry · WS /ws/commands
/gestures GET /health · GET /status · WS /stream · GET /recognizer · POST /recognizer
/calibration GET /status · POST /start · POST /skip · WS /stream
/input POST /connect · POST /disconnect · GET /status · WS /ws/keyboard · WS /ws/gamepad · GET /gesture/events · POST /gesture/config · WS /ws/gesture/status · WS /ws/gesture/events
/analytics GET /flights · GET /summary
/game POST /connect · POST /disconnect · GET /status · WS ws/commands
/leaderboard POST /scores · PATCH /scores/{entry_id}/name · GET /scores/{game_id}

Repository Structure

The project uses a monorepo structure that separates the frontend, backend, shared packages, and supporting services.

It includes dedicated modules for computer vision, gesture recognition, drone control, input handling, telemetry, authentication, and database management.

The repository also contains unit and integration tests, performance testing tools, project documentation, packaging configurations, and the library for Project AirSim, maintained as a submodule.

Click to see the actual project structure, as a tree of depth 3
.
├── apps
│   ├── backend
│   │   ├── app
│   │   └── tests
│   └── frontend
│       ├── electron
│       ├── node_modules
│       ├── playwright-report
│       ├── public
│       ├── src
│       ├── test-results
│       └── tests
├── backend.egg-info
├── build
│   ├── GestureBasedDroneControl-Backend
│   ├── signalling
│   │   ├── Public
│   │   ├── modules
│   │   ├── node_modules
│   │   ├── platform_scripts
│   │   └── tps
│   └── sim
│       ├── Blocks
│       └── Engine
├── dist
├── docs
│   ├── api
│   ├── assets
│   │   └── readme
│   ├── contracts
│   ├── cvs
│   ├── demo
│   │   └── demo_one_documentation
│   ├── diagrams
│   ├── frontend
│   ├── hooks
│   ├── includes
│   ├── javascripts
│   ├── nfr
│   │   └── evidence
│   ├── reports
│   ├── services
│   ├── stylesheets
│   └── testing
├── init-db
├── landing_page
│   └── src
│       ├── assets
│       ├── components
│       ├── constants
│       ├── context
│       ├── hooks
│       └── lib
├── packages
│   ├── api-contracts
│   ├── contracts
│   │   ├── python
│   │   └── typescript
│   ├── domain
│   │   └── models
│   └── utils
├── packaging
├── services
│   ├── auth
│   ├── commands
│   ├── cv_pipeline
│   │   ├── camera
│   │   ├── gestures
│   │   ├── hand-detection
│   │   ├── hand_detection
│   │   └── processing
│   ├── database_manager
│   │   ├── managers
│   │   └── models
│   ├── drone_control
│   │   └── adapters
│   ├── drone_services.egg-info
│   ├── input
│   │   └── sources
│   ├── telemetry
│   │   └── storage
│   └── tests
│       ├── adapter_testing
│       ├── auth_testing
│       ├── cv_pipeline_testing
│       └── database_manager_testing
├── tests
│   ├── integration
│   │   ├── auth_testing
│   │   ├── db_manager_tests
│   │   └── gestures
│   └── nfr
│       ├── jmeter
│       └── lighthouse
└── vendors
    ├── projectairsim
    │   ├── build
    │   ├── docs
    │   ├── src
    │   └── tests
    └── sim_config

112 directories

Technology Stack
Tech stack

Computer Vision and Gesture Recognition
Technology Purpose Version
Python Primary language. CV, services, drone SDK integration 3.11.x
OpenCV Live camera feed and image preprocessing 4.8+
MediaPipe Real time 21-point hand landmark detection and tracking 0.10.21
NumPy Vector math. Angles, distances, finger state 1.26+
Rule Based Recognizer Deterministic, zero latency gesture classification custom
Gesture Stabilizer Majority voting over a rolling buffer, kills single-frame noise custom
ML Recognizer Second engine behind the same GestureRecognizer ABC planned
Asyncio plus Bounded Queue Non blocking real time pipeline, drops stale frames built-in
Drone Integration and Simulation
Adapter Purpose Status
DroneAdapter (ABC) Common contract. Every backend talks the same interface stable
ProjectAirSimAdapter Unreal Engine 5 Project AirSim. Async native (pynng), body-frame velocity primary
AirSimAdapter Legacy AirSim via msgpack-rpc. NED conversions handled in-adapter supported
DummyDroneAdapter In-memory drone for tests and CI. No simulator required stable
XFlyAdapter Physical drone communication stubbed
Gazebo plus ArduPilot High fidelity physics simulation not wired up

Project AirSim is vendored as a git submodule (vendors/) so the client and sim_config stay pinned and reproducible. Clone with --recurse-submodules.

Input Sources
Adapter Purpose
InputAdapter (ABC) Common contract for every control surface
GestureAdapter Hand gestures from the CV pipeline
KeyboardAdapter Arrow keys, WASD, T, Space, L, Esc. Streamed over WS /api/input/ws/keyboard
GamepadAdapter Dual-stick and face buttons. Streamed over WS /api/input/ws/gamepad
DummyInputAdapter Deterministic input for tests

On-screen buttons in the dashboard drive the same command set, so gestures, keyboard, gamepad and UI are fully interchangeable. This is the project's accessibility story.

Backend, Auth and Database
Technology Purpose Version
FastAPI REST plus WebSocket API (ASGI), Swagger at /docs 0.136+
SQLAlchemy Async ORM. Models and managers in services/database_manager 2.0+
PostgreSQL Primary database via asyncpg. Bootstrapped by init-db/ 16
SQLite Local and test database via aiosqlite 3.x
Pydantic Schemas, validation, settings (pydantic-settings) 2.13+
PyJWT plus bcrypt Access and refresh tokens, password hashing, HTTP-only cookies latest
Pytest Unit, integration and API testing. pytest-asyncio in auto mode 9.x
Frontend
Technology Purpose Version
React Dashboard UI. Atomic design, JSX 18
Vite Dev server and bundler 8.x
Tailwind Utility first styling, light and dark themes 3.x
shadcn/ui plus lucide-react Component primitives and icon set latest
React Router Client routing under RootLayout 7.x
Recharts Real time telemetry and analytics visualization 3.x
Leaflet plus react-leaflet GPS map view for simulated flight paths 1.9 / 4.2
TypeScript Landing page, Playwright specs, shared contracts 5.x+
Playwright Both component-level unit tests and end to end tests 1.60+
Packaging and Deployment
Technology Purpose Version
PyInstaller Freezes the backend, CV pipeline and simulator client into one binary 6.21+
Electron Desktop shell. electron-builder produces .exe and .AppImage 43.x
GitHub Pages Landing page at / and documentation hub at /docs gh-pages
DevOps, Tooling and Documentation
Technology Purpose
uv Single root workspace resolves backend, services and vendored packages together
Task Cross platform task runner. Same commands on Windows, macOS, Linux
Ruff Python lint and format. Single quotes, tab indent, 100 col, E/F/I/N rules
ESLint plus Prettier TypeScript and JSX linting and formatting. format:check gates CI
GitHub Actions Test, lint, docs deploy and release build pipelines
Codecov Coverage reporting. Separate backend and services flags, 80% target
Git Version control. Trunk based, Use Case branches, submodule for vendors
MkDocs Material Documentation hub (mkdocs.yml), deployed alongside the landing page

Use Cases
Expand to see a breakdown of all use cases. Every use case is associated with a long-lived branch and a slice of the Project Board. A comprehensive breakdown is available in the SRS.
ID Use Case Description
UC1 Hand Tracking and Gesture Recognition Tracks hand landmarks from the camera feed, recognizes gestures and converts them into drone commands.
UC2 Dashboard and Telemetry Displays live drone telemetry, recent commands and charts, with updates delivered over WebSockets.
UC3 Simulator Support Switches between Project AirSim, legacy AirSim and a dummy drone through a common adapter interface.
UC4 Controller Support Supports gamepad input with fully analog dual-stick controls, a controller layout interface and keyboard controls as an alternative.
UC5 Telemetry Logging Records flight telemetry and summaries in SQLite for later retrieval and processing.
UC6 GPS Simulation Simulates drone position updates and displays movement on a Leaflet map, including displacement statistics.
UC7 Tutorial and Help Provides a gesture reference, an interactive onboarding tutorial and an in-app help page.
UC8 Gesture Calibration Guides users through calibration before flight, with backend state management and REST and WebSocket endpoints.
Wow1 Gesture-Controlled Minigames Includes three minigames with high-score tracking, support for all existing input methods and persistent leaderboards for project day competitions.
Wow2 Drone Licensing Practice Provides a Three.js environment for practising four challenges based on a real drone licence test, controlled using the existing gesture system.
Wow3 Motion-Based Gestures Offers an alternative to the standard gesture system, recognising dynamic hand movements and changes in distance to support more advanced controls.
Base Registration and Login Handles account registration and login using JWT access and refresh tokens stored through HTTP-only cookies. Includes light and dark themes.
Base Landing Page and Documentation Provides a public landing page built with Three.js and a MkDocs documentation site, deployed through GitHub Pages.
DevOps Infrastructure and Release Builds Uses uv and Task to manage development, GitHub Actions for CI/CD, Codecov for coverage reporting, and PyInstaller and Electron for packaging.

Getting Started

Prerequisites

Python uv Task Node Yarn

Expand for comprehensive instructions to start developing

This project uses Taskfile as an OS agnostic alternative to Make. It's a really nice tool.

Note, Python must be 3.11. The workspace pins >=3.11,<3.12 because MediaPipe and the AirSim clients have no wheels beyond it.

If uv is not installed, follow the official installation instructions.

brew install go-task              # macOS
sudo snap install task --classic  # Linux
winget install Task.Task          # Windows

Clone the repository

git clone --recurse-submodules https://github.com/COS301-SE-2026/Gesture-Based-Drone-Control.git
cd Gesture-Based-Drone-Control
cp .env.example .env

If you already cloned the repository without its submodules, initialise them with:

git submodule update --init --recursive

Install Dependencies and Libraries

task install

This creates a Python 3.11 virtual environment, installs the dependencies required by AirSim, synchronizes the Python workspace and installs the frontend dependencies with Yarn.

Configure the environment variables in .env before running the application. In particular, set the backend port and any simulator paths required by your setup.


Run the application locally

task dev

This starts the FastAPI backend and the Vite frontend development server. The backend uses BACKENDPORT from the environment; the frontend runs from apps/frontend.

To run either component separately:

task backend-dev
task frontend-dev

The public landing page has its own development server:

task landing

Test

task test           # everything: unit, integration, end to end

Or by layer:

task unit-test             # Frontend and backend unit tests
task backend-unit-test     # Backend and services tests
task frontend-unit-test    # Frontend unit tests
task integration-test      # Integration tests
task e2e-test              # End-to-end tests

Linting and formatting

task lint    # Python linting, frontend linting and API contract validation
task fix     # Automatically fix supported Python and frontend formatting issues

Build the desktop app

task build

The build stages the simulator and its Pixel Streaming signalling server, packages the backend with PyInstaller, and builds the Electron desktop application.

Simulator build requirements:

  • Set SIM_SRC in .env to the simulator directory or archive used for staging.

  • The simulator staging task supports Linux and macOS shell environments, as well as a separate Windows PowerShell script.

  • The staged simulator must contain the expected Blocks project and Linux shipping binary where applicable. Check the platform-specific staging requirements before building.

To remove generated build output:

task clean

Branching Strategy

We use the GitHub Flow. main automatically builds and deploys an executable Full conventions in the Git docs.

%%{init: {'theme':'dark', 'themeVariables': {
  'primaryColor':'#A4161A','primaryTextColor':'#F5F3F4',
  'primaryBorderColor':'#E5383B','lineColor':'#B1A7A6',
  'secondaryColor':'#161A1D','tertiaryColor':'#0B090A','background':'#0B090A'
}}}%%
flowchart LR
    main(["main"]):::main
    dev(["dev"]):::dev
    uc(["Use-Case-N/Topic"]):::uc
    feat(["feature/UCN/name"]):::feat

    main --> dev --> uc --> feat
    feat -->|PR| uc
    uc -->|PR| dev
    dev -->|PR| main

    classDef main fill:#660708,color:#F5F3F4,stroke:none
    classDef dev  fill:#A4161A,color:#F5F3F4,stroke:none
    classDef uc   fill:#BA181B,color:#F5F3F4,stroke:none
    classDef feat fill:#E5383B,color:#0B090A,stroke:none

Keep your Use Case branch current. Regularly merge dev into it to stay aligned and avoid large conflicts. Resolve all conflicts locally before opening a PR.


CI/CD and Code Quality

Testing and lintling run on every pull request, and release builds the packaged app on every push to main.


WorkflowStatusTrigger and jobs
Testing
PRs into dev, main, Use-Case**. Backend unit, frontend unit, then integration, then E2E. Coverage uploaded to Codecov under backend and services flags
Linting
Every PR. Ruff over Python, ESLint plus Prettier over the frontend. No style drift
Docs
Pushes to main or dev touching docs/, landing_page/ or mkdocs.yml. Builds both, deploys landing page at / and MkDocs at /docs
Release
Pushes to main. Matrix build on Windows and Ubuntu, produces .exe and .AppImage, publishes a GitHub Release
Coverage
80% project and patch target, 1% threshold. Tests, __init__.py, sandbox/ and vendors/ excluded
Issues Open issue count. Tracked on the Project Board

Contact
Role Name Email
Project Owner Bryan Janse Van Vuuren [email protected]
Project Mentor Cameron Taberer [email protected]
Team Codex Merchants [email protected]

Codex Merchants — COS 301 Software Engineering, University of Pretoria, EPI-USE Labs, 2026



Explorer des projets similaires

Chargement…