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 Engine
tab on the left pane. Click on theInstall
button 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 tocurrent
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#
- 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.
- Start
Developer Command Prompt for VS 2022
. -
Clone the repo:
git clone https://github.com/Microsoft/AirSim.git
, and go the AirSim directory bycd AirSim
.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.
-
Run
build.cmd
from the command line. This will create ready to use plugin bits in theUnreal\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. 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.
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,
-
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.
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.
AirSim on Unity (Experimental)#
Unity is another great game engine platform and we have an experimental integration of AirSim with Unity. Please note that this is work in progress and all features may not work yet.