Skip to content

VTOL AirSim Quickstart Guide

This guide is for running a simulation of a tiltrotor VTOL vehicle inside a prebuilt binary of the CityBlocks world - a custom world modified for AirSim by the MAGICC Lab. The driving script, complete with trajectory generation, controllers, and an AirSim client, is geometric_control_airsim_sim.py, located in the vtolsim repository.

Here is what you will need to do to run the script geometric_control_airsim_sim.py:

  1. Download the latest CityBlocks zip archive here and unzip it to wherever you like
  2. Create a file at ~/Documents/AirSim/settings.json - or modify it if it already exists - with the following settings (see the example settings.json below):
    • "SimMode": "Vtol"
    • a vehicle with "VehicleType": "vtolsimple"
  3. Clone the BYU-MAGICC fork of Airsim somewhere - git@github.com:byu-magicc/AirSim or https://github.com/byu-magicc/AirSim
  4. If you haven't already, create a python virtual environment specifically for AirSim (it will make everything simpler for AirSim)
    • e.g. python -m venv ~/.virtualenvs/airsim
  5. Activate your AirSim virtual environment
    • e.g. source ~/.virtualenvs/airsim/bin/activate
  6. cd into AirSim/PythonClient and run pip install -e .
  7. Now clone vtolsim: git clone --recursive git@magiccvs.byu.edu:urbanmobility/vtolsim/vtolsim.git
  8. cd into vtolsim/geometric_controller
  9. In another terminal session, start running <path to CityBlocks dir>/LinuxNoEditor/CityBlocks.sh
  10. Now you can run python geometric_control_airsim_sim.py and it should fly the trajectory.

Example settings.json:

{
  "SettingsVersion": 1.2,
  "SimMode": "Vtol",
  "ClockSpeed": 1.0,
  "LogMessagesVisible": false,
  "Vehicles": {
    "uav0": {
      "VehicleType": "vtolsimple"
    }
  }
}

Notes:

  • Lower the ClockSpeed setting if your machine is struggling to run vtolsim + AirSim.
    • e.g. "ClockSpeed": 0.6 to run the simulation at 60% real time
  • Set LogMessagesVisible: true if you need that, but having it off is better for recording video.