Cooperative payload transport with a drone swarm

Three Crazyflie drones carry a shared hanging payload via cables. An Optimal Control Problem (OCP) solved with CasADi generates collision-free, dynamically feasible trajectories for all drones simultaneously, then executes them on real hardware via ROS 2 and Crazyswarm2.

Jan 2026 - Mar 2026 | View Source
| PythonROS 2Optimal ControlCasADiDrones

Overview

Three Crazyflie 2.1 drones are each attached to the same payload by a cable and fly in coordinated formation. An OCP is solved offline using CasADi to find trajectories that simultaneously satisfy velocity, acceleration, jerk, cable tension, and obstacle constraints for all three drones. The solution is converted into 7th-degree polynomial segments compatible with the Crazyflie firmware, uploaded, and executed.

The package covers the full workflow:

1. Input: Payload reference path

Ellipse, figure-8, straight line, random walk, or obstacle course.

2. Planning: CasADi OCP solve

Jointly optimizes all drone trajectories under dynamics, cable tension, and obstacle constraints.

3. Conversion: Polynomial trajectory export

Converts the solution into 7th-degree polynomial segments for Crazyflie firmware.

4. Execution: Crazyswarm2 deployment

Uploads and executes the trajectories on real or simulated Crazyflie drones.

5. Analysis: Rosbag2 comparison

Compares planned and executed trajectories to evaluate tracking performance.

OCP solver

The solver treats the three drones and shared payload as one coupled trajectory optimization problem. At each solve, it:

  • takes a payload reference path and obstacle definition as input,
  • optimizes the full state and input trajectory for all drones at once,
  • enforces dynamic feasibility through bounds on velocity, acceleration, jerk, and cable tension,
  • adds obstacle avoidance through a soft barrier cost,
  • outputs smooth trajectories that are then converted into Crazyflie polynomial segments for execution.
minJ=Jtrack+Jrest+Jform+Jobss.t.dynamics,boundary conditions,speed / acceleration / jerk limits,rigid drone-payload distances,tension bounds,drone separation.\begin{aligned} \min \quad & J = J_{\mathrm{track}} + J_{\mathrm{rest}} + J_{\mathrm{form}} + J_{\mathrm{obs}} \\ \text{s.t.} \quad & \text{dynamics}, \\ & \text{boundary conditions}, \\ & \text{speed / acceleration / jerk limits}, \\ & \text{rigid drone-payload distances}, \\ & \text{tension bounds}, \\ & \text{drone separation}. \end{aligned}

Cost function

  • JtrackJ_{\mathrm{track}}: waypoint tracking and low payload speed at those waypoints.
  • JrestJ_{\mathrm{rest}}: low final payload velocity and acceleration.
  • JformJ_{\mathrm{form}}: desired final cable geometry / drone formation.
  • JobsJ_{\mathrm{obs}}: soft obstacle barrier for payload and drones.

Constraints

  • Dynamics and start/end conditions.
  • Velocity, acceleration, and jerk limits.
  • Rigid drone-payload distances and tension bounds.
  • Drones remain above the payload.
  • Minimum separation between drones.

All listed constraints are hard constraints and must always be satisfied. The waypoint-tracking and obstacle-avoidance terms are handled softly through the objective, which lets the solver trade tracking quality against feasibility when needed.

Trajectory animation

States

State and trajectory plot for the Crazyflie payload transport system

with transient trail

with persistent trail

Conclusions

  • The OCP approach successfully generates feasible trajectories for multiple drones carrying a shared payload, demonstrating the potential of optimal control for cooperative multi-agent systems.
  • Obstacle avoidance is handled effectively through a soft barrier term in the objective, allowing the drones to navigate complex environments while maintaining payload stability. It is crucial to tune those penalties against the hard feasibility constraints to balance trajectory optimality with robustness to disturbances and model inaccuracies.
  • The Crazyflie platform provides a flexible testbed with ROS 2 for multi-drone coordination, but accurate localization remains a significant challenge. The current reliance on external tracking systems limits real-world applicability.

Future work

  • Online OCP via MPC — the trajectory solver currently runs offline; the next step is to turn it into an online Model Predictive Control (to solve a finite-horizon OCP repeatedly) so the drones can replan in flight.
  • Online path planning — the payload reference path is currently specified from known obstacle positions; replacing this with an online A* or RRT search would allow the system to adapt to new environments autonomously.
  • Obstacle detection from video — obstacle geometry is currently provided manually; feeding a camera stream into a perception pipeline would let the planner discover and update obstacle data in real time.
  • Localization — accurate localization is the hardest scaling challenge. The current setup relies on a Lighthouse base station for precise positioning; operating without fixed infrastructure would require a robust onboard or distributed localization solution before this approach can transfer to real-world environments.
  • Decentralized Control — centralized OCP solvers can compute coordinated trajectories for multiple agents, but scalability and real-time performance are concerns. Future work should explore decentralized or hierarchical control architectures to enable real-time coordination.
Crazyflie drones carrying a payload