# sairisan123/projectairsim architecture

> Architecture diagram of the GitHub repository sairisan123/projectairsim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sairisan123/projectairsim
- Repository: https://github.com/sairisan123/projectairsim

## Overview

#### Purpose and execution model
Project AirSim is a C++ simulation platform for autonomous drones, rovers, robots, sensors, controllers, and custom physics, hosted primarily by Unreal Engine 5; Unity support is also present. The root build entry points are `build.sh`, `build.cmd`, and `CMakeLists.txt`. A standalone native simulator sample starts at `samples/standalone_sim/main.cpp`; the principal graphical host is the Unreal Blocks project at `unreal/Blocks/Blocks.uproject`.

#### Core simulation libraries
`core_sim` defines the engine-independent simulation model and tick-time orchestration: simulator, scene, actors/robots, transforms, clock, environment, runtime components, and service/topic abstractions.
- `core_sim/include/core_sim/simulator.hpp`
- `core_sim/src/simulator.cpp`
- `core_sim/src/scene.cpp`

Configured scenes instantiate robot and environment actors; the simulation advances clock/state, transforms, actuators, physics, and sensors. This is the core boundary that rendering hosts and network APIs integrate against.

#### Robot structure, actuation, and sensing
Robots are composed from links, joints, geometry/inertial definitions, actuators, and sensors. Actuator commands are mapped to rotors, wheels, gimbals, tilt mechanisms, or control surfaces; sensors generate typed simulation messages for camera, lidar, radar, GPS, IMU, battery, and related modalities.
- `core_sim/src/actor/robot.cpp`
- `core_sim/src/actuators/control_mapper.cpp`
- `core_sim/src/sensors/sensor.cpp`

Transform-tree and message types separate internal simulation state from published observation/control payloads.

#### Physics and vehicle-control boundary
Physics implementations are independently selectable: fast native physics, Unreal-backed physics, and MATLAB integration. Vehicle APIs provide controller-facing behavior for multirotors, VTOL/fixed-wing variants, and Ackermann rovers, including built-in simple-flight/simple-drive and MAVLink/ArduCopter adapters.
- `physics/src/physics_world.cpp`
- `physics/src/fast_physics.cpp`
- `vehicle_apis/multirotor_api/src/mavlink_api.cpp`

Control flow is controller/setpoint → vehicle API → actuator outputs → physics state → sensor/state messages. MATLAB S-functions enable external control or physics models.

#### Host rendering and engine integration
The Unreal ProjectAirSim plugin loads configuration, creates and synchronizes scene/robot representations, supplies engine-rendered sensor implementations, and bridges host-thread/render-thread concerns to native simulation libraries.
- `unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/UnrealSimLoader.cpp`
- `unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/UnrealScene.cpp`
- `unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/Sensors/UnrealCamera.cpp`

Unity has an analogous C# host plus native wrapper:
- `unity/BlocksUnity/Assets/ProjectAirSimAssets/Scripts/UnitySimLoader.cs`
- `unity/sim_unity_wrapper/src/sim_unity_wrapper.cpp`

GIS/tiled scene rendering is a separate subsystem, with glTF and Bing-map utilities:
- `rendering/scene/src/tile_manager.cpp`
- `rendering/scene/src/gltf_data_provider.cpp`

#### Network APIs and clients
The simulator exposes services/topics and request/response messages; Python clients are the primary end-user automation layer. The Python package provides client, drone, rover, world, mission, and environment-actor APIs, while a Windows C++ DLL supplies another client surface.
- `client/python/projectairsim/src/projectairsim/client.py`
- `client/python/projectairsim/src/projectairsim/drone.py`
- `client/cpp/AirSimClientDLL/src/Client.cpp`

The service/topic layer is the key process/network boundary:
- `core_sim/src/service_manager.cpp`
- `core_sim/src/topic_manager.cpp`

#### Integrations and higher-level workloads
MAVLink networking supports external autopilots over TCP/UDP/serial, including PX4 and ArduPilot workflows.
- `mavlinkcom/src/MavLinkConnection.cpp`
- `mavlinkcom/src/MavLinkVehicle.cpp`

