Mastering Drone Simulation: A Step-by-Step Guide to Using Microsoft's AirSim
- Dr. Daniel Dimanov
- Sep 10, 2024
- 4 min read
In an era where technology continually reshapes industries, the role of autonomous drones has become increasingly significant. These versatile machines are revolutionising sectors such as defence, agriculture, and firefighting, photography, search and rescue and much more. In defence, drones conduct surveillance and reconnaissance missions with unprecedented efficiency. In agriculture, they monitor crop health and optimise farming practices. Firefighting teams deploy drones to assess fire conditions and locate survivors quickly. These examples illustrate the transformative potential of drones, which is why the UK's Defence and Security Accelerator (DASA) has prioritised new UAS navigation solutions in their call for novel technologies. You can read more about DASA's challenge here.
To develop and deploy autonomous routines effectively, simulation is essential. This concept aligns with NVIDIA's Omniverse Digital Twins, where virtual replicas of physical systems enable extensive testing and optimisation. Among the most effective sandboxes for designing autonomous drone systems is Microsoft's AirSim, now succeeded by the more advanced Colosseum.
Why is Simulation Crucial for Autonomous Drones?
Simulation plays a pivotal role in the development of autonomous drones. It allows developers to test algorithms and behaviours in a controlled, risk-free environment before deploying them in real-world scenarios. This not only accelerates the development process but also ensures safety and reliability. NVIDIA's Omniverse Digital Twins epitomise this approach by creating highly detailed virtual environments that mimic real-world conditions, enabling thorough testing and fine-tuning of any autonomous systems.
Setting Up Microsoft's AirSim (Colosseum)
Setting up AirSim or its successor, Colosseum, used to be a complex process, particularly with the older Unreal Engine 4. However, CodexLabsLLC has streamlined the installation workflow, making it much more accessible. Below is a step-by-step guide to get you started with the latest and most stable release of Colosseum.
Step-by-Step Installation Guide
Clone the Repository
Clone the Colosseum repository from GitHub. It's recommended to use a stable release, such as the 2.1 repository release which supports UE 5.2. To do this, simply go to https://github.com/CodexLabsLLC/Colosseum/releases/tag/v2.1.0 and download the Source code (.zip) or simply click HERE
If you want to download the latest Colosseum please use the following:
You will need to have Git installed on your system in order to use the git command.
git clone https://github.com/CodexLabsLLC/Colosseum
cd Colosseum
Install the Epic Games Launcher and download the version of Unreal Engine that the Colosseum release supports. Ensure compatibility to avoid issues during setup.
To install Unreal Engine, please head to https://www.unrealengine.com/en-US/download, click download, install Epic Games Launcher, then open it and press on the Unreal Engine tab (on the left side menu) and install Unreal Engine 5.2
If you want to reproduce our environmental setup, please make sure to install Unreal Engine 5.2
Download and Install Visual Studio 2022:
Make sure to include the following components during installation:
Desktop Development with C++
Windows 10 SDK (version 10.0.19041)
The latest .NET Framework SDK
Ensure Visual Studio 2019 is not installed, as it may cause conflicts.
Development Tools for .Net
Start Developer Command Prompt for VS 2022:
Open the Developer Command Prompt that comes with Visual Studio 2022.
Run the Build Command:
Navigate to the cloned repository folder and run:
clean.cmd
build.cmd
Unreal/Plugin Folder Generation:
After the build process completes, an Unreal/Plugin folder will be generated. If you run into errors please make sure you run clean.cmd again, delete the AirSim folder inside the Environments/Blocks/Plugin folder and rebuild using build.cmd.
Reopen Epic Games and Unreal Engine:
Close and reopen the Epic Games Launcher and Unreal Engine to reassociate the AirSim plugin. You might need to close Unreal and Epic Games from the task manager and the taskbar. If you get no prompt. Don't worry if you don't get the prompt to reassociate, with some recent updates this seem to have been fixed.
Modify SimModeBase.cpp (if needed):
Before opening the Blocks environment created in Unreal/Environments, modify the SimModeBase.cpp file if you encounter errors.
Locate line 234 and replace the code as follows (starting with "#endif"). Inside the #endif delete the current code and put the following:
if(sun_prop){
if (UObject* sun_obj = sun_prop-> GetObjectPropertyValue_InContainer(sky_sphere_))
{
sun_ = Cast<ADirectionalLight>(sun_obj);
if (sun_)
default_sun_rotation_ = sun_->GetActorRotation();
}
}
Your final file should look like this:

Launch the Blocks Environment:
Open the sln file in the Unreal/Environments folder.
Click the play button in Visual Studio and then in Unreal Engine. You should see a message; click "No" to have your drone appear in the simulation.
Visual Workflow:




Set Up the Python Client:
Install the necessary Python library:
pip install msgpack-rpc-python
Run the hello_drone.py script from the PythonClient/multirotor folder:
python Colosseum-2.1.0/PythonClient/multirotor/hello_drone.py
Your drone should now take off within the simulation.
Conclusion
With these steps, you can set up and start using Microsoft's AirSim (Colosseum) for your drone simulation needs. This setup allows you to create realistic and reliable environments to test and develop autonomous drone behaviours, paving the way for innovations in various fields such as defence, agriculture, and firefighting. The process, though streamlined, still offers robust and versatile simulation capabilities essential for modern autonomous systems development.
Happy simulating!