A repository for generating and flying 3D flower trajectories for a swarm of Crazyflie drones.
uv sync
uv run flower_generator.pypython3 -m venv .venv
source .venv/bin/activate
pip install .
python3 flower_generator.pyNo 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}.jsonandflower_trajectories/petals{n}.json
If you don't have Rust installed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envThe 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.
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.
- Generate the trajectories with
flower_generator.py(see above) - Set the drone URIs in
examples/flower_swarm.rs - Run:
cargo run --example flower_swarm

