Back to projects
RoboticsCompleted

Autonomous Drone Simulation Environment: PX4, ROS 2 & Gazebo

A high fidelity simulation stack integrating PX4 flight control, ROS 2 Humble, and Gazebo Harmonic physics with procedural urban world generation.

Overview

Development and testing of autonomous aerial robotics software require high fidelity simulation before deployment to physical hardware. This project implements an end to end simulation environment linking professional flight control firmware with modern robotics middleware and dynamic 3D world rendering. The underlying architecture operates on Ubuntu 22.04 LTS and brings together PX4 Autopilot version 1.14 in Software In The Loop mode, ROS 2 Humble Hawksbill, and Gazebo Harmonic physics. The framework operates as a modular multi process system. PX4 SITL executes authentic flight controller firmware responsible for state estimation, position control, motor mixing, and safety failsafes. Gazebo Harmonic handles rigid body physics simulation, aerodynamic forces, and real time sensor rendering including optical cameras and 3D LiDAR. Communication between the ROS 2 computational graph and the PX4 flight stack is mediated by MAVROS over MAVLink and DDS protocols, enabling high frequency trajectory setpoint transmission and vehicle telemetry feedback. To test obstacle avoidance algorithms in unstructured environments, the project includes a procedural environment generator script named generate city. This utility dynamically outputs SDF world files containing a configurable grid of procedural building structures, road networks, and environmental obstacles. The generated 400 by 400 meter urban terrain provides varied geometric spatial constraints to evaluate collision free path planning algorithms. The simulation stack includes custom utility nodes for mission monitoring and visual tracking. A high frequency camera controller node implements a follow camera tracking loop, maintaining a fixed offset behind the quadrotor during flight maneuvers. Sensor telemetry and live video feeds are encoded and streamed over UDP to QGroundControl, allowing real time flight dashboard verification identical to field ground station operations. All launch scripts, procedural generation tools, world templates, and execution instructions are organized inside the repository to ensure full setup reproducibility across Linux development environments.

Tech Stack

CPythonROS 2 HumblePX4 AutopilotGazebo HarmonicMAVROSMAVLinkQGroundControlLinux

Empirical Benchmarks

Ubuntu 22.04 LTS

Target Platform

ROS 2 Humble Hawksbill

ROS Distribution

PX4 Autopilot v1.14 SITL

Flight Controller Firmware

Gazebo Harmonic

Physics Engine

400m x 400m Procedural Urban Mesh

Terrain Generator

MAVLink DDS UDP Bridge

Communication Protocol