ROS 1, ROS 2, and rosbridge nodes translate simulation data and commands for robotics ecosystems. Python tooling adds synthetic data collection, augmentation, trajectory generation, validation, Gym environments, and ONNX-based perception/serving.
- `ros/node/projectairsim-ros2/src/projectairsim_ros2/ros2_node.py`
- `client/python/projectairsim/src/projectairsim/datacollection/data_generator.py`
- `client/python/projectairsim/src/projectairsim/autonomy/serving/serve_onnx.py`

Material infrastructure includes CMake/Visual Studio builds, Unreal Engine 5.2/5.7, Windows 11 and Ubuntu 22, optional Docker headless rendering, Azure CI/deployment pipelines, and optional Azure Blob data collection.

Main entry points: [`core_sim/src/simulator.cpp`](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/simulator.cpp) (Core simulator), [`core_sim/src/service_manager.cpp`](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/service_manager.cpp) (Services and topics), [`unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/UnrealSimLoader.cpp`](https://github.com/sairisan123/projectairsim/blob/main/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/UnrealSimLoader.cpp) (Unreal host plugin), [`core_sim/src/actor/robot.cpp`](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/actor/robot.cpp) (Robot composition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Native simulation"]
  node_build["Native build entry points<br/>build system<br/>[CMakeLists.txt]"]
  node_simulator["Core simulator<br/>simulation runtime<br/>[simulator.cpp]"]
  node_scene["Scene and actors<br/>world model<br/>[scene.cpp]"]
  node_robot["Robot composition<br/>robot model<br/>[robot.cpp]"]
  node_actuation["Control mapper<br/>actuation<br/>[control_mapper.cpp]"]
  node_sensors["Simulated sensors<br/>sensor model<br/>[sensor.cpp]"]
  node_services["Services and topics<br/>network boundary"]
end

subgraph group_hosts["Simulation hosts"]
  node_unreal["Unreal host plugin<br/>UE5 integration"]
  node_unreal_camera["Unreal camera sensor<br/>rendered sensor<br/>[UnrealCamera.cpp]"]
  node_unity["Unity host and wrapper<br/>Unity integration<br/>[UnitySimLoader.cs]"]
  node_tiles["Tiled GIS renderer<br/>scene rendering<br/>[tile_manager.cpp]"]
  node_standalone["Standalone simulator sample<br/>native host<br/>[main.cpp]"]
end

subgraph group_control["Control and physics"]
  node_physics["Selectable physics<br/>physics runtime<br/>[physics_world.cpp]"]
  node_vehicle_api["Vehicle APIs<br/>controller adapter<br/>[mavlink_api.cpp]"]
  node_mavlink["MAVLink bridge<br/>autopilot integration"]
end

subgraph group_clients["APIs and integrations"]
  node_python_client["Python client APIs<br/>automation client<br/>[client.py]"]
  node_cpp_client["C++ client DLL<br/>native client<br/>[Client.cpp]"]
  node_ros2["ROS 2 node<br/>robotics bridge<br/>[ros2_node.py]"]
end

subgraph group_workloads["Data and autonomy"]
  node_data["Data collection<br/>synthetic data workload<br/>[data_generator.py]"]
  node_onnx["ONNX autonomy serving<br/>perception workload<br/>[serve_onnx.py]"]
end

node_build -->|"builds"| node_simulator
node_standalone -->|"hosts"| node_simulator
node_unreal -->|"integrates"| node_simulator
node_unity -->|"wraps"| node_simulator
node_simulator -->|"advances"| node_scene
node_scene -->|"instantiates"| node_robot
node_robot -->|"contains"| node_actuation
node_robot -->|"contains"| node_sensors
node_actuation -->|"applies outputs to"| node_physics
node_physics -->|"returns state"| node_simulator
node_sensors -->|"publishes messages"| node_services
node_services -->|"receives control"| node_vehicle_api
node_vehicle_api -->|"produces commands"| node_actuation
node_mavlink -->|"external autopilot"| node_vehicle_api
node_unreal -->|"implements"| node_unreal_camera
node_unreal -->|"renders scene tiles"| node_tiles
node_python_client -->|"service/topic client"| node_services
node_cpp_client -->|"service/topic client"| node_services
node_ros2 -->|"translates ROS"| node_services
node_data -->|"automates"| node_python_client
node_onnx -->|"drives simulation"| node_python_client

click node_build "https://github.com/sairisan123/projectairsim/blob/main/CMakeLists.txt"
click node_simulator "https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/simulator.cpp"
click node_scene "https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/scene.cpp"
click node_robot "https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/actor/robot.cpp"
click node_actuation "https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/actuators/control_mapper.cpp"
click node_sensors "https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/sensors/sensor.cpp"
click node_services "https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/service_manager.cpp"
click node_physics "https://github.com/sairisan123/projectairsim/blob/main/physics/src/physics_world.cpp"
click node_vehicle_api "https://github.com/sairisan123/projectairsim/blob/main/vehicle_apis/multirotor_api/src/mavlink_api.cpp"
click node_mavlink "https://github.com/sairisan123/projectairsim/blob/main/mavlinkcom/src/MavLinkConnection.cpp"
click node_unreal "https://github.com/sairisan123/projectairsim/blob/main/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/UnrealSimLoader.cpp"
click node_unreal_camera "https://github.com/sairisan123/projectairsim/blob/main/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/Sensors/UnrealCamera.cpp"
click node_unity "https://github.com/sairisan123/projectairsim/blob/main/unity/BlocksUnity/Assets/ProjectAirSimAssets/Scripts/UnitySimLoader.cs"
click node_tiles "https://github.com/sairisan123/projectairsim/blob/main/rendering/scene/src/tile_manager.cpp"
click node_python_client "https://github.com/sairisan123/projectairsim/blob/main/client/python/projectairsim/src/projectairsim/client.py"
click node_cpp_client "https://github.com/sairisan123/projectairsim/blob/main/client/cpp/AirSimClientDLL/src/Client.cpp"
click node_ros2 "https://github.com/sairisan123/projectairsim/blob/main/ros/node/projectairsim-ros2/src/projectairsim_ros2/ros2_node.py"
click node_data "https://github.com/sairisan123/projectairsim/blob/main/client/python/projectairsim/src/projectairsim/datacollection/data_generator.py"
click node_onnx "https://github.com/sairisan123/projectairsim/blob/main/client/python/projectairsim/src/projectairsim/autonomy/serving/serve_onnx.py"
click node_standalone "https://github.com/sairisan123/projectairsim/blob/main/samples/standalone_sim/main.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_build,node_simulator,node_scene,node_robot,node_actuation,node_sensors,node_services toneBlue
class node_unreal,node_unreal_camera,node_unity,node_tiles,node_standalone toneAmber
class node_physics,node_vehicle_api,node_mavlink toneMint
class node_python_client,node_cpp_client,node_ros2 toneRose
class node_data,node_onnx toneIndigo
```

## Components

### Native simulation

- [Native build entry points](https://github.com/sairisan123/projectairsim/blob/main/CMakeLists.txt): build system · CMake and platform scripts build the native platform. · `CMakeLists.txt`
- [Core simulator](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/simulator.cpp): simulation runtime · Engine-independent tick orchestration, scene state, and runtime components. · `core_sim/src/simulator.cpp`
- [Scene and actors](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/scene.cpp): world model · Configured environments and robot actors populate the simulation. · `core_sim/src/scene.cpp`
- [Robot composition](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/actor/robot.cpp): robot model · Links, joints, geometry, actuators, and sensors form robots. · `core_sim/src/actor/robot.cpp`
- [Control mapper](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/actuators/control_mapper.cpp): actuation · Maps commands to vehicle mechanisms. · `core_sim/src/actuators/control_mapper.cpp`
- [Simulated sensors](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/sensors/sensor.cpp): sensor model · Produces typed camera, lidar, radar, GPS, IMU, and battery messages. · `core_sim/src/sensors/sensor.cpp`
- [Services and topics](https://github.com/sairisan123/projectairsim/blob/main/core_sim/src/service_manager.cpp): network boundary · Publishes simulation observations and accepts requests and commands. · `core_sim/src/service_manager.cpp`

### Simulation hosts

- [Unreal host plugin](https://github.com/sairisan123/projectairsim/blob/main/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/UnrealSimLoader.cpp): UE5 integration · Loads and synchronizes native simulation with Unreal scenes and rendering. · `unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/UnrealSimLoader.cpp`
- [Unreal camera sensor](https://github.com/sairisan123/projectairsim/blob/main/unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/Sensors/UnrealCamera.cpp): rendered sensor · Engine-rendered camera implementation. · `unreal/Blocks/Plugins/ProjectAirSim/Source/ProjectAirSim/Private/Sensors/UnrealCamera.cpp`
- [Unity host and wrapper](https://github.com/sairisan123/projectairsim/blob/main/unity/BlocksUnity/Assets/ProjectAirSimAssets/Scripts/UnitySimLoader.cs): Unity integration · C# host integrates through a native simulation wrapper. · `unity/BlocksUnity/Assets/ProjectAirSimAssets/Scripts/UnitySimLoader.cs`
- [Tiled GIS renderer](https://github.com/sairisan123/projectairsim/blob/main/rendering/scene/src/tile_manager.cpp): scene rendering · Loads glTF and Bing-map tile content. · `rendering/scene/src/tile_manager.cpp`
- [Standalone simulator sample](https://github.com/sairisan123/projectairsim/blob/main/samples/standalone_sim/main.cpp): native host · `samples/standalone_sim/main.cpp`

### Control and physics

- [Selectable physics](https://github.com/sairisan123/projectairsim/blob/main/physics/src/physics_world.cpp): physics runtime · Supports fast native, Unreal-backed, and MATLAB physics implementations. · `physics/src/physics_world.cpp`
- [Vehicle APIs](https://github.com/sairisan123/projectairsim/blob/main/vehicle_apis/multirotor_api/src/mavlink_api.cpp): controller adapter · Multirotor, VTOL, and rover control interfaces including MAVLink adapters. · `vehicle_apis/multirotor_api/src/mavlink_api.cpp`
- [MAVLink bridge](https://github.com/sairisan123/projectairsim/blob/main/mavlinkcom/src/MavLinkConnection.cpp): autopilot integration · Connects PX4 and ArduPilot over TCP, UDP, or serial. · `mavlinkcom/src/MavLinkConnection.cpp`

### APIs and integrations

- [Python client APIs](https://github.com/sairisan123/projectairsim/blob/main/client/python/projectairsim/src/projectairsim/client.py): automation client · Client, drone, rover, world, mission, and environment APIs. · `client/python/projectairsim/src/projectairsim/client.py`
- [C++ client DLL](https://github.com/sairisan123/projectairsim/blob/main/client/cpp/AirSimClientDLL/src/Client.cpp): native client · `client/cpp/AirSimClientDLL/src/Client.cpp`
- [ROS 2 node](https://github.com/sairisan123/projectairsim/blob/main/ros/node/projectairsim-ros2/src/projectairsim_ros2/ros2_node.py): robotics bridge · Translates ROS commands and simulation data. · `ros/node/projectairsim-ros2/src/projectairsim_ros2/ros2_node.py`

### Data and autonomy

- [Data collection](https://github.com/sairisan123/projectairsim/blob/main/client/python/projectairsim/src/projectairsim/datacollection/data_generator.py): synthetic data workload · Generates and augments simulation datasets. · `client/python/projectairsim/src/projectairsim/datacollection/data_generator.py`
- [ONNX autonomy serving](https://github.com/sairisan123/projectairsim/blob/main/client/python/projectairsim/src/projectairsim/autonomy/serving/serve_onnx.py): perception workload · Runs ONNX-based perception and serving. · `client/python/projectairsim/src/projectairsim/autonomy/serving/serve_onnx.py`

## Connections

- Native build entry points → Core simulator: builds
- Standalone simulator sample → Core simulator: hosts
- Unreal host plugin → Core simulator: integrates
- Unity host and wrapper → Core simulator: wraps
- Core simulator → Scene and actors: advances
- Scene and actors → Robot composition: instantiates
- Robot composition → Control mapper: contains
- Robot composition → Simulated sensors: contains
- Control mapper → Selectable physics: applies outputs to
- Selectable physics → Core simulator: returns state
- Simulated sensors → Services and topics: publishes messages
- Services and topics → Vehicle APIs: receives control
- Vehicle APIs → Control mapper: produces commands
- MAVLink bridge → Vehicle APIs: external autopilot
- Unreal host plugin → Unreal camera sensor: implements
- Unreal host plugin → Tiled GIS renderer: renders scene tiles
- Python client APIs → Services and topics: service/topic client
- C++ client DLL → Services and topics: service/topic client
- ROS 2 node → Services and topics: translates ROS
- Data collection → Python client APIs: automates
- ONNX autonomy serving → Python client APIs: drives simulation
