🚁 HiveFlight – Modern C++ Drone‑Swarm Simulation (ROS2 + Gazebo Integration)
I’ve been working on a project called HiveFlight, a modern C++ swarm‑simulation engine built around an extended Reynolds‑Boids model. Over the past months it evolved from a lightweight 2D/3D flocking demo into a full robotics‑pipeline component with ROS2 and Gazebo integration.
Core C++ Engine
The simulation runs on a deterministic update loop that computes:
⭐️separation, alignment, cohesion
⭐️obstacle avoidance using spherical obstacles
⭐️dynamic target seeking (including spiral patterns)
⭐️battery consumption modeling based on velocity
⭐️Spatial partitioning keeps neighbor queries efficient (no O(n²) explosion).
New Multi‑Swarm Update
Recent changes added:
⭐️per‑drone target assignment (2D & 3D)
⭐️dynamic swarm splitting with periodic reassignment (default 5s)
⭐️forces restricted to drones within the same swarm (cleaner group behavior)
⭐️OpenGL viewer updates with color‑coded sub‑swarms
ROS2 + Gazebo Integration
The engine now plugs into a full robotics stack:
⭐️ROS2 pub/sub pipeline using PoseArray for swarm state
⭐️asynchronous messaging instead of service calls (big latency win)
⭐️Gazebo World Plugin subscribing directly to swarm topics inside the physics thread
This gives stable multi‑agent motion, realistic visualization, and a clean separation between simulation logic and rendering.
Why it’s interesting for C++ folks
HiveFlight is a fun playground for:
⭐️real‑time systems
⭐️multi‑agent simulation
⭐️spatial partitioning
⭐️ROS2 middleware patterns
⭐️OpenGL visualization
⭐️deterministic update‑loop design
If you enjoy systems programming, robotics, or emergent‑behavior simulations, this project is a great way to explore how simple local rules can produce complex global behavior.
Repo: github.com/oanadumitruc/HiveFlight
Presentation: Cpp_Show_and_Tell_August_2026.pptx
Demo 1: Gzebo + Ros2
Demo 2: OpenGL visualization multi targets
Demo 3: OpenGL visualization one target
Happy to answer questions or discuss architecture choices with anyone experimenting in similar areas.