Autonomous flight control and multi-drone coordination experiments with Bitcraze Crazyflie 2.1 and Lighthouse positioning.
- 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.
| 3D trajectory | Altitude split verification |
|---|---|
![]() |
![]() |
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: 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.txtUpdate 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- 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.
This repository documents practical robotics/control work with real-world estimator noise, coordination logic, and drone motion control.


