Skip to main content

Open source deep learning framework that focuses on aerospace objects (rockets, planes, UAVs)

Project description

๐Ÿš€ TensorAeroSpace

en ru Documentation Status Hugging Face Ask DeepWiki Python License GitHub stars Coverage Status

TensorAeroSpace Logo

Advanced Aerospace Control Systems & Reinforcement Learning Framework

A comprehensive Python library for aerospace simulation, control algorithms, and reinforcement learning implementations

๐Ÿ“– Documentation โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ’ก Examples โ€ข ๐Ÿค Contributing


๐ŸŒŸ Overview

TensorAeroSpace is a cutting-edge Python framework that combines aerospace engineering with modern machine learning. It provides:

  • ๐ŸŽฏ Control Systems: Advanced control algorithms including PID, MPC, and modern RL approaches
  • โœˆ๏ธ Aerospace Models: High-fidelity aircraft and spacecraft simulation models
  • ๐ŸŽฎ OpenAI Gym Integration: Ready-to-use environments for reinforcement learning
  • ๐Ÿง  RL Algorithms: State-of-the-art reinforcement learning implementations
  • ๐Ÿ”ง Extensible Architecture: Easy to extend and customize for your specific needs

๐Ÿงญ Applied Use Cases

  1. Autonomous Flight Vehicle Control โ€” stabilization, trajectory tracking, attitude control for aircraft, UAVs, and experimental vehicles.
  2. Rocket & Spacecraft Systems Control โ€” modeling and control of launch vehicles, satellites in various orbital classes, trajectory optimization.
  3. Hybrid Control Systems โ€” design and tuning of controllers combining classical and intelligent control methods.
  4. Algorithm Optimization & Benchmarking โ€” automated hyperparameter tuning, comparative analysis of control algorithms, quality metrics visualization.
  5. Simulation Platform Integration โ€” interfacing with game engines, CAD/CAE systems, model import/export between environments.
  6. Reliability Analysis & Diagnostics โ€” failure mode investigation, control system robustness assessment, training data preparation.

๐Ÿš€ Quick Start

โœ… Minimum Technical Requirements

Component Minimum Recommended
OS Linux x86_64, Windows 10, macOS 13 Ubuntu 22.04 LTS / Windows 11
CPU 4 cores, AVX 8+ cores, AVX2/FMA
RAM 8 GB 16โ€“32 GB for RL/Simulink
GPU Optional NVIDIA RTX with โ‰ฅ8 GB VRAM for SAC/DSAC/PPO, CUDA 12.2 support
Python 3.10โ€“3.13 3.11/3.12
Additional Git, Poetry or pip, Docker (optional) MATLAB/Simulink R2022b+ (for simulink-example), Unity 2021.3.5f1/2023.2.20f1

๐Ÿ“ฆ Installation

Using Poetry (Recommended)

git clone https://github.com/tensoraerospace/tensoraerospace.git
cd tensoraerospace
poetry install

Using pip

pip install tensoraerospace

๐Ÿณ Docker

The image starts JupyterLab by default (see Dockerfile CMD). The runtime image is built from the repository sources, installs TensorAeroSpace as a wheel, and includes examples in /workspace/examples.

Ubuntu / Linux (bash):

docker pull ghcr.io/tensoraerospace/tensoraerospace:latest
docker run --rm -it -p 8888:8888 \
  -v "$(pwd)/projects:/workspace/projects" \
  ghcr.io/tensoraerospace/tensoraerospace:latest

# Or build the same image locally from source
docker build -t tensoraerospace:local . --platform=linux/amd64
docker run --rm -it -p 8888:8888 \
  -v "$(pwd)/projects:/workspace/projects" \
  tensoraerospace:local

# Optional: enable NVIDIA GPU inside the container
docker run --rm -it --gpus all -p 8888:8888 \
  -v "$(pwd)/projects:/workspace/projects" \
  ghcr.io/tensoraerospace/tensoraerospace:latest

Windows (PowerShell):

docker pull ghcr.io/tensoraerospace/tensoraerospace:latest
docker run --rm -it -p 8888:8888 `
  -v "${PWD}\projects:/workspace/projects" `
  ghcr.io/tensoraerospace/tensoraerospace:latest

# Or build the same image locally from source
docker build -t tensoraerospace:local . --platform=linux/amd64
docker run --rm -it -p 8888:8888 `
  -v "${PWD}\projects:/workspace/projects" `
  tensoraerospace:local

# Optional: enable NVIDIA GPU inside the container
docker run --rm -it --gpus all -p 8888:8888 `
  -v "${PWD}\projects:/workspace/projects" `
  ghcr.io/tensoraerospace/tensoraerospace:latest

