Skip to main content

A Guidance, Navigation, and Control toolkit for spacecraft.

Project description

OpenGNC

PyPI version License: MIT Python 3.10+ Ruff

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. CubeSat Detumbling 01_cubesat_detumbling.py
MPC Rendezvous Optimal multi-burn approach in GEO using NMPC. Autonomous Rendezvous 04_autonomous_rendezvous.py
MEKF Estimation High-fidelity orientation tracking fusing star tracker & gyro. Attitude Estimation 05_attitude_estimation_mekf.py
VLEO Maintenance Altitude keeping in high-drag orbits using electric propulsion. VLEO Orbit Maintenance 02_vleo_orbit_maintenance.py
Gauss IOD Initial Orbit Determination from 3-LoS vectors. Gauss IOD 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


Download files

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

Source Distribution

opengnc-1.0.0.tar.gz (351.8 kB view details)

Uploaded Source

Built Distribution

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

opengnc-1.0.0-py3-none-any.whl (367.8 kB view details)

Uploaded Python 3

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

Hashes for opengnc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0aa9d7fee8ff1f81993fd129d63f102358018b9ccc31d4588254ef146e080c7b
MD5 f722c667e1cc4454b4e8a2961d92562c
BLAKE2b-256 069bfc539e96e68369ff448be1ca3d65ede874893d5af18de3e5cdaa8d8f77fa

See more details on using hashes here.

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

Hashes for opengnc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7660b990d89d92c2390f4b521d8c86b5d8869c0a620c305dbeec821a1574f96c
MD5 981bf10e41dae456d374940c78fd97f5
BLAKE2b-256 7bb8767d6a0d92dc5ee20ea06c2be008657c1e63982be9390e9adfdfd37c04c4

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