PolySwarm: Multi-UAV Trajectory Generation and Control Framework

PolySwarm is a C++ and ROS 2-based control and trajectory generation framework for multi-drone systems, supporting dynamic disturbance modeling, detailed quadrotor physics, and layered control architecture.


🚁 Project Overview

PolySwarm is an advanced C++ framework built on ROS 2, designed to simulate and control multiple quadrotor UAVs navigating complex environments with precision and realism.

At its core, the system supports polynomial trajectory generation based on constraints like minimum time, acceleration, jerk, snap, crackle, or any weighted combination. It includes detailed quadrotor dynamics, multi-layer control architecture, and inter-agent aerodynamic disturbance modeling β€” such as propeller downwash effects.


🧱 Key Capabilities

  • βœ… Real-time multi-agent trajectory tracking
  • βœ… Generation of minimum-snap/jerk/time/crackle polynomial paths
  • βœ… Detailed physics: propulsion, attitude, and rigid-body dynamics
  • βœ… Full-stack control hierarchy:
    • Low-level: motor thrust & torque response
    • Mid-level: attitude and thrust control
    • High-level: position, heading, and waypoint following
  • βœ… Downwash modeling: if a UAV flies under another, the disturbance is applied

🧠 Architecture Layers

  1. High-Level Planning
    • Waypoint sequences connected using optimized polynomial segments
    • User-defined objectives: minimum-time, minimum-energy, etc.
  2. Mid-Level Control
    • Position & yaw control using PID, LQR, or geometric control
    • Integral compensation and derivative prediction
  3. Low-Level Dynamics
    • Motor lag, torque/thrust saturation, noise injection
    • Feedback controllers for angular velocity and orientation
  4. Multi-Agent Interaction
    • Disturbance-aware controllers based on vehicle proximity
    • Downwash effect modeled as a function of rotor thrust and vertical offset

βš™οΈ Technologies Used

  • C++ 20
  • ROS 2 Foxy / Humble
  • Eigen for fast matrix math
  • yaml-cpp for controller configs
  • rviz2 and PlotJuggler for real-time diagnostics

πŸ“¦ Repository Structure (Example)

 
    bash polyswarm_ws/ 
    β”œβ”€β”€ src/ β”‚ 
    β”‚   β”œβ”€β”€ traj_gen/ # Polynomial trajectory generator  
    β”‚   β”œβ”€β”€ quad_dynamics/ # Detailed UAV physics engine β”‚ 
    β”‚   β”œβ”€β”€ swarm_manager/ # Multi-agent coordination & downwash modeling 
    β”‚   └── controllers/ # Low-mid-high level control nodes 
    └── config/ 
        β”œβ”€β”€ traj_profiles.yaml 
        └── uav_models.yaml