Open the printed URL (default http://127.0.0.1:8888) and navigate to examples/quickstart.ipynb to run the SAC walkthrough inside Docker.

๐Ÿƒโ€โ™‚๏ธ Quick Examples

๐Ÿ’ก Interactive walkthrough: open the Quickstart notebook to run the SAC B747 benchmark flow end-to-end inside Jupyter/VSย Code.

๐Ÿš€ Pretrained SAC Agent (Boeing 747)

Run a pretrained Soft Actor-Critic agent on Boeing 747 pitch control:

SAC B747

Command line:

python example/reinforcement_learning/sac-b747-render.py \
    --render \
    --dt 0.1 \
    --tn 200 \
    --repo TensorAeroSpace/sac-b747 \
    --device cuda  # Optional: 'cuda', 'mps', or 'cpu' (auto-detects if not specified)

๐Ÿ“– See full tutorial: SAC B747 Documentation


๐ŸŽ›๏ธ PID Controller (F-16)

import gymnasium as gym
import numpy as np

from tensoraerospace.agent.pid import PID
from tensoraerospace.utils import generate_time_period
from tensoraerospace.signals.standard import unit_step

# Simulation setup
dt = 0.01
tp = generate_time_period(tn=10, dt=dt)  # 10 seconds
N = len(tp)

# Reference signal for alpha tracking (5 deg step in radians)
reference = unit_step(
    degree=5, tp=tp, time_step=100, output_rad=True
).reshape(1, -1)

# Create F-16 longitudinal environment
env = gym.make(
    'LinearLongitudinalF16-v0',
    number_time_steps=N,
    initial_state=[[0], [0]],
    reference_signal=reference,
    use_reward=False,
)

# PID controller with tuned coefficients
pid = PID(
    env,
    kp=-14.290139135229715,
    ki=-8.240470780203491,
    kd=-1.2991634935096958,
    dt=dt
)

obs, info = env.reset()
for t in range(N - 1):
    setpoint = reference[0, t]
    alpha = float(obs[0])
    u = pid.select_action(setpoint, alpha)
    action = np.array([[float(u)]], dtype=np.float32)
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        break

๐Ÿค– Supported Algorithms

Algorithm Type Save/Load HuggingFace Hub Status
SAC Soft Actor-Critic โœ… โœ… from_pretrained / publish_to_hub โœ…
PPO Proximal Policy Optimization โœ… โœ… from_pretrained / publish_to_hub โœ…
DDPG Deep Deterministic Policy Gradient โœ… โœ… from_pretrained / publish_to_hub โœ…
DSAC Distributional Soft Actor-Critic โœ… โœ… from_pretrained / publish_to_hub โœ…
DQN Deep Q-Learning โœ… โœ… from_pretrained / publish_to_hub โœ…
A2C Advantage Actor-Critic โœ… โœ… from_pretrained / publish_to_hub โœ…
A2C-NARX A2C with NARX Critic โœ… โœ… from_pretrained / publish_to_hub โœ…
A3C Asynchronous Advantage Actor-Critic โœ… โœ… from_pretrained / publish_to_hub โœ…
GAIL Imitation Learning (Adversarial) โœ… โœ… from_pretrained / publish_to_hub โœ…
MPC Model Predictive Control โœ… โœ… from_pretrained / publish_to_hub โœ…
ADP Adaptive Dynamic Programming โœ… โœ… from_pretrained / publish_to_hub โœ…
ADHDP Action-Dependent HDP โœ… โœ… from_pretrained / publish_to_hub โœ…
HDP Heuristic Dynamic Programming โœ… โœ… from_pretrained / publish_to_hub โœ…
PID Proportional-Integral-Derivative โœ… โœ… from_pretrained / publish_to_hub โœ…
IHDP Incremental Heuristic Dynamic Programming โœ… โŒ โœ…
NARX Nonlinear Autoregressive Network โœ… โœ… from_pretrained / publish_to_hub โœ…

โœˆ๏ธ Aircraft & Spacecraft Models

๐Ÿ›ฉ๏ธ Fixed-Wing Aircraft
  • General Dynamics F-16 Fighting Falcon - High-fidelity fighter jet model
  • Boeing 747 - Commercial airliner dynamics
  • McDonnell Douglas F-4C Phantom II - Military aircraft model
  • North American X-15 - Hypersonic research aircraft
๐Ÿš UAVs & Drones
  • LAPAN Surveillance Aircraft (LSU)-05 - Indonesian surveillance UAV
  • Ultrastick-25e - RC aircraft model
  • Generic UAV State Space - Configurable UAV dynamics
๐Ÿš€ Rockets & Satellites
  • ELV (Expendable Launch Vehicle) - Launch vehicle dynamics
  • Generic Rocket Model - Customizable rocket simulation
  • Geostationary Satellite - Orbital mechanics simulation
  • Communication Satellite - ComSat dynamics and control

๐ŸŽฎ Simulation Environments

๐ŸŽฏ Unity ML-Agents Integration

Unity Demo

TensorAeroSpace seamlessly integrates with Unity ML-Agents for immersive 3D simulations:

  • ๐ŸŽฎ 3D Visualization: Real-time 3D aircraft simulation
  • ๐Ÿ”„ Real-time Training: Train agents in realistic environments
  • ๐Ÿ“Š Rich Sensors: Camera, LiDAR, and physics-based sensors
  • ๐ŸŒ Custom Environments: Build your own aerospace scenarios

๐Ÿ“ Example Environment: UnityAirplaneEnvironment

๐Ÿ”ง MATLAB Simulink Support

Simulink Model

  • ๐Ÿ“ Model Import: Convert Simulink models to Python
  • โšก High Performance: Compiled C++ integration
  • ๐Ÿ”„ Bidirectional: MATLAB โ†” Python workflow
  • ๐Ÿ“Š Validation: Cross-platform model validation

๐Ÿ“Š State Space Matrices

Mathematical foundation for control system design:

  • ๐Ÿงฎ Linear Models: State-space representation
  • ๐ŸŽ›๏ธ Control Design: Modern control theory implementation
  • ๐Ÿ“ˆ Analysis Tools: Stability, controllability, observability
  • ๐Ÿ”„ Linearization: Nonlinear model linearization

๐Ÿ“š Examples & Tutorials

Explore our comprehensive example collection in the ./example directory:

Category Description Notebooks
๐Ÿš€ Quick Start Basic usage and concepts quickstart.ipynb
๐Ÿค– Reinforcement Learning RL algorithm implementations reinforcement_learning/
๐ŸŽ›๏ธ Control Systems PID, MPC controllers pid_controllers/, mpc_controllers/
โœˆ๏ธ Aircraft Models Environment examples environments/
๐Ÿ”ง Optimization Hyperparameter tuning optimization/

๐Ÿ› ๏ธ Development & Contributing

We welcome contributions! Please see our Contributing Guide for details.

๐Ÿ—๏ธ Development Setup

git clone https://github.com/tensoraerospace/tensoraerospace.git
cd tensoraerospace
poetry install --with dev
poetry run pytest  # Run tests

๐Ÿงช Testing

# Run all tests
poetry run pytest

# Run specific test category
poetry run pytest tests/envs/
poetry run pytest tests/agents/

๐Ÿ“– Documentation

  • ๐Ÿ“š Full Documentation: tensoraerospace.readthedocs.io
  • ๐Ÿš€ API Reference: Detailed API documentation
  • ๐Ÿ“ Tutorials: Step-by-step guides
  • ๐Ÿ’ก Examples: Practical use cases

๐Ÿค Community & Support

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • OpenAI Gym team for the excellent RL framework
  • Unity ML-Agents team for 3D simulation capabilities
  • The aerospace engineering community for domain expertise
  • All contributors who make this project possible

โญ Star us on GitHub if you find TensorAeroSpace useful! โญ

Made with โค๏ธ by the TensorAeroSpace team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tensoraerospace-0.3.14.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tensoraerospace-0.3.14-py3-none-any.whl (3.4 MB view details)

Uploaded Python 3

File details

Details for the file tensoraerospace-0.3.14.tar.gz.

File metadata

  • Download URL: tensoraerospace-0.3.14.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for tensoraerospace-0.3.14.tar.gz
Algorithm Hash digest
SHA256 c42c50f7ec34a805013919b8a04d513e5034001a8574c7428781b73a9206dbaa
MD5 ef83888e588339effc070d8eb5b96fea
BLAKE2b-256 8ca238ebe9fd1afe152c839154582ab6e8cd21e5f217b35ea05b04f113d6219e

See more details on using hashes here.

File details

Details for the file tensoraerospace-0.3.14-py3-none-any.whl.

File metadata

File hashes

Hashes for tensoraerospace-0.3.14-py3-none-any.whl
Algorithm Hash digest
SHA256 7eabe478dc63844509664bdf5dce984278e635c74fd790db7f8307334cb6b90a
MD5 af6c9145dca1662489992a48c1be3a44
BLAKE2b-256 925f29a3bdce9211e0ad77e18bd51ef13b29edd96a6e2ef32c9f8fdd38f404ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page