Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 62 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The AeroSim project consists of several 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
- **CLI Management**: Command-line interface for installation and management

## Installation

Expand All @@ -44,19 +45,28 @@ The AeroSim project consists of several components:
- [Rye](https://rye-up.com/) or [uv](https://github.com/astral-sh/uv) for Python package management
- [Bun](https://bun.sh/) for aerosim-app (not npm)

### Installation Steps
### Installation Methods

For detailed installation instructions, please refer to the build documentation for [Linux](docs/build_linux.md) and [Windows](docs/build_windows.md). Below is a quick start guide.
#### Using pip or uv
```bash
# Using pip
pip install aerosim

# Using uv
uv add aerosim
```

1. Clone the repository:

#### Manual Installation
For detailed manual installation instructions, please refer to the build documentation for [Linux](docs/build_linux.md) and [Windows](docs/build_windows.md). Below is a quick start guide.

1. Clone the repository:
```bash
git clone https://github.com/aerosim-open/aerosim.git
cd aerosim
```

1. Run the pre-install and install scripts for your platform:

2. Run the pre-install and install scripts for your platform:
```bash
# Windows
pre_install.bat
Expand All @@ -67,53 +77,76 @@ For detailed installation instructions, please refer to the build documentation
./install_aerosim.sh
```

1. Build AeroSim
3. Build AeroSim:
```bash
# Windows
build_aerosim.bat

# Linux
./build_aerosim.sh
```

Alternatively, you can run the following commands for more control over the steps and build options:
```bash
# Windows
rye sync
.venv\Scripts\activate
rye run build

# Linux
rye sync
source .venv/bin/activate
rye run build
```

#### Using CLI
The AeroSim CLI provides a comprehensive set of commands for installation and management:

```bash
# Set AEROSIM_ROOT environment variable (optional)
export AEROSIM_ROOT=/path/to/aerosim

```
# Windows
build_aerosim.bat
# Install prerequisites
aerosim prereqs install [--path /path/to/aerosim] [--platform windows|linux]

# Linux
./build_aerosim.sh
```
# Install all components
aerosim install all [--path /path/to/aerosim] [--platform windows|linux]

Alternatively, you can run the following commands for more control over the steps and build options:
# Build components
aerosim build all [--path /path/to/aerosim] [--platform windows|linux]
aerosim build wheels [--path /path/to/aerosim] [--platform windows|linux]

```
# Windows
rye sync
.venv\Scripts\activate
rye run build
# Launch simulation
aerosim launch unreal [--path /path/to/aerosim] [--editor] [--nogui] [--pixel-streaming] [--pixel-streaming-ip 127.0.0.1] [--pixel-streaming-port 8888] [--config Debug|Development|Shipping] [--renderer-ids "0,1,2"]
aerosim launch omniverse [--path /path/to/aerosim] [--pixel-streaming]
```

# Linux
rye sync
source .venv/bin/activate
rye run build
```
Note: The `--path` option is optional if the `AEROSIM_ROOT` environment variable is set.

## Usage

### Running a Simulation

1. Launch AeroSim with Unreal renderer and pixel streaming:

```bash
# Using CLI
aerosim launch unreal --pixel-streaming

# Or using scripts directly
# Windows
launch_aerosim.bat --unreal --pixel-streaming

# Linux
./launch_aerosim.sh --unreal --pixel-streaming
```

1. Start the aerosim-app for visualization:

2. Start the aerosim-app for visualization:
```bash
cd ../aerosim-app
bun run dev
```

1. Run one of the example scripts:

3. Run one of the example scripts:
```bash
# First flight example program
python examples/first_flight.py
Expand Down Expand Up @@ -147,6 +180,7 @@ The `aerosim` package has a modular structure:
- `aerosim.visualization`: Visualization utilities
- `aerosim.utils`: Common utility functions


## Examples

The package includes several example scripts:
Expand All @@ -171,7 +205,6 @@ This will build all Rust crates and create Python wheels for installation.
The package depends on:

- Rust components:

- `aerosim-controllers`: Flight control systems
- `aerosim-core`: Core utilities
- `aerosim-data`: Data types and middleware
Expand Down
43 changes: 41 additions & 2 deletions aerosim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ AeroSim is a comprehensive flight simulation framework that combines Rust and Py
- **Input Handling**: Process input from keyboard, gamepad, and remote sources
- **Visualization**: Stream camera images and flight display data
- **Cross-Platform**: Works on both Windows and Linux
- **CLI Management**: Command-line interface for installation and management

## Installation

### Using pip or uv
```bash
# Using pip
pip install aerosim
Expand All @@ -20,6 +22,37 @@ pip install aerosim
uv add aerosim
```

### Using CLI (Recommended)
The AeroSim CLI provides a comprehensive set of commands for installation and management:

Using the AEROSIM_ROOT environment variable you can run all scripts default
```bash
export AEROSIM_ROOT=/path/to/aerosim
```

Example:
```bash
aerosim prereqs install
```
Using custom path:
```bash
# Install prerequisites
aerosim prereqs install [--path /path/to/aerosim] [--platform windows|linux]

# Install all components
aerosim install all [--path /path/to/aerosim] [--platform windows|linux]

# Build components
aerosim build all [--path /path/to/aerosim] [--platform windows|linux]
aerosim build wheels [--path /path/to/aerosim] [--platform windows|linux]

# Launch simulation
aerosim launch unreal [--path /path/to/aerosim] [--editor] [--nogui] [--pixel-streaming] [--pixel-streaming-ip 127.0.0.1] [--pixel-streaming-port 8888] [--config Debug|Development|Shipping] [--renderer-ids "0,1,2"]
aerosim launch omniverse [--path /path/to/aerosim] [--pixel-streaming]
```

Note: The `--path` option is optional if the `AEROSIM_ROOT` environment variable is set.

## Quick Start

```python
Expand All @@ -38,6 +71,10 @@ asyncio.run(start_websocket_servers())

1. Install and launch AeroSim:
```bash
# Using CLI
aerosim launch unreal --pixel-streaming

# Or using scripts directly
# Windows
launch_aerosim.bat --unreal --pixel-streaming

Expand All @@ -63,7 +100,9 @@ asyncio.run(start_websocket_servers())
- `aerosim.io.websockets`: WebSockets integration
- `aerosim.io.input`: Input handling
- `aerosim.visualization`: Visualization utilities
- `aerosim.utils`: Common utility functions
- `aerosim.utils`: Common utility functions along with data processing and artificial track generation
- Refer to [Utils Readme](aerosim/src/aerosim/utils/README_utils.md)


## Examples

Expand All @@ -84,4 +123,4 @@ The package depends on:
- `websockets`: WebSockets communication
- `pygame`: Input handling
- `opencv-python`: Image processing
- `numpy`: Numerical operations
- `numpy`: Numerical operations
20 changes: 19 additions & 1 deletion aerosim/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,28 @@ description = "Main python package for AeroSim"
authors = [
{ name = "Praveen Palanisamy", email = "[email protected]" },
]
dependencies = []
dependencies = [
"pandas>=2.2.3",
"geopy>=2.4.1",
"folium>=0.19.5",
"matplotlib>=3.10.1",
"numpy>=2.2.3",
"click>=8.1.0",
"simplekml>=1.3.1",
"requests>=2.31.0",
"python-dateutil>=2.8.2",
"tqdm>=4.66.1",
"pyyaml>=6.0.1",
"geopandas>=0.14.1",
"contextily>=1.4.0",
"shapely>=2.0.2",
]
readme = "README.md"
requires-python = ">= 3.12"

[project.scripts]
aerosim = "aerosim.cli:cli"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Expand Down
80 changes: 78 additions & 2 deletions aerosim/src/aerosim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,38 @@
from .io.websockets import start_websocket_servers
from .io.input import InputHandler, KeyboardHandler, GamepadHandler
from .visualization import CameraManager, FlightDisplayManager
from .utils import clamp, normalize_heading_deg, distance_m_bearing_deg
from .utils import (
# Helper functions
clamp, normalize_heading_deg, distance_m_bearing_deg,

# Track generation
ArtificialTrackGenerator,

# Conversion functions
convert_json_to_csv, filter_tracks, convert_tracks_to_json, process_csv,

# Scenario generation
generate_scenario_json,

# Reporting
generate_markdown_report, save_markdown_report, plot_trajectories,

# Map track processing
extract_track_id, parse_kml, generate_csv_from_tracks,

# Coordinate conversion
geodetic_to_ecef, ecef_to_geodetic, lla_to_ned, ned_to_lla,
haversine_distance, euclidean_distance_lla, bearing_between_points,

# Visualization
visualize_folder, plot_tracks,

# Workflows
process_openadsb_workflow, process_artificial_workflow, process_kml_workflow,

# Configuration
Config
)

__all__ = [
"AeroSim",
Expand All @@ -18,7 +49,52 @@
"GamepadHandler",
"CameraManager",
"FlightDisplayManager",

# Helper functions
"clamp",
"normalize_heading_deg",
"distance_m_bearing_deg"
"distance_m_bearing_deg",

# Track generation
"ArtificialTrackGenerator",

# Conversion functions
"convert_json_to_csv",
"filter_tracks",
"convert_tracks_to_json",
"process_csv",

# Scenario generation
"generate_scenario_json",

# Reporting
"generate_markdown_report",
"save_markdown_report",
"plot_trajectories",

# Map track processing
"extract_track_id",
"parse_kml",
"generate_csv_from_tracks",

# Coordinate conversion
"geodetic_to_ecef",
"ecef_to_geodetic",
"lla_to_ned",
"ned_to_lla",
"haversine_distance",
"euclidean_distance_lla",
"bearing_between_points",

# Visualization
"visualize_folder",
"plot_tracks",

# Workflows
"process_openadsb_workflow",
"process_artificial_workflow",
"process_kml_workflow",

# Configuration
"Config"
]
Loading