Autonomous 3-drone swarm with quaternion EKF state estimation, LQR attitude control, minimum-snap trajectory generation, and graph Laplacian formation control.
Built on ROS2 Humble + PX4 SITL + Gazebo | Author: Maanav Shah | Purdue ECE
IMU (250Hz) ──→ Quaternion EKF ──→ State Estimate GPS (30Hz) ──→ │ │ Gazebo GT ──→ NIS/NEES Validation │ ↓ LQR Attitude Controller │ ↓ Minimum-Snap Trajectory Follower │ ↓ Graph Laplacian Formation Control (3 agents)
- State vector:
[pos(3), vel(3), quat(4), accel_bias(3), gyro_bias(3)]— 16 states - Exact discrete quaternion update:
q_{k+1} = q_k ⊗ exp(0.5 * ω * dt) - Unit quaternion re-normalization after every prediction step
- Gyro + accel bias modeled as random walk with tuned process noise
- Joseph form covariance update:
P = (I-KH)P(I-KH)^T + KRK^T - NIS/NEES within 95% chi-squared bounds confirming filter consistency
Terminal 1 — PX4 SITL + Gazebo:
cd ~/PX4-Autopilot && make px4_sitl gz_x500Terminal 2 — ROS2 Bridge:
MicroXRCEAgent udp4 -p 8888Terminal 3 — EKF Node:
source ~/SwarmAero/ros2_ws/install/setup.bash
ros2 run swarm_ekf ekf_nodeHit Ctrl+C to stop and auto-save NIS/NEES plots to results/.
- ROS2 Humble
- PX4-Autopilot (SITL)
- Gazebo 8
- micro-XRCE-DDS-Agent
- Python: numpy, scipy, matplotlib, transforms3d
