Skip to content

ArisMorgens/Crazyflie-Flower-Swarm

Repository files navigation

Crazyflie Flower Swarm

A repository for generating and flying 3D flower trajectories for a swarm of Crazyflie drones.

Python — generate trajectories

With uv (recommended)

uv sync
uv run flower_generator.py

With pip

python3 -m venv .venv
source .venv/bin/activate
pip install .
python3 flower_generator.py

No system packages required — all dependencies install via pip/uv.

Running flower_generator.py will:

  • Display an interactive 3D plot of the flowers
  • Write flower_trajectories/stem{n}.json and flower_trajectories/petals{n}.json

Rust — fly the swarm

Install Rust

If you don't have Rust installed:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Before running the swarm — cache the TOC

The Crazyflie communicates through a Table of Contents (TOC), a map of all the parameters and log variables the drone exposes. On the first connection, the TOC is downloaded from the drone and cached. Every subsequent connection reuses this cache, which is the main reason connections are so fast.

If all your drones run the same firmware, they share an identical TOC, so connecting to just one of them before running the script for the swarm is enough to cache it for all.

Trajectories are relative to each drone's starting position

The trajectories generated by flower_generator.py are expressed relative to the initial position of each drone, so be carefull where you place your drones before takeoff.

Run

  1. Generate the trajectories with flower_generator.py (see above)
  2. Set the drone URIs in examples/flower_swarm.rs
  3. Run:
cargo run --example flower_swarm

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages