PX4 Autopilot Software
Setting Up a PX4 SITL Loop with Gazebo
Build a local PX4 software-in-the-loop environment with Gazebo and QGroundControl.
how to Reviewed 8/13/2026
Problem definition
I want a local PX4 development loop where firmware changes can be tested in simulation before touching hardware.
Steps
- Prepare the PX4 toolchain
Clone the PX4 repository and follow its official toolchain setup for your host operating system.
- Build the SITL target
Build the software-in-the-loop target using the commands in the official PX4 build instructions.
- Launch the simulator
Start the Gazebo simulation target so a simulated vehicle appears.
- Connect the ground station
Start QGroundControl and connect it to the SITL instance; verify telemetry and parameter access.
- Verify MAVLink flow
Confirm that messages flow between firmware, simulator and ground station before development work.
Guide
Setup
Use the official PX4 toolchain; this guide links the repositories, it does not replace the official setup instructions.
Judgment criteria
- The loop is working when the ground station shows live telemetry from the simulated vehicle.
- Version-specific steps always come from the official PX4 docs.
Common risks
- Using an outdated simulator pairing that the current firmware no longer supports.
- Skipping the official toolchain and getting build errors unrelated to your change.
Checklist
Related technical resources
Open source robotics simulator. The latest version of Gazebo.
Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
Marshalling / communication library for drones.
Set of plugins, models and worlds to use with OSRF Gazebo Simulator in SITL and HITL.
Simple multirotor simulator with MAVLink protocol support
Plugins and models for vehicle simulation in Gazebo Sim with ArduPilot SITL controllers