QGroundControl and AirSim Integration Guide - Setting Up Ground Station Control for Virtual Aircraft
Article Series
A total of two articles
QGroundControl and AirSim Integration Guide - Establishing STIL (Software-In-The-Loop)
QGroundControl and AirSim Integration Guide - Setting Up Ground Station Control for Virtual Aircraft
Tip:AirSim、SITL、QGroundControl、PX4、Ardupilot
Introduction
[AirSim] ←→ (TCP) ←→ [PX4 SITL(Software-In-The-Loop)] ←→ (UDP) ←→ [QGroundControl(QGC)]
This article explores how to achieve data transmission and control between AirSim, PX4 SITL, and QGroundControl. This architecture is designed for drone simulation environments, allowing developers to test flight control algorithms, navigation strategies, and automated flight plans in a virtual setting. It enables development and validation without requiring physical hardware.
| Term | Definition |
| AirSim | A drone simulation environment responsible for rendering the virtual world and providing physics simulation |
| PX4 SITL | The core of the flight control system, exchanging sensor data and control commands with AirSim via TCP |
| QGC | The ground station, communicating with PX4 SITL via UDP, providing a UI interface to monitor the drone's status and send control commands |
AirSim ↔ PX4 SITL AirSim simulates the physical environment of the drone and connects to PX4 SITL via TCP, while PX4 SITL is used to simulate the PX4 flight controller.
PX4 SITL ↔ QGroundControll Through UDP communication, PX4 SITL sends MAVLink messages to QGroundControl for monitoring, while PX4 SITL allows QGroundControl to send flight commands (such as takeoff, landing, and navigation).
This architecture allows developers to simulate complete drone missions within a software environment, and further integrate AI, autonomous navigation, and image processing technologies to enhance the intelligence capabilities of drones. This article will provide a detailed guide on how to set up this system.
Tips:Here is the main content of this article. The following examples are provided for reference.
一、Install Unreal Engine
- Installation URL:⭐ Epic Games Official Website
You need to log in and create an account before installing Unreal Engine. In UE5, the PhysX physics engine has been replaced with the Chaos physics engine. However, AirSim still relies on the PhysXVehicles plugin, meaning that AirSim is not officially supported in UE5. The best-supported version of AirSim is UE4.27. If you want to develop with UE5, you need to:
- Remove PhysXVehicles-related code in
AirSim/Source/AirSim.cpp. - Modify AirSimGameMode to support Chaos physics.
Set Environment Variablessetx Path "%Path%;C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\Win64"
二、Install Visual Studio 2022
- Installation URL:⭐ Visual Studio 2022 Official Download
You can try searching in the "Start Menu" :
x64 Native Tools Command Prompt for VS 2022
Unreal Engine officially supports only Microsoft Visual C++ (MSVC) as the compiler for the Windows platform, so AirSim must also be compiled using MSVC. The x64 Native Tools Command Prompt for VS 2022 ensures that AirSim is compiled with MSVC, preventing mismatches with the UE toolchain.
三、Download and Compile AirSim
- To quickly test AirSim, download the precompiled binaries:⭐AirSim release binaries
If you need to modify or further develop AirSim, download the source code:
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
Relevant PX4 Resources:
If an error occurs, you need to Clean before Build. Use the x64 Native Tools Command Prompt.
cd C:\Project Location\AirSim\
C:\Project Location\AirSim> clean.cmd
C:\Project Location\AirSim> build.cmd
After the Build process is completed, an Unreal Engine project file will be generated.

四、AirSim Parameter Configuration
Modify the settings.json file to enable QGroundControl (QGC) to connect with AirSim.
- Relevant AirSim Resource:
- ⭐https://microsoft.github.io/AirSim/px4_sitl_wsl2/ (Parameter Configuration Reference)
- ⭐AirSim Simulation (Video Guide)
- ⭐AirSim px4_setup
Modify the configuration file: C:\Users\xxx\Documents\AirSim\settings.json
{
"SettingsVersion": 1.2,
"SimMode": "Multirotor",
"ClockType": "SteppableClock",
"Vehicles": {
"PX4": {
"VehicleType": "PX4Multirotor",
"UseSerial": false,
"LockStep": true,
"UseTcp": true,
"TcpPort": 4560,
"ControlIp": "remote",
"ControlPortLocal": 14540,
"ControlPortRemote": 14580,
"LocalHostIp": "172.17.144.1",
"Sensors":{
"Barometer":{
"SensorType": 1,
"Enabled": true,
"PressureFactorSigma": 0.0001825
}
},
"Parameters": {
"NAV_RCL_ACT": 0,
"NAV_DLL_ACT": 0,
"COM_OBL_ACT": 1,
"LPE_LAT": 47.641468,
"LPE_LON": -122.140165
}
}
}
}
In WSL, enter "ip addr show eth0" to check the IP address:
In Windows, enter "ipconfig" in Command Prompt (cmd) to check the IP configuration:

五、Connect to Mission Planner
The connection IP that Mission Planner needs to configure is the IP of WSL. The connection between Mission Planner and SITL should be set to UDP to monitor the status of the AirSim simulated aircraft.
The port to configure will be displayed in the information shown when SITL is running in WSL.
QGC UDP Configuration Screen
Once connected successfully, you will be able to see the UAV settings in AirSim.

Summary
This guide explains how to integrate QGroundControl (QGC) with AirSim, enabling the ground station to control the virtual drone. Through this integration, developers can monitor the drone's status, plan flight routes, and control flights manually or autonomously in a simulated environment, without requiring physical hardware to test the operation of the PX4 flight control system.