A comprehensive, production-grade autonomous drone ecosystem. This repository integrates three core pillars of modern robotics: Failure Resilience, Multi-Agent Coordination, and AI-Driven Perception.
To validate the VANGUARD fail-safe autonomy, we run a high-fidelity Software-in-the-Loop (SITL) simulation using PX4 Autopilot and the cutting-edge Gazebo Harmonic (GZ Sim). The ROS 2 Brain controls the drone dynamically via offboard setpoints over a high-speed Micro-XRCE-DDS bridge.
Node switches PX4 to OFFBOARD mode, arms motors, and commands a stable 5m hover.
π¬ Emergency RTL Landing (Triggered by Failsafe)Simulated battery failure triggers safety state machine, commanding immediate Return-to-Launch.
Developing an end-to-end hardware-in-the-loop simulation requires solving deep integration issues between ROS 2, Micro-XRCE-DDS, and PX4. Here are the core challenges resolved in this architecture:
- DDS QoS Profile Mismatch (The Silent Drop):
- Challenge: The drone armed but refused to climb. The ROS 2 publisher was set to
TRANSIENT_LOCALdurability, while the PX4 Micro-XRCE-DDS subscriber strictly expectedVOLATILE. The middleware silently dropped all trajectory setpoints. - Solution: Analyzed the DDS middleware handshake and aligned the ROS 2 QoS profile to match PX4's
VOLATILEexpectations, successfully restoring the high-frequency offboard control link.
- Challenge: The drone armed but refused to climb. The ROS 2 publisher was set to
- CPU Throttling & Offboard Timeout:
- Challenge: When screen recording software was activated, CPU spikes starved the ROS 2 node. The setpoint publish rate dropped below PX4's strict 2Hz safety cutoff, causing the drone to instantly abort flight.
- Solution: Optimized the offboard control loop timer from 20Hz up to 50Hz, creating enough latency buffer to survive severe CPU throttling without triggering the autopilot's offboard loss failsafe.
- Failsafe RTL Mode Rejection:
- Challenge: Because internal pre-flight safety checks were bypassed for SITL testing, PX4 ignored standard failsafe fallback modes when a battery emergency was injected.
- Solution: Engineered the ROS 2 safety node to explicitly inject the MAVLink
VEHICLE_CMD_DO_SET_MODEforAUTO.LAND, forcing PX4 to hand over control and land gracefully without relying on internal fallbacks.
- WSL2 Cross-Drive Compilation Bottlenecks:
- Challenge: Compiling ROS 2 interfaces (
px4_msgs) on a mounted Windows drive from WSL took over 70 minutes due to cross-OS filesystem translation overhead. - Solution: Re-cloned and compiled
px4_msgsnatively inside the WSL Linux filesystem (~/px4_ws), cutting compile time down to just 2 seconds using underlay workspace sourcing.
- Challenge: Compiling ROS 2 interfaces (
This repository integrates three core pillars of modern robotics: Failure Resilience, Multi-Agent Coordination, and AI-Driven Perception.
- Status: Operational β
- Features: Multi-state failsafe logic, high-frequency telemetry logging, and Chaos Engineering (Failure Injection) verification.
- Status: Operational β
- Features: Decentralized discovery via Zenoh/DDS, multi-agent occupancy grid merging, and isolated namespace scaling.
- Status: Operational β
- Features: Simulated YOLOv10 vision stream, reactive potential field obstacle avoidance, and VIO-ready navigation stack.
This entire stack is containerized using Docker for instant reproduction on any system.
# Clone and Build cd Autonomous-UAV-Trinity-Stack docker-compose up -d # Launch the Full Trinity Stack ros2 launch swarm_coordinator swarm_launch.py
-Autonomous-UAV-Trinity-Stack/
βββ Dockerfile # Unified multi-stage container build spec
βββ docker-compose.yml # Chaos-simulation local orchestration config
βββ docs/
β βββ architecture.png # High-level DDS system architecture flow
β βββ vanguard_takeoff_hover_demo.mp4 # Takeoff offboard simulation flight video
β βββ vanguard_failsafe_landing_demo.mp4 # Battery failsafe emergency RTL flight video
βββ src/
β βββ guardian_system/ # Fail-safe monitoring logic package
β β βββ guardian_system/
β β β βββ black_box_logger.py # High-frequency flight event logger
β β β βββ guardian_node.py # Heartbeat diagnostic supervisor state machine
β β β βββ offboard_control.py # High-frequency PX4/DDS offboard setpoint link
β β βββ package.xml
β βββ swarm_coordinator/ # Multi-agent coordination package
β β βββ launch/
β β β βββ swarm_launch.py # Isolated namespace simulation launcher
β β βββ swarm_coordinator/
β β β βββ map_merger.py # P2P map & spatial grid merging node
β β β βββ swarm_coordinator.py # Distributed mission sequencing node
β β βββ package.xml
β βββ vanguard_interfaces/ # Custom ROS 2 msg interface definitions
β β βββ msg/
β β β βββ FailsafeAction.msg # Custom emergency action message definition
β β β βββ HealthStatus.msg # Custom multi-state telemetry message definition
β β βββ CMakeLists.txt
β βββ vio_nav_stack/ # AI Perception & VIO navigation stack
β βββ vio_nav_stack/
β β βββ obstacle_avoidance.py # APF reactive obstacle evasion logic
β β βββ perception_simulator.py # YOLO object detector perception simulator
β βββ package.xml
βββ zenoh_config.json5 # DDS router config for Zenoh overlay
βββ LICENSE # MIT License
βββ README.md # Main portfolio presentation guide
Architected and developed as a Senior Autonomous Systems Portfolio by Yogesh.