Skip to content

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crazyflie Drone Experiments

Autonomous flight control and multi-drone coordination experiments with Bitcraze Crazyflie 2.1 and Lighthouse positioning.

Project highlights

  • Task 1 - Single-drone waypoint loop: Calibrate an origin from Lighthouse samples, take off, fly a square trajectory, return, and land.
  • Task 2 - Two-drone coordinated pass: Two drones swap positions while dynamically splitting altitude when proximity drops below a safety threshold.
  • Trajectory analysis tooling: Matplotlib-based scripts generate 3D/2D plots and an animation that explain the pass behavior.
  • Real hardware integration: Experiments are designed and tested for Crazyflie radio links and estimator feedback.

Demo outputs

Task 2 animation

Task 2 coordinated pass

Static analysis views

3D trajectory Altitude split verification
3D trajectories Altitude split

Repository layout

task1/
  task1_corners.py         # Relative square flight based on calibrated origin
  task1_simple.py          # Fixed-corner square flight variant
task2/
  task2.py                 # Swarm pass-and-avoidance experiment
tests/
  simple_takeoff.py        # Basic motion/deck checks
  lighthouse_pos.py        # Position logging utility
  async_log.py             # Async estimator logging utility
viz/
  visualize_trajectories.py  # Plot and GIF generation for Task 2
square_relative.py         # Single-drone square using high-level commander
log_relative.py            # Relative position logging helper

Hardware and software

  • Hardware: 2x Crazyflie 2.1, Lighthouse deck(s), Crazyradio PA, Lighthouse base stations
  • Python: 3.12+
  • Libraries: cflib, numpy, matplotlib

Install dependencies with uv:

uv venv
source .venv/bin/activate
uv pip install -r requirements.txt

Running experiments

Update drone URIs in scripts before flight.

# Task 1: single-drone corner loop
python task1/task1_corners.py

# Task 2: two-drone coordinated pass
python task2/task2.py

# Generate visualizations and GIF
python viz/visualize_trajectories.py

Safety notes

  • Fly only in a controlled indoor space with a clear emergency-stop path.
  • Verify Lighthouse tracking quality before takeoff.
  • Start with lower speed/height values when testing parameter changes.

About this repository

This repository documents practical robotics/control work with real-world estimator noise, coordination logic, and drone motion control.

About

Autonomous Crazyflie experiments for single-drone waypoint flight and two-drone coordinated passing with Lighthouse positioning, plus trajectory visualization tooling.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages