Open source deep learning framework that focuses on aerospace objects (rockets, planes, UAVs)
Project description
๐ TensorAeroSpace
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
๐ Quick Start
๐ฆ Installation
Using Poetry (Recommended)
git clone https://github.com/tensoraerospace/tensoraerospace.git
cd tensoraerospace
poetry install
Using pip
pip install tensoraerospace
๐ณ Docker
docker build -t tensoraerospace . --platform=linux/amd64
# launch Jupyter Lab inside the container so you can open example/quickstart.ipynb
docker run -v $(pwd)/example:/app/example \
-p 8888:8888 -it tensoraerospace \
jupyter lab --notebook-dir=/app --ip=0.0.0.0 --no-browser --allow-root
Open the printed URL (default
http://127.0.0.1:8888) and navigate toexample/quickstart.ipynbto 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:
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.standart 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 | HuggingFace Export | Status |
|---|---|---|---|
| IHDP | Incremental Heuristic Dynamic Programming | โ | โ |
| DQN | Deep Q-Learning | โ | โ |
| DDPG | Deep Deterministic Policy Gradient | โ | โ |
| SAC | Soft Actor-Critic | โ | โ |
| A3C | Asynchronous Advantage Actor-Critic | โ | โ |
| PPO | Proximal Policy Optimization | โ | โ |
| GAIL | Imitation Learning (Adversarial) | โ | โ |
| MPC | Model Predictive Control | โ | โ |
| A2C | Advantage Actor-Critic | โ | โ |
| A2C-NARX | A2C with NARX Critic | โ | โ |
| PID | Proportional-Integral-Derivative | โ | โ |
โ๏ธ 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
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
- ๐ 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
- ๐ฌ Discussions: GitHub Discussions
- ๐ Issues: Bug Reports
- ๐ง Contact: Email 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tensoraerospace-0.3.9.tar.gz.
File metadata
- Download URL: tensoraerospace-0.3.9.tar.gz
- Upload date:
- Size: 22.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cef7554326303d8eb0ec1d58b0739a7476a3904b8d46d81e60796322ded9063
|
|
| MD5 |
860d5b8aa40d2517326d0f6639320d80
|
|
| BLAKE2b-256 |
c731b72af7c1866fc199aa98bace262c1c882eceb24cd6826ee46e87e953fb2c
|
File details
Details for the file tensoraerospace-0.3.9-py3-none-any.whl.
File metadata
- Download URL: tensoraerospace-0.3.9-py3-none-any.whl
- Upload date:
- Size: 22.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2d44548e8c9c45ad4d339636345c8be66f6ef8da3b7286f5b7a50d1e11be7eb
|
|
| MD5 |
730b2e1baa8334b3349b00820f99f70c
|
|
| BLAKE2b-256 |
d287a8ae422d5ae847d1735aaf8bc29b56b7220fe760028435cd45b16c75d162
|