Project AirSim is a comprehensive simulation platform that transforms Unreal Engine 5 into a robotics and autonomous systems development environment. It combines photo-realistic 3D rendering, advanced physics simulation, and network-based APIs to create a complete ecosystem for testing and developing autonomous vehicles.
┌─────────────────────────────────────────────────────────────────────────────────┐
│ PROJECT AIRSIM SYSTEM │
│ ┌─────────────────────────────────────────────────────────────────────────┐ │
│ │ UNREAL ENGINE 5 SIMULATION ENVIRONMENT │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ PROJECTAIRSIM PLUGIN (UE INTEGRATION) │ │ │
│ │ │ ┌─────────────────────────────────────────────────────────┐ │ │ │
│ │ │ │ SIM LIBS (C++ CORE SIMULATION) │ │ │ │
│ │ │ │ ┌─────────────┬─────────────┬─────────────┐ │ │ │ │
│ │ │ │ │ VEHICLE │ PHYSICS │ SENSORS │ │ │ │ │
│ │ │ │ │ APIS │ ENGINES │ SYSTEM │ │ │ │ │
│ │ │ │ └─────────────┴─────────────┴─────────────┘ │ │ │ │
│ │ │ └─────────────────────────────────────────────────────────┘ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────┬───────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ CLIENT APPLICATIONS │
│ ┌─────────────┬─────────────┬─────────────┬─────────────┐ │
│ │ PYTHON │ ROS │ MAVLINK │ CUSTOM │ │
│ │ API │ BRIDGE │ GCS │ CONTROLLERS │ │
│ └─────────────┴─────────────┴─────────────┴─────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘
Blocks Project (unreal/Blocks/)
- Primary UE5 project containing the simulation environment
- Configured for UE versions 5.2 and 5.7 with ProjectAirSim plugin enabled
- Contains simulation levels (BlocksMap.umap, GISMap.umap)
- Manages content assets and Blueprints
Key Configuration:
{
"EngineAssociation": "5.7",
"Plugins": ["ProjectAirSim"],
"TargetPlatforms": ["WindowsNoEditor", "LinuxNoEditor"]
}Location: unreal/Blocks/Plugins/ProjectAirSim/
Purpose: Native UE5 plugin that integrates C++ simulation libraries with Unreal's runtime.
Architecture:
Plugin Structure
├── ProjectAirSim.uplugin (Plugin manifest)
├── Source/ProjectAirSim/ (C++ source)
│ ├── Public/ (API headers)
│ └── Private/ (Implementation)
├── SimLibs/ (Compiled C++ DLLs)
├── Content/ (UE assets)
└── Binaries/ (Platform binaries)
Key Classes:
AProjectAirSimGameMode: Manages simulation lifecycleAUnrealSimLoader: Loads and manages Sim LibsAUnrealRobot: UE Actor representing robotsAUnrealSensor: Base class for sensors
Location: projectairsim/ (root CMake project)
Purpose: Cross-platform C++ libraries providing the simulation framework.
Component Architecture:
Sim Libs Modules
├── core_sim/ (Simulation loop, scene management)
├── vehicle_apis/ (Robot controllers: SimpleFlight, ArduPilot, PX4)
├── physics/ (Physics engines: FastPhysics, Matlab)
├── mavlinkcom/ (MAVLink protocol implementation)
├── rendering/ (Rendering components)
├── sensors/ (Sensor simulation)
└── simserver/ (Network server, API management)
UE5 Editor Start
↓
Load Blocks.uproject
↓
Initialize ProjectAirSim Plugin
↓
FProjectAirSimModule::StartupModule()
↓
Register AProjectAirSimGameMode
↓
Ready for Play Mode
Press "Play" in UE Editor
↓
AProjectAirSimGameMode::StartPlay()
↓
AUnrealSimLoader::LaunchSimulation()
↓
├── Configure UE Settings (CustomDepth, etc.)
├── Load SimServer (C++ DLL)
├── Load Scene Configuration (JSON)
├── Spawn UE Actors (Robots, Sensors)
├── Start Network Server (Ports 8989/8990)
└── Begin Physics Simulation Loop
Client Application Starts
↓
ProjectAirSimClient.connect()
↓
TCP Connection to Ports 8989/8990
↓
Authentication (optional)
↓
Subscribe to Topics
↓
Ready for Control Commands
Client Command → TCP Socket → SimServer → Vehicle API → Physics Engine → UE Actor Update → Visual Feedback
Detailed Path:
- Client Layer: Python/ROS/MAVLink client sends command
- Network Layer: pynng TCP transport (ports 8989/8990)
- Server Layer: SimServer receives and deserializes MessagePack
- API Layer: Vehicle API (MAVLink, ArduPilot, etc.) processes command
- Physics Layer: Physics engine applies forces/torques
- UE Integration: UE Actor position/orientation updated
- Rendering: UE renders new state
UE Sensor Tick → Data Collection → Serialization → TCP Socket → Client Processing → User Application
Detailed Path:
- UE Sensor: Unreal sensor actor samples environment
- Data Processing: Sensor data processed by Sim Libs
- Serialization: MessagePack serialization
- Network: TCP streaming via pynng
- Client: Python/ROS client receives data
- Application: User code processes sensor data
Application Layer
├── Python API (projectairsim.Client)
├── ROS Bridge (ros2_node.py)
└── MAVLink Protocol (mavlinkcom/)
Transport Layer
├── TCP/IP (Ports 8989/8990)
├── pynng Sockets (NNG library)
└── Message Serialization (MessagePack + JSON)
Simulation Layer
├── SimServer (C++ core)
├── Scene Management
└── API Routing
Topics (Publish/Subscribe - Port 8989):
- Sensor Streaming: Camera images, LiDAR, IMU, GPS
- State Updates: Robot position, velocity, orientation
- System Events: Scene changes, actor updates
Services (Request/Response - Port 8990):
- Control Commands: Movement, configuration changes
- Synchronous Queries: Current state, settings
- Administrative: Reset, pause, load scene
Runtime DLL Loading:
// In UnrealSimLoader.cpp
SimServer = std::make_shared<projectairsim::SimServer>();
// Bind UE callbacks to C++ simulation
SimServer->SetCallbackLoadExternalScene(
[this]() { LoadUnrealScene(); });Actor Synchronization:
// UE Actor position updated from physics
void AUnrealRobot::Tick(float DeltaTime) {
// Get position from Sim Libs physics
auto pose = VehicleAPI->getPose();
// Update UE Actor transform
SetActorLocation(pose.position);
SetActorRotation(pose.orientation);
}Multi-Physics Backend Support:
Physics Engine Options
├── PhysX (UE5 Default)
├── Bullet Physics
├── Custom Physics
└── Runtime Switching
Integration Pattern:
// Physics abstraction in Sim Libs
class PhysicsEngine {
virtual void update(float dt) = 0;
virtual void applyForce(Vector3 force) = 0;
};
// UE integration
void AUnrealSimLoader::UpdatePhysics() {
PhysicsEngine->update(DeltaTime);
SyncActorTransforms();
}Source Code Changes
↓
Build Sim Libs (CMake)
↓
build.sh simlibs_debug
↓
Build UE Plugin
↓
BlocksEditor Win64 DebugGame
↓
Launch UE Editor
↓
Test in Play Mode
Windows Development:
- Visual Studio 2019/2022 for Sim Libs
- UE5 Editor for plugin development
- VS Code multi-root workspace
Linux Development:
- CMake + Ninja for Sim Libs
- UE5 Editor for plugin development
- VS Code with WSL integration
VS Code Configuration (Blocks.code-workspace):
{
"folders": [
{"path": "unreal/Blocks"},
{"path": "core_sim"},
{"path": "vehicle_apis"},
{"path": "physics"},
{"path": "mavlinkcom"}
]
}Architecture:
Python Client Layers
├── ProjectAirSimClient (Network connection)
├── World (Scene management)
├── Drone/Rover (Vehicle control)
└── Sensor Interfaces (Data access)
Usage Pattern:
# Connect and control
client = ProjectAirSimClient()
client.connect()
world = World(client, "scene_config.jsonc")
drone = Drone(client, world, "Drone1")
# Control loop
while True:
# Send commands
await drone.move_by_velocity_async(vx, vy, vz)
# Receive sensor data
image = drone.get_camera_image("front_camera")
lidar = drone.get_lidar_data("lidar")ROS2 Bridge Architecture:
ROS2 Integration
├── ros2_node.py (ROS2 node implementation)
├── Message Translation (UE ↔ ROS formats)
├── TF Broadcasting (Coordinate transforms)
└── Service Bridges (ROS services ↔ UE)
Topic Mapping:
/airsim/drone/front_camera → sensor_msgs/Image
/airsim/drone/lidar → sensor_msgs/PointCloud2
/airsim/drone/imu → sensor_msgs/Imu
/airsim/drone/cmd_vel → geometry_msgs/Twist
MAVLink Stack:
MAVLink Integration
├── mavlinkcom/ (Protocol implementation)
├── Vehicle APIs (PX4, ArduPilot integration)
├── Ground Control Station support
└── Custom MAVLink dialects
UE5 Features Utilized:
- Lumen: Dynamic global illumination
- Nanite: Geometry LOD system
- Virtual Shadow Maps: Efficient shadowing
- Custom Depth: Segmentation rendering
GPU Acceleration:
- Compute Shaders: LiDAR point cloud generation
- Async Tasks: Image compression and formatting
- Render Targets: Off-screen rendering for cameras
Efficient Data Streaming:
- MessagePack: Compact binary serialization
- Topic Filtering: Selective data subscription
- Compression: Optional data compression
- Async Processing: Non-blocking network operations
Development Builds:
BlocksEditor Win64 DebugGame- Editor debuggingBlocksEditor Win64 Development- Full UE features
Production Builds:
Blocks Win64 Development- Packaged applicationBlocks Win64 Shipping- Optimized release
Build Sim Libs → Package Plugin → Cook Content → Package Game → Distribute
Supported Platforms:
- Windows 11: Full development and runtime
- Ubuntu 22.04: Full development and runtime
- Container Support: Docker integration
GIS Integration:
- Cesium Integration: Real-world terrain and imagery
- Geodetic Conversion: GPS ↔ UE coordinate systems
- Large World Support: World partitioning for vast areas
Multi-Agent Support:
- Concurrent Robots: Multiple vehicles in same scene
- Independent Control: Separate APIs per robot
- Inter-Agent Communication: Robot-to-robot messaging
Asset Integration:
- FBX Import: 3D model import with physics
- Material System: Physically-based rendering
- Blueprint Scripting: Visual logic for custom behaviors
Minimum:
- CPU: Quad-core 3.0 GHz
- RAM: 16 GB
- GPU: GTX 1060 or equivalent
- Storage: 50 GB SSD
Recommended:
- CPU: Octa-core 4.0 GHz
- RAM: 32 GB
- GPU: RTX 3070 or equivalent
- Storage: 100 GB NVMe SSD
Core Dependencies:
- Unreal Engine 5.2 and 5.7
- Visual Studio 2019/2022 (Windows)
- CMake 3.20+
- Python 3.7+
Optional Dependencies:
- ROS2 Humble/Foxy
- PX4/ArduPilot
- Cesium for Unreal
Build Problems:
- Sim Libs Build: Check CMake configuration
- UE Plugin: Verify plugin dependencies
- Network Issues: Check firewall and port availability
Runtime Issues:
- Connection Failures: Verify ports 8989/8990 available
- Physics Problems: Check UE physics settings
- Sensor Issues: Verify sensor configuration in JSON
UE5 Debugging:
- Visual Logger: Record and replay simulation
- Console Commands: Runtime configuration
- Stat Commands: Performance profiling
Network Debugging:
- Wireshark: Network traffic analysis
- Client Logs: Detailed connection logging
- Server Logs: Sim Libs debug output
From the Unreal Engine developer's viewpoint, Project AirSim is a sophisticated plugin ecosystem that transforms UE5 into a robotics simulation platform. The architecture seamlessly integrates C++ simulation libraries with Unreal's visual and physics systems, providing developers with familiar UE tools while enabling complex autonomous systems simulation.
┌─────────────────────────────────────────────────────────────┐
│ Unreal Engine 5.7 Editor │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Blocks Project │ │
│ │ ┌─────────────────────────────────────────────┐ │ │
│ │ │ ProjectAirSim Plugin │ │ │
│ │ │ ┌─────────────────────────────────────┐ │ │ │
│ │ │ │ Sim Libs Integration │ │ │ │
│ │ │ │ (C++ DLLs loaded at runtime) │ │ │ │
│ │ │ └─────────────────────────────────────┘ │ │ │
│ │ └─────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ External Client Applications │
│ (Python API, ROS, MAVLink GCS, Custom Controllers) │
└─────────────────────────────────────────────────────────────┘
Location: unreal/Blocks/
Purpose: The primary Unreal Engine project that serves as the simulation environment.
Key Files:
Blocks.uproject- Project manifest with plugin dependenciesBlocksMap.umap- Main simulation levelGISMap.umap- Geographic information system level
Project Configuration:
{
"EngineAssociation": "5.7",
"Plugins": ["ProjectAirSim"],
"TargetPlatforms": ["WindowsNoEditor", "LinuxNoEditor"]
}Location: unreal/Blocks/Plugins/ProjectAirSim/
Plugin Structure:
ProjectAirSim Plugin
├── ProjectAirSim.uplugin (Plugin manifest)
├── Source/ProjectAirSim/ (C++ source)
│ ├── Public/ (API headers)
│ └── Private/ (Implementation)
├── SimLibs/ (Compiled C++ DLLs)
├── Content/ (UE assets)
└── Binaries/ (Platform binaries)
Plugin Manifest:
{
"Modules": [
{
"Name": "ProjectAirSim",
"Type": "Runtime",
"LoadingPhase": "PostConfigInit"
}
],
"Plugins": [
{"Name": "ProceduralMeshComponent", "Enabled": true},
{"Name": "SunPosition", "Enabled": true},
{"Name": "PixelStreaming", "Enabled": true}
]
}Key Class: AProjectAirSimGameMode
Lifecycle Management:
class AProjectAirSimGameMode : public AGameModeBase {
void StartPlay() override {
Super::StartPlay();
UnrealSimLoader.LaunchSimulation(this->GetWorld());
}
void EndPlay() override {
UnrealSimLoader.TeardownSimulation();
}
};Responsibilities:
- Initializes simulation when Play is pressed in UE Editor
- Manages UnrealSimLoader lifecycle
- Sets deterministic seed for reproducible simulations
Class: AUnrealSimLoader
Purpose: Bridges between Unreal Engine and Project AirSim Sim Libs.
Key Methods:
void LaunchSimulation(UWorld* World) {
// 1. Configure Unreal Engine settings
SetUnrealEngineSettings();
// 2. Load simulator with network ports
SimServer->LoadSimulator(topicsPort, servicesPort, authKey);
// 3. Load scene configuration
SimServer->LoadScene();
// 4. Create Unreal scene actors
LoadUnrealScene();
// 5. Start network server
SimServer->StartSimulator();
// 6. Begin simulation
StartUnrealScene();
SimServer->StartScene();
}Architecture Flow:
UE Editor Play Button
↓
AProjectAirSimGameMode::StartPlay()
↓
AUnrealSimLoader::LaunchSimulation()
↓
├── Configure UE Settings (CustomDepth, etc.)
├── Load SimServer (C++ DLL)
├── Load Scene Config (JSON)
├── Spawn UE Actors (Robots, Sensors)
├── Start Network Server (Ports 8989/8990)
└── Begin Physics Simulation
Unreal Actor Hierarchy
├── AUnrealRobot (Base Robot Class)
│ ├── Skeletal Mesh Component
│ ├── Physics Components
│ └── Sensor Attachments
├── AUnrealRobotLink (Robot Links)
│ ├── Collision Shapes
│ ├── Visual Meshes
│ └── Joint Attachments
└── AUnrealRobotJoint (Robot Joints)
├── Constraint Components
├── Motor Controllers
└── State Publishers
Sensor Integration
├── AUnrealSensor (Base Sensor)
│ ├── Tick-based Updates
│ ├── Data Publishing
│ └── Configuration Management
├── Camera Sensors
│ ├── AUnrealCamera
│ ├── AUnrealViewportCamera
│ └── Render Request System
├── Distance Sensors
│ ├── AUnrealLidar (Raycasting + GPU Compute)
│ ├── AUnrealRadar
│ └── AUnrealDistanceSensor
└── Environmental Sensors
├── IMU Simulation
├── GPS/Geodetic Conversion
└── Barometer/Altimeter
Camera Pipeline
├── Unreal Camera Actor
│ ├── Scene Capture Component 2D
│ └── Render Target
├── Image Packing (Async Task)
│ ├── GPU → CPU Transfer
│ ├── Format Conversion
│ └── Compression
└── Network Publishing
├── MessagePack Serialization
└── TCP Streaming (Port 8989)
LiDAR Pipeline
├── GPULidar Actor
│ ├── Compute Shader (LidarPointCloudCS)
│ ├── Scene View Extension
│ └── Intensity Calculation
├── Point Cloud Generation
│ ├── Ray Marching
│ ├── Distance Calculation
│ └── Intensity Mapping
└── Data Publishing
├── Point Cloud Serialization
└── ROS/MAVLink Bridge
Build Targets:
BlocksEditor Win64 Development - For Editor development
Blocks Win64 Development - For packaged game builds
BlocksEditor Win64 DebugGame - For debugging with Sim Libs
Development Cycle:
1. Modify C++ Sim Libs (CMake)
2. Build Sim Libs (build.sh simlibs_debug)
3. Build UE Plugin (BlocksEditor Win64 DebugGame)
4. Launch UE Editor
5. Press Play → Simulation starts
6. Connect client (Python/ROS/MAVLink)
7. Debug and iterate
VS Code Integration:
Blocks.code-workspace- Multi-root workspace- Simultaneous editing of UE Plugin and Sim Libs
- Integrated debugging across C++ and Blueprint
Workspace Structure:
Blocks.code-workspace
├── unreal/Blocks/ (UE Plugin & Project)
├── core_sim/ (Simulation Core)
├── vehicle_apis/ (Robot Controllers)
├── physics/ (Physics Engines)
└── mavlinkcom/ (Communication)
Asset Organization:
Content/
├── BlocksMap.umap (Main simulation level)
├── GISMap.umap (Geographic level)
├── Robots/ (Robot Blueprints/Meshes)
├── Environments/ (Scene assets)
└── Sensors/ (Sensor configurations)
Level Design Considerations:
- Scale: 1 UE unit = 1 cm (for physics accuracy)
- Lighting: Must support CustomDepth for segmentation
- Navigation: Recast navmesh for ground robots
- Streaming: Level streaming for large environments
Build.cs Configuration:
public class ProjectAirSim : ModuleRules {
PublicIncludePaths.AddRange(new string[] {
"ProjectAirSim/Public"
});
PrivateIncludePaths.AddRange(new string[] {
EngineDirectory + "/Source/Runtime/Renderer/Private"
});
// Sim Libs integration
if (Target.Platform == UnrealTargetPlatform.Win64) {
PublicIncludePaths.Add(
PluginDirectory + "/SimLibs/core_sim/include"
);
// ... additional Sim Lib paths
}
}Dynamic Library Integration:
Plugin Load Process
├── UE Plugin loads (ProjectAirSim.uplugin)
├── Module initializes (FProjectAirSimModule)
├── Sim Libs DLLs loaded at runtime
├── SimServer instantiated
└── Callbacks bound for scene management
Callback System:
// Bind C++ simulation callbacks to UE functions
SimServer->SetCallbackLoadExternalScene(
[this]() { LoadUnrealScene(); });Server-Side Architecture:
Unreal Engine (Server)
├── SimServer (C++ Core)
│ ├── TCP Listener (Ports 8989/8990)
│ ├── Message Deserialization
│ └── Command Processing
├── Unreal Scene
│ ├── Actor Updates
│ ├── Physics Simulation
│ └── Sensor Data Collection
└── Data Publishing
├── Topic Broadcasting
└── Service Responses
Client Connection Flow:
Client Connects → SimServer Accepts → Authentication → Scene Sync → Ready for Commands
Control Commands (Client → UE)
├── Network Reception (pynng/TCP)
├── Message Deserialization (MessagePack)
├── Command Routing (SimServer)
├── Physics Updates (UE Physics)
└── Visual Feedback (UE Rendering)
Sensor Data (UE → Client)
├── Sensor Sampling (UE Tick)
├── Data Processing (C++ Sim Libs)
├── Serialization (MessagePack)
├── Network Transmission (pynng/TCP)
└── Client Reception
ROS Integration Layers
├── UE Plugin (ProjectAirSim)
│ ├── Sensor Data Publishers
│ ├── Control Command Subscribers
│ └── TF Transform Broadcasting
├── ROS2 Node Bridge (Python)
│ ├── rclpy Integration
│ ├── Topic/Message Translation
│ └── Service Proxies
└── ROS Ecosystem
├── RViz Visualization
├── ROS Control
└── Navigation Stack
Transform Broadcasting:
- UE coordinate system to ROS TF
- Real-time transform updates
- Geographic coordinate integration
Sensor Integration:
- UE cameras → ROS image topics
- UE LiDAR → ROS PointCloud2
- UE IMU → ROS Imu messages
UE-Specific Considerations:
- Tick Groups: Use appropriate tick groups for sensors
- Async Tasks: Offload heavy computations (image packing)
- Render Threads: Minimize main thread blocking
- Memory Management: Pool reusable assets
UE Editor Debugging:
- Visualize Sensors: Debug drawing for raycasts/LiDAR
- Physics Debugging: Show collision shapes and constraints
- Network Debugging: Log message traffic and timing
Multi-Target Debugging:
- Attach debugger to UE Editor + Python client simultaneously
- Cross-reference UE logs with client application logs
Asset Optimization:
- LOD System: Configure level-of-detail for performance
- Texture Streaming: Manage texture memory for large environments
- Instancing: Use instanced static meshes for repeated assets
Custom Rendering:
- Scene View Extensions: For specialized sensor rendering (LiDAR intensity)
- Compute Shaders: GPU-accelerated sensor processing
- Post-Processing: Custom materials for sensor simulation
UE Physics Extensions:
- Custom Physics Engines: Runtime switching between physics backends
- Constraint Systems: Advanced joint and linkage simulation
- Collision Detection: Custom collision shapes for sensors
Distributed Simulation:
- Pixel Streaming: Web-based visualization
- Multi-Client Support: Multiple clients connecting simultaneously
- State Synchronization: Consistent simulation state across clients
Project AirSim is a simulation platform for drones, robots, and other autonomous systems built on Unreal Engine 5. It consists of C++ simulation libraries, an Unreal Engine plugin, and Python client libraries for API interactions.
┌─────────────────────────────────────────────────────────────┐
│ User Applications │
│ (Python scripts, ROS nodes, MAVLink GCS, etc.) │
└─────────────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Project AirSim Client Library │
│ (Python API, ROS Bridge, MAVLink Protocol) │
└─────────────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Project AirSim Plugin │
│ (Unreal Engine Plugin - Runtime Integration) │
└─────────────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Project AirSim Sim Libs │
│ (C++ Core Simulation Framework) │
└─────────────────────────────────────────────────────────────┘
Location: projectairsim/ (root CMake project)
Purpose: Base infrastructure for defining a generic robot structure and simulation scene tick loop.
Key Components:
- Core Simulation (
core_sim/): Main simulation loop and scene management - Physics Integration (
physics/): Physics engines and dynamics - Vehicle APIs (
vehicle_apis/): Robot-specific control interfaces - MAVLink Communication (
mavlinkcom/): MAVLink protocol implementation - Rendering (
rendering/): Visual rendering components
Architecture:
Sim Libs
├── Core Simulation Framework
│ ├── Scene Management
│ ├── Robot Definitions
│ └── Simulation Tick Loop
├── Vehicle APIs
│ ├── Multirotor API
│ │ ├── MAVLink API
│ │ ├── ArduCopter API
│ │ ├── SimpleFlight API
│ │ └── Manual Controller API
│ └── Rover API
├── Physics Engines
├── Sensors Framework
└── Communication Layer
Location: projectairsim/unreal/Blocks/Plugins/ProjectAirSim/
Purpose: Host package (currently an Unreal Plugin) that builds on the sim libs to connect external components (controller, physics, rendering) at runtime that are specific to each configured robot-type scenario (ex. quadrotor drones)
Location: projectairsim/client/python/projectairsim/
Purpose: End-user library to enable API calls to interact with the robot and simulation over a network connection
Communication Architecture:
Client Library
├── Connection Management
│ ├── TCP Socket (pynng)
│ ├── Topics (Port 8989) - Pub/Sub
│ └── Services (Port 8990) - Req/Rep
├── API Objects
│ ├── ProjectAirSimClient
│ ├── World
│ └── Drone/Rover
└── Protocol Bridges
├── ROS1/ROS2 Bridge
└── MAVLink Bridge
Drone Control Interfaces
├── Python API (High-level)
│ ├── Drone Class
│ │ ├── Movement Commands
│ │ │ ├── move_by_velocity_async()
│ │ │ ├── move_to_position_async()
│ │ │ └── rotate_by_yaw_rate_async()
│ │ ├── Sensor Access
│ │ │ ├── get_camera_images()
│ │ │ ├── get_lidar_data()
│ │ │ └── get_imu_data()
│ │ └── State Queries
│ │ ├── get_position()
│ │ ├── get_velocity()
│ │ └── get_orientation()
│ └── World Class
│ ├── Scene Management
│ ├── Weather Control
│ └── Time Management
├── MAVLink Protocol (Low-level)
│ ├── MAVLink API Implementation
│ ├── PX4/ArduPilot Integration
│ └── Ground Control Station Support
└── ROS Integration
├── ROS2 Node Bridge
├── Topic Publishing
└── Service Calls
Control Flow:
User Code → Python API → TCP (pynng) → Unreal Plugin → Sim Libs → Physics Engine
Data Flow:
Sensors → Sim Libs → Unreal Plugin → TCP (pynng) → Python API → User Code
MAVLink Flow:
GCS/ROS → MAVLink Protocol → MAVLink API → Vehicle Controller → Physics
Project AirSim uses a sophisticated multi-channel communication system:
1. TCP-based Transport
- Library: pynng (NNG - nanomsg next generation)
- Ports:
- Topics: 8989 (Publish/Subscribe pattern)
- Services: 8990 (Request/Response pattern)
2. Message Serialization
- Primary: MessagePack with JSON hybrid (MSGPACK_JSON)
- Fallback: Pure JSON
- Security: Optional client authorization with public key tokens
3. Communication Patterns
Topics (Pub/Sub - Port 8989):
├── Sensor Data Streaming
│ ├── Camera Images
│ ├── LiDAR Point Clouds
│ ├── IMU Data
│ ├── GPS Coordinates
│ └── Vehicle State
└── System Events
├── Scene Changes
└── Actor Updates
Services (Req/Rep - Port 8990):
├── Control Commands
│ ├── Movement Instructions
│ ├── Configuration Changes
│ └── Administrative Actions
└── Synchronous Queries
├── State Information
└── Configuration Data
Application Layer
├── Python Client API
├── ROS Bridge
└── MAVLink Interface
Transport Layer
├── TCP/IP
├── pynng Sockets
└── Message Serialization
Simulation Layer
├── Unreal Engine Plugin
├── Physics Integration
└── Sensor Simulation
Project AirSim provides comprehensive ROS2 support through a dedicated bridge package.
ROS2 Integration
├── ROS2 Node Package
│ ├── projectairsim-ros2/
│ │ ├── setup.py
│ │ ├── ros2_node.py
│ │ └── ros1_compatibility.py
│ └── Dependencies
│ └── rclpy
├── Bridge Components
│ ├── Publisher Wrappers
│ ├── Subscriber Wrappers
│ └── Service Proxies
└── Message Translation
├── Sensor Data → ROS Messages
├── Control Commands ← ROS Messages
└── TF Transformations
The ROS2 bridge (ros2_node.py) provides:
1. Publisher Implementation
class Publisher:
- Wraps rclpy.publisher.Publisher
- Handles topic naming
- Manages message publishing2. Subscriber Implementation
class Subscriber:
- Wraps rclpy.subscription.Subscription
- Manages topic subscriptions
- Handles message callbacks3. Sensor Helper
class SensorHelper:
- Camera info configuration
- Message format adaptation
- ROS2-specific sensor data handlingROS2 Node ←→ Project AirSim Bridge ←→ Simulation Server
Topics:
├── /airsim/drone/camera ← Camera images
├── /airsim/drone/imu ← IMU data
├── /airsim/drone/lidar ← LiDAR scans
├── /airsim/drone/odom ← Odometry
└── /airsim/drone/cmd_vel → Velocity commands
Services:
├── /airsim/takeoff → Takeoff service
├── /airsim/land → Landing service
└── /airsim/reset → Reset simulation
To create visual graphs of this architecture, I recommend using one of these tools:
- Create flowcharts and system diagrams
- Export as PNG/SVG/PDF
- Real-time collaboration
- Define diagrams in text
- Generate from code comments
- Integrates with documentation
- Professional diagramming tools
- Template libraries
- Advanced styling options
1. System Context Diagram
- Show Project AirSim in relation to external systems (ROS, MAVLink GCS, etc.)
2. Component Diagram
- Detail the three main layers and their interactions
3. Sequence Diagrams
- Show communication flows for specific operations (takeoff, sensor reading, etc.)
4. Deployment Diagram
- Show how components are distributed across systems
This architecture enables Project AirSim to serve as a versatile platform for autonomous systems development, supporting everything from simple Python scripting to complex ROS-based robotic applications.