AeroSim is a comprehensive flight simulation framework that combines Rust and Python components to provide a powerful and flexible simulation environment.
The AeroSim project consists of several components:
- aerosim: The main Python package
- aerosim-app: A React/TypeScript UI for visualization and control
- aerosim-unreal-project: Unreal Engine renderer for visualization
- aerosim-omniverse-kit-app: Omniverse renderer for visualization
- Flight Simulation: Simulate various aircraft with realistic physics
- FMU Integration: Use Functional Mock-up Units for component modeling
- Multiple Renderers: Support for Unreal Engine and Omniverse renderers
- WebSockets Communication: Real-time communication between components
- Input Handling: Support for keyboard, gamepad, and remote inputs
- Visualization: Camera streaming and flight display data
- Cross-Platform: Works on both Windows and Linux
- Python 3.12 or higher
- Rust toolchain (for building Rust components)
- Rye or uv for Python package management
- Bun for aerosim-app (not npm)
For detailed installation instructions, please refer to the build documentation for Linux and Windows. Below is a quick start guide.
-
Clone the repository:
git clone https://github.com/aerosim-open/aerosim.git cd aerosim
-
Run the pre-install and install scripts for your platform:
# Windows pre_install.bat install_aerosim.bat # Linux ./pre_install.sh ./install_aerosim.sh
-
Build AeroSim
# Windows
build_aerosim.bat
# Linux
./build_aerosim.sh
Alternatively, you can run the following commands for more control over the steps and build options:
# Windows
rye sync
.venv\Scripts\activate
rye run build
# Linux
rye sync
source .venv/bin/activate
rye run build
-
Launch AeroSim with Unreal renderer and pixel streaming:
# Windows launch_aerosim.bat --unreal --pixel-streaming # Linux ./launch_aerosim.sh --unreal --pixel-streaming
-
Start the aerosim-app for visualization:
cd ../aerosim-app bun run dev
-
Run one of the example scripts:
# First flight example program python examples/first_flight.py # Pilot control with flight deck python examples/pilot_control_with_flight_deck.py
import asyncio
from aerosim import AeroSim, start_websocket_servers
# Create and run a simulation
sim = AeroSim(enable_websockets=True)
sim.run("config/sim_config.json")
# Start WebSockets servers for aerosim-app communication
asyncio.run(start_websocket_servers())
The aerosim
package has a modular structure:
aerosim.core
: Core simulation classesaerosim.io
: Input/output handlingaerosim.io.websockets
: WebSockets integrationaerosim.io.input
: Input handling
aerosim.visualization
: Visualization utilitiesaerosim.utils
: Common utility functions
The package includes several example scripts:
first_flight.py
: First flight to get startedpilot_control_with_flight_deck.py
: Pilot control with flight deckautopilot_daa_scenario.py
: Autopilot with detect and avoid scenariosimulink_cosim_and_fmu.py
: Simulink co-simulation with FMU models
To build the package from source:
python build.py
This will build all Rust crates and create Python wheels for installation.
The package depends on:
-
Rust components:
aerosim-controllers
: Flight control systemsaerosim-core
: Core utilitiesaerosim-data
: Data types and middlewareaerosim-dynamics-models
: Aircraft dynamics modelsaerosim-scenarios
: Simulation scenariosaerosim-sensors
: Sensor modelsaerosim-world
: Simulation world and orchestrationaerosim-world-link
: Interface between Rust and Python
-
Python dependencies:
websockets
: WebSockets communicationopencv-python
: Image processingnumpy
: Numerical operations
This project is dual-licensed under both the MIT License and the Apache License, Version 2.0. You may use this software under the terms of either license, at your option.
See the LICENSE file for details.