Skip to content

Project on Programming Language and Environment for Cyber-physical Systems based on AirSim simulator

Notifications You must be signed in to change notification settings

CyPhAi-Project/Project-AirSimPLE

Repository files navigation

AirSimPLE

This repository is my attempt to strip down the original AirSim project (https://github.com/microsoft/AirSim) with only the Unreal Engine-based simulator and the Python API.

Download Source Code

Required Software:

To clone the repository to a folder airsimple-repo and download all asset files using Git LFS:

git clone https://github.com/CyPhAi-Project/Project-AirSimPLE.git airsimple-repo
cd airsimple-repo/
git lfs pull

Build the Project through Command Line

Required Software (Tested with the following on Windows 11):

Build Configurations

To specify the particular version of the tool chain for building, please create or modify the following file Documents/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml with the following:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <WindowsPlatform>
        <CompilerVersion>14.38.33145</CompilerVersion>
    </WindowsPlatform>
</Configuration>

NOTE: We provide a copy in AirSimPLE/Saved/UnrealBuildTool/BuildConfiguration.xml as suggested in Unreal Engine 5.2 Build Configuration. This is however not working for Unreal Engine 5.2.1 so far. We therefore suggest copying the file to the folder Documents/Unreal Engine/UnrealBuildTool/.

Build Command

If you are building under Windows CMD, run the command

build-game.cmd

It may take 20~30 minutes to build the game. Once the build is successful, you should be able to find the executable FlyingExample.exe under the AirSimPLE\Binaries\Win64 folder.

Install Python Client API airsimple

Required Software (Tested with the following on Windows 11):

  • Python 3.10

We recommend creating and activating a virtual environment as follows:

python -m venv venv
venv\Scripts\activate

Install the client API in editable mode

pip install -e PythonClient

Start the FlyingExample Map and Run hello_drone.py

Double click to execute FlyingExample.exe that starts a game as the simulation environment. You may be asked if you would like a car simulation. Select no to start the quadrotor simulation. You may also be asked if you would like to configure the firewall to allow the connection. Allow the connection so that the Python client can communicate with the game.

Once the game is started. Go back to the command line terminal with the Python virtual environment and run:

python PythonClient\scripts\hello_drone.py

This will start the Python script that interacts with the game. Follow the instructions in the command line messages. You should be able to see some information of the simulated drone as well as control the drone to take off and take camera images.

Open the Project in Unreal Editor

Open AirSimPLE.uproject under the AirSimPLE folder

About

Project on Programming Language and Environment for Cyber-physical Systems based on AirSim simulator

Topics

Resources

Stars

Watchers

Forks

Languages