ct_airsim.md
This file is a quick orientation guide for this checkout of AirSim. It focuses on where the main subsystems live, how API calls move through the stack, and which files usually need to change for common work.
AirSim is split into a platform-independent C++ core and simulator-specific front ends.
AirLib receives and models API calls, vehicles, sensors, physics, settings, and data structures.Unreal/Plugins/AirSim adapts the core to Unreal Engine actors, pawns, cameras, rendering, weather, and world objects.The docs that already cover the official architecture are:
docs/code_structure.mddocs/design.mddocs/dev_workflow.mddocs/adding_new_apis.md| Path | Purpose |
|---|---|
AirLib/ | Platform-independent C++ library: APIs, physics, sensors, settings, safety, vehicles, RPC client/server code. |
Unreal/Plugins/AirSim/ | Unreal Engine plugin implementation: sim modes, pawns, cameras, rendering, sensors, recording, weather, object control. |
PythonClient/ | Python package and sample scripts for AirSim RPC APIs. Main client binding is PythonClient/airsim/client.py. |
MavLinkCom/ | Standalone MAVLink communication library used by PX4 and ArduPilot integrations. |
HelloDrone/, HelloCar/, DroneShell/, DroneServer/ | Native sample and utility programs. |
ros/, ros2/ | ROS integration packages and wrappers. |
Unity/ | Experimental Unity integration. |
docs/ | MkDocs documentation source. Navigation is configured by mkdocs.yml. |
AirLibUnitTests/ | Native unit test project for core AirLib behavior. |
azure/, docker/, pipelines/ | Cloud, container, and CI support. |
AirLib is the C++ core that should remain independent of Unreal-specific classes.
AirLib/include/api/AirLib/src/api/RpcLibServerBase.cpp, AirLib/src/api/RpcLibClientBase.cppAirLib/include/api/RpcLibAdaptorsBase.hpp, AirLib/include/common/CommonStructs.hppAirLib/include/common/AirSimSettings.hppAirLib/include/physics/AirLib/include/sensors/AirLib/include/vehicles/multirotor/, AirLib/src/vehicles/multirotor/AirLib/include/vehicles/car/, AirLib/src/vehicles/car/AirLib/include/safety/, AirLib/src/safety/When adding fields to settings.json, start at AirLib/include/common/AirSimSettings.hpp.
Unreal/Plugins/AirSim/Source is the Unreal-facing layer.
AirSim.cpp, AirSim.h, AirSimGameMode.cppSimMode/SimModeBase.*, SimMode/SimModeWorldBase.*Vehicles/Multirotor/Vehicles/Car/Vehicles/ComputerVision/WorldSimApi.*PIPCamera.*, UnrealImageCapture.*, RenderRequest.*UnrealSensors/Recording/Weather/AirBlueprintLib.*, NedTransform.*Most environment-only APIs eventually land in WorldSimApi.cpp. Most camera behavior eventually lands in PIPCamera.cpp, UnrealImageCapture.cpp, or RenderRequest.cpp.
For a typical Python API call:
PythonClient/airsim/client.py exposes a method and calls self.client.call(...).AirLib/src/api/RpcLibServerBase.cpp binds that RPC method name to a C++ lambda.WorldSimApiBase.Unreal/Plugins/AirSim/Source perform the simulator work.For C++ clients, the public methods are declared in AirLib/include/api/RpcLibClientBase.hpp and implemented in AirLib/src/api/RpcLibClientBase.cpp.
Vehicle-specific RPC surfaces extend this pattern:
AirLib/include/vehicles/multirotor/api/, AirLib/src/vehicles/multirotor/api/AirLib/include/vehicles/car/api/, AirLib/src/vehicles/car/api/Use docs/adding_new_apis.md for the full upstream checklist. The usual file set is:
WorldSimApiBase or a vehicle API base.RpcLibServerBase.cpp or the vehicle-specific RPC server.RpcLibClientBase.hpp and RpcLibClientBase.cpp.PythonClient/airsim/client.py.If the API is vehicle-control-specific, check the multirotor or car API base classes first. If it changes the scene, cameras, weather, objects, textures, or levels, check WorldSimApi.* first.
This checkout includes CinemAirSim camera extensions marked with //CinemAirSim.
Important files:
Unreal/Plugins/AirSim/Source/PIPCamera.hUnreal/Plugins/AirSim/Source/PIPCamera.cppUnreal/Plugins/AirSim/Source/WorldSimApi.hUnreal/Plugins/AirSim/Source/WorldSimApi.cppAirLib/include/api/WorldSimApiBase.hppAirLib/include/api/RpcLibClientBase.hppAirLib/src/api/RpcLibClientBase.cppAirLib/src/api/RpcLibServerBase.cppPythonClient/airsim/client.pyThe main change is that APIPCamera derives from ACineCameraActor and uses UCineCameraComponent for lens, filmback, focal length, manual focus, focus distance, aperture, focus plane, and current field-of-view controls. If you touch these APIs, keep the declarations, RPC binding names, C++ client methods, Unreal implementation, and Python wrapper in sync.
Windows is the most mature development path for this Unreal-based repo.
build.cmdsetup.sh, then build.shclean.cmd, clean_rebuild.bat, clean.sh, clean_rebuild.shbuild_docs.bat, build_docs.shFor Unreal plugin development, the documented workflow is:
Unreal/Plugins into an Unreal environment such as Blocks.See docs/dev_workflow.md and docs/unreal_blocks.md for details.
AirLibUnitTests/PythonClient/multirotor/hello_drone.pyPythonClient/car/hello_car.pyPythonClient/computer_vision/cv_mode.pyPythonClient/computer_vision/external_camera.pyPythonClient/computer_vision/fov_change.pyPythonClient/multirotor/gimbal.pyWhen testing Python changes from source, scripts usually import local package paths through setup_path.py so they use the checkout version instead of an installed PyPI package.
AirLib/include/common/AirSimSettings.hppAirLib/include/api/WorldSimApiBase.hpp, Unreal/Plugins/AirSim/Source/WorldSimApi.cppAirLib/src/api/RpcLibServerBase.cppAirLib/src/api/RpcLibClientBase.cpp, PythonClient/airsim/client.pyUnreal/Plugins/AirSim/Source/PIPCamera.cpp, Unreal/Plugins/AirSim/Source/UnrealImageCapture.cppUnreal/Plugins/AirSim/Source/SimMode/AirLib/include/vehicles/multirotor/, Unreal/Plugins/AirSim/Source/Vehicles/Multirotor/AirLib/include/vehicles/car/, Unreal/Plugins/AirSim/Source/Vehicles/Car/