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
Unreal Enginetab on the left pane. Click on the
Installbutton on the top right, which should show the option to download Unreal Engine >= 4.27. Chose the install location to suit your needs, as shown in the images below. If you have multiple versions of Unreal installed then make sure the version you are using is set to
currentby 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.
- Install Visual Studio 2022. Make sure to select Desktop Development with C++ and Windows 10 SDK 10.0.19041 (should be selected by default) and select the latest .NET Framework SDK under the 'Individual Components' tab while installing VS 2022.
Developer Command Prompt for VS 2022.
Clone the repo:
git clone https://github.com/Microsoft/AirSim.git, and go the AirSim directory by
Note: It's generally not a good idea to install AirSim in C drive. This can cause scripts to fail, and requires running VS in Admin mode. Instead clone in a different drive such as D or E.
build.cmdfrom the command line. This will create ready to use plugin bits in the
Unreal\Pluginsfolder 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. Make sure to close and re-open the Unreal Engine and the Epic Games Launcher before building your first environment if you haven't done so already. After restarting the Epic Games Launcher it will ask you to associate project file extensions with Unreal Engine, click on 'fix now' to fix it. 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.
How to Use AirSim#
Once AirSim is set up by following above steps, you can,
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.
Note: Unreal 4.27 will auto-generate the .sln file targetting Visual Studio 2019. Visual Studio 2022 will be able to load and run this .sln, but if you want full Visual Studio 2022 support, you will need to explicitly enable support by going to 'Edit->Editor Preferences->Source Code' and selecting 'Visual Studio 2022' for the 'Source Code Editor' setting.
Select your Unreal project as Start Up project (for example, Blocks project) and make sure Build config is set to "Develop Editor" and x64.
- After Unreal Editor loads, press Play button.
Go to 'Edit->Editor Preferences', in the 'Search' box type 'CPU' and ensure that the 'Use Less CPU when in Background' is unchecked.