Build AirSim on Windows

Install Unreal Engine

#. Download the Epic Games Launcher. While the Unreal Engine is open source and free to download, registration is still required. #.

Run the Epic Games Launcher, open the Library tab from left, click on the “Add Versions” which should show the option to download Unreal 4.18 as shown below. If you have multiple versions of Unreal installed then make sure 4.18 is “Current” by clicking down arrow next to the Launch button for the version.

Note: If you have UE 4.16 or older projects, please see the upgrade guide to upgrade your projects.

Build AirSim

  1. You will need Visual Studio 2017 (make sure to install VC++ and Windows SDK 8.x).
  2. Start x64 Native Tools Command Prompt for VS 2017. Create a folder for the repo and run git clone https://github.com/Microsoft/AirSim.git.
  3. Run build.cmd from the command line. This will create ready to use plugin bits in the Unreal\Plugins folder that can be dropped into any Unreal project.

Build Unreal Project

Finally, you will need an Unreal project that hosts the environment for your vehicles. AirSim comes with a built-in “Blocks Environment” which you can use, or you can create your own. Please see setting up Unreal Environment.

Setup Remote Control (Multirotor only)

A remote control is required if you want to fly manually. See the remote control setup for more details.

Alternatively, you can use APIs for programmatic control or use the so-called Computer Vision mode to move around using the keyboard.

How to Use AirSim

Once AirSim is set up by following above steps, you can,

  1. Double click on .sln file to load the Blocks project in Unreal\Environments\Blocks (or .sln file in your own custom Unreal project). If you don’t see .sln file then you probably haven’t completed steps in Build Unreal Project section above.
  2. Select your Unreal project as Start Up project (for example, Blocks project) and make sure Build config is set to “Develop Editor” and x64.
  3. After Unreal Editor loads, press Play button. Tip: go to ‘Edit->Editor Preferences’, in the ‘Search’ box type ‘CPU’ and ensure that the ‘Use Less CPU when in Background’ is unchecked.

See Using APIs and settings.json for various options available.

FAQ

I get error “‘corecrt.h’: No such file or directory” or “Windows SDK version 8.1 not found”

Very likely you don’t have Windows SDK installed with Visual Studio.

How do I use PX4 firmware with AirSim?

By default, AirSim uses its own built-in firmware called simple_flight. There is no additional setup if you just want to go with it. If you want to switch to using PX4 instead then please see this guide.

I made changes in Visual Studio but there is no effect

Sometimes the Unreal + VS build system doesn’t recompile if you make changes to only header files. To ensure a recompile, make some Unreal based cpp file “dirty” like AirSimGameMode.cpp.