A Guidance, Navigation, and Control toolkit for spacecraft.
Project description
OpenGNC
OpenGNC is a professional-grade, high-fidelity Guidance, Navigation, and Control (GNC) library for spacecraft simulation, orbital mechanics, and mission analysis. Built with SI units and aerospace standards, it provides a comprehensive suite of tools for satellite engineers and researchers.
Explore the Documentation | View Examples | Contributing
Key Highlights
- SI Unit Compliance: All calculations strictly use SI units (meters, kilograms, seconds, radians) unless otherwise explicitly suffixed.
- High-Fidelity Environment: Integrated models for NRLMSISE-00 density, IGRF-13 magnetic fields, and EGM2008 gravity harmonics.
- Validated Algorithms: Implementations of industry-standard filters (MEKF, UKF) and deterministic methods (QUEST, TRIAD).
- Optimization Ready: Built-in support for Optimal Control (LQR) and Model Predictive Control (MPC) using CasADi.
- Modular Architecture: Easily swap integrators, disturbance models, or sensors for customized simulations.
Extensive Features
Environment & Space Weather
- Atmospheric Models: NRLMSISE-00 (high-fidelity), Harris-Priester (diurnal bulge), and Exponential density.
- Geomagnetic Models: IGRF-13 (International Geomagnetic Reference Field) and Tilted Dipole models.
- Solar & Ephemeris: Analytical solar position, shadow models (Umbra/Penumbra), and Planetary ephemeris.
- Gravity Field: Recursive EGM2008 Spherical Harmonics (up to N-degree), J2, and Two-body attraction.
Orbital Mechanics & Propagators
- Propagators: Cowell’s Method, Keplerian elements, and SGP4 for TLE propagation.
- Numerical Integrators: High-order fixed and adaptive steps: RK4, RK45 (Runge-Kutta-Fehlberg), and DOP853.
- Orbital Maneuvers: Hohmann transfer, Bi-elliptic, Phasing, Plane changes, and Lambert Targeting.
- Initial Orbit Determination (IOD): Robust Gauss, Laplace, and universal variable methods.
Attitude Dynamics & Determination
- Kinematics: Quaternion, Euler Angle, and DCM (Direction Cosine Matrix) transformations.
- Dynamics: Euler's equations for rigid body rotation, including variable inertia and disturbances.
- Determination: Deterministic TRIAD and QUEST algortihms for attitude from vector observations.
Guidance, Navigation & Control (GNC)
- State Estimation:
- MEKF: Multiplicative Extended Kalman Filter for attitude.
- UKF: Unscented Kalman Filter for non-linear state estimation.
- EKF/KF: Standard and Extended Kalman Filters for orbital state mapping.
- Control Law Design:
- Classic: PID controllers and B-Dot detumbling logic.
- Optimal: LQR (Linear Quadratic Regulator) and LQE (Kalman Filter design).
- Advanced: Nonlinear MPC (Model Predictive Control) and Sliding Mode Control.
- Sensors: Realistic Star Tracker, Sun Sensor, Magnetometer, and Gyroscope models with bias/noise.
- Actuators: Model Reaction Wheels (saturation/jitter) and Thrusters (Chemical/Electric).
FDIR & Mission Design
- FDIR (Fault Detection): Parity Space methods, Residual Generation, and Safe Mode logic.
- SSA (Space Situational Awareness): Conjunction Assessment (CAT), Maneuver Detection, and TLE interface.
- Mission Design: $\Delta v$ Budgeting, Communication Link Budgets, and Ground Station Coverage tools.
Visualization & Analysis
- 3D Trajectories: Interactive Plotly-based orbital trajectory and attitude visualization.
- Telemetry Dashboards: Web-based GNC dashboards using Dash for real-time like simulation monitoring.
- Coordinate Frames: Visualizers for ECI, ECEF, Hill (RSW), and Body frame transformations.
Installation
From PyPI (Recommended)
pip install opengnc
From Source (Development)
git clone https://github.com/BatuhanAkkova/opengnc.git
cd opengnc
pip install -e ".[dev]"
Quick Start
import numpy as np
from opengnc.environment.mag_field import igrf_field
from opengnc.kalman_filters.mekf import MEKF
from opengnc.utils.quat_utils import quat_rot
# Get Earth's magnetic field at a specific ECI position
B_vec = igrf_field(pos_eci=np.array([7000e3, 0, 0]), time="2024-01-01")
# Initialize a Multiplicative Extended Kalman Filter
mekf = MEKF(q_init=np.array([0, 0, 0, 1]), covariance=1e-3 * np.eye(6))
Example Simulations
| Application | Description | Visualization | Script |
|---|---|---|---|
| CubeSat Detumbling | B-Dot magnetic control using noisy magnetometer data. | 01_cubesat_detumbling.py | |
| MPC Rendezvous | Optimal multi-burn approach in GEO using NMPC. | 04_autonomous_rendezvous.py | |
| MEKF Estimation | High-fidelity orientation tracking fusing star tracker & gyro. | 05_attitude_estimation_mekf.py | |
| VLEO Maintenance | Altitude keeping in high-drag orbits using electric propulsion. | 02_vleo_orbit_maintenance.py | |
| Gauss IOD | Initial Orbit Determination from 3-LoS vectors. | 10_gauss_iod_determination.py |
License
Distributed under the MIT License. See LICENSE for more information.
Contributing & Support
Contributions are welcome! Please see CONTRIBUTING.md for guidelines. For support or feedback, please contact Batuhan Akkova.
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 opengnc-1.0.0.tar.gz.
File metadata
- Download URL: opengnc-1.0.0.tar.gz
- Upload date:
- Size: 351.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0aa9d7fee8ff1f81993fd129d63f102358018b9ccc31d4588254ef146e080c7b
|
|
| MD5 |
f722c667e1cc4454b4e8a2961d92562c
|
|
| BLAKE2b-256 |
069bfc539e96e68369ff448be1ca3d65ede874893d5af18de3e5cdaa8d8f77fa
|
File details
Details for the file opengnc-1.0.0-py3-none-any.whl.
File metadata
- Download URL: opengnc-1.0.0-py3-none-any.whl
- Upload date:
- Size: 367.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7660b990d89d92c2390f4b521d8c86b5d8869c0a620c305dbeec821a1574f96c
|
|
| MD5 |
981bf10e41dae456d374940c78fd97f5
|
|
| BLAKE2b-256 |
7bb8767d6a0d92dc5ee20ea06c2be008657c1e63982be9390e9adfdfd37c04c4
|