GNC - space-station-os/space_station_os GitHub Wiki
Guidance, Navigation, and Control (GNC) is the subsystem that figures out where the spacecraft is, where it should go, and how to get it there—safely and precisely.
- Guidance: computes desired paths, pointing targets, and manoeuvre plans.
- Navigation: estimates the current state (position, velocity, attitude, angular rates) from sensors.
- Control: generates forces and torques (via actuators) to track guidance commands using the navigation estimate.
- Maintains correct attitude for power (solar array pointing), comms (antenna pointing), and payload ops.
- Preserves orbital safety and enables docking, reboosts, and station-keeping.
- Provides disturbance rejection (e.g., gravity-gradient, aerodynamic drag torques).
- Ensures crew and payload comfort by limiting jitter and transient loads.
- Attitude: determine and control orientation (quaternions, angular rates).
- Orbit: propagate and (optionally) plan manoeuvres in an orbital frame (e.g., ECI/LVLH).
- Actuation: allocate commands to CMGs, thrusters (and later magnetorquers).
- Fault handling: detect saturation/faults (e.g., CMG momentum build-up) and recover (e.g., unloading with thrusters).
- Sensors: IMU (rates), star tracker (attitude), GPS (position/velocity).
- Actuators: CMGs (continuous torque), thrusters (impulsive/continuous), magnetorquers (future).
- Buses/other subsystems: EPS (power limits), Comms (telemetry), OBC/Flight Software (commands & modes), GUI (viz + ops).
- Navigation: sensor inputs → estimated pose/rates for downstream control.
- Control: PD attitude control with CMG mode and thruster mode, plus CMG unloading when momentum saturates.
- Dynamics: rigid-body attitude dynamics and ECI translational propagation for orbit visualisation/analysis.
The GNC subsystem inside Space Station OS is organised into modular ROS 2 nodes, each with a clear role in the estimation–control loop.
The diagram below summarises data flow among the core elements.
graph TD
A[IMU / Star Tracker / GPS] --> B[Sensor Interface]
B --> C[State Estimator<br/>(sense_estimate.cpp)]
C --> D[Orbit Dynamics<br/>(orbit_dynamics.cpp)]
D --> E[Control Torque<br/>(control_torque.cpp)]
E --> F[Thruster Matrix<br/>(thruster_matrix.cpp)]
F --> G[Physics Motion<br/>(physics_motion.cpp)]
G --> H[Torque Collector / CMG Interface]
E --> I[EPS / Comms / GUI Visualization]
H --> I
D --> I
Data Flow Summary
-
Sensors generate raw inertial, attitude, and position data.
-
Estimator fuses sensor inputs to obtain orientation (quaternion) and angular rates.
-
Orbit Dynamics integrates the spacecraft’s translational motion in the Earth-Centered Inertial (ECI) frame.
-
Controller computes required body-frame torques to track desired attitude or orbital states.
-
Thruster Matrix converts those torques into actuator-level commands using the spacecraft geometry.
-
Physics Motion updates rotational dynamics and publishes physical states for visualization and feedback.
-
Torque Collector forwards CMG/Thruster commands to the EPS and logs telemetry for diagnostics.
| Module | Purpose |
|---|---|
| sense_estimate.cpp | Sensor-fusion node combining IMU, star-tracker, and GPS to publish estimated pose and angular velocity. |
| orbit_dynamics.cpp | Propagates orbital motion using Runge–Kutta 4 (RK4) integration of two-body dynamics in the ECI frame. |
| physics_motion.cpp | Simulates rigid-body attitude motion via Euler’s equations and quaternion kinematics; includes gravity-gradient torque. |
| control_torque.cpp | Computes control torques using a PD law; supports CMG and thruster modes with automatic momentum unloading. |
| thruster_matrix.cpp | Maps commanded torques to individual thruster forces using URDF geometry and pseudoinverse allocation. |
| torque_collector.cpp | Aggregates CMG and thruster outputs for routing to EPS and telemetry logging. |
| physics_sensor.cpp | Produces simulated IMU, gyro, and star-tracker signals for testing and visualization. |
Inter-Subsystem Links
-
EPS: supplies power limits and receives actuator demand
-
Thermal Control: can use torque or attitude data for radiator pointing
-
Comms: uses attitude data for antenna alignment
-
GUI Visualizer: subscribes to
/gnc/pose_est,/gnc/orbit_pathfor live display
This section provides a conceptual overview of the key principles that the GNC subsystem in Space Station OS is built upon.
Detailed equations, derivations, and control proofs are available in the research/ folder of the package, as well as in the linked NASA NESC Academy tutorial.
The GNC subsystem uses several coordinate systems to describe the motion and orientation of the space station:
- Earth-Centered Inertial (ECI) – A fixed reference frame used for orbital propagation.
- Earth-Centered Earth-Fixed (ECEF) – Rotates with the Earth; used for surface-based tracking.
- Local Vertical Local Horizontal (LVLH) – The local orbital frame aligned with the station’s current orbit; used for attitude control.
- Body Frame – Attached to the spacecraft’s structure; used for sensor and actuator alignment.
Transformations between these frames are handled internally by quaternion or rotation-matrix operations so that every module can interpret physical quantities consistently.
Attitude determination means figuring out how the spacecraft is oriented in space. The sense_estimate node combines data from the IMU (which measures angular rates), the star tracker (which provides absolute orientation), and the GPS (which gives orbital position). By fusing these inputs, the system obtains a stable estimate of the vehicle’s orientation and angular velocity.
For advanced missions, this process can use algorithms like QUEST or an Extended Kalman Filter (EKF) to improve robustness, but the current implementation focuses on a lightweight fusion approach suitable for real-time simulation.
Attitude control keeps the spacecraft pointing in the correct direction. The control_torque node implements a Proportional-Derivative (PD) controller that calculates how much torque is required to reduce pointing errors and stabilize the vehicle.
The control system supports two operating modes:
- CMG Mode: Uses Control Moment Gyros for fine, continuous torque control.
- Thruster Mode: Converts torque commands into small thruster firings when CMGs are saturated or unavailable.
Controller gains are set through ROS 2 parameters, allowing the behavior to be tuned for different mission profiles.
The orbit_dynamics node simulates the spacecraft’s translational motion around Earth.
This part of GNC plans and executes orbit changes or station-keeping manoeuvres. The thruster_matrix and torque_collector nodes distribute control commands across the available actuators based on spacecraft geometry. While the current system performs basic reboost and attitude-hold tasks, the framework is ready for advanced features such as:
- Optimal thrust allocation
- Autonomous collision-avoidance logic
- Energy-efficient trajectory planning
Several mathematical and physical ideas underpin the GNC subsystem:
- Quaternions and rotation matrices for representing attitude
- Rigid-body dynamics and conservation of angular momentum
- Linear feedback control theory for stability and damping
- Numerical integration for propagating orbital states
For readers who want a deeper theoretical understanding, see the research/ folder inside the space_station_gnc package and the following tutorial:
👉 [NASA NESC Academy – Spacecraft Attitude Control Fundamentals](https://nescacademy.nasa.gov/video/a7a5f8a39011410a86c1124231358ab31d)
The GNC subsystem in Space Station OS is designed to be modular.
Different launch files are provided for running the core nodes, orbital propagation, and visualization independently or together.
All launch files are located in the launch/ directory of the space_station_gnc package.
To start the main GNC loop (sensor fusion, control torque, thruster matrix, and physics modules):
ros2 launch space_station_gnc gnc_core.launch.pyThis command launches:
- sense_estimate – sensor fusion and attitude estimation
- control_torque – attitude control and CMG/thruster command generation
- thruster_matrix – actuator command distribution
- physics_motion – rigid-body rotational dynamics
- physics_sensor – simulated IMU and star tracker outputs
- torque_collector – aggregation of CMG and thruster data for EPS
These nodes continuously exchange messages through ROS 2 topics such as /gnc/pose_est, /gnc/angvel_est, /gnc/cmg_torque_cmd, and /gnc/thruster_cmd.
The orbit_dynamics node runs separately because it performs higher-level orbital propagation and can be enabled when needed for visualization or trajectory analysis.
ros2 launch space_station_gnc orbit_dynamics.launch.pyThis node publishes orbital position and velocity on:
/gnc/orbit_path/gnc/position_est/gnc/velocity_est
To visualize the spacecraft and telemetry data in RViz, use:
ros2 launch space_station_gnc gnc_rviz.launch.pyThis launch file:
- Loads the ISS URDF model
- Opens RViz with preconfigured displays for attitude, orbit path, and actuator vectors
- Subscribes to GNC topics published by
gnc_core.launch.pyororbit_dynamics.launch.py
You can observe real-time spacecraft orientation, torque vectors, and thruster activity in the 3D view.
-
Start Core Simulation
ros2 launch space_station_gnc gnc_core.launch.py
-
(Optional) Start Orbit Dynamics in a new terminal:
ros2 launch space_station_gnc orbit_dynamics.launch.py
-
Visualize in RViz:
ros2 launch space_station_gnc gnc_rviz.launch.py
-
Adjust parameters dynamically using:
ros2 param set /control_torque kp_cmg 1.5 ros2 param set /control_torque kd_cmg 0.9
-
Stop all nodes with
Ctrl + C.
- Ensure
ros2 launchcommands are executed from a sourced workspace (source install/setup.bash). - The GNC simulation is independent of the orbit dynamics node; this allows faster iteration when testing control algorithms.
- The RViz session is optional but recommended for debugging attitude or actuator behavior.
- The GNC nodes publish diagnostic and telemetry messages that can also be monitored using
rqt_graphorrqt_plot.
- Wertz, J. R. Spacecraft Attitude Determination and Control. Springer, 1978.
- Curtis, H. D. Orbital Mechanics for Engineering Students. Elsevier, 2021.
- NASA JSC. ISS GNC Overview Manual, 2020.
- NASA NESC Academy: [Spacecraft Attitude Control Fundamentals](https://nescacademy.nasa.gov/video/a7a5f8a39011410a86c1124231358ab31d)
- NASA GNC State-of-Art documentation: https://www.nasa.gov/smallsat-institute/sst-soa/guidance-navigation-and-control/
- Internal documentation: see the
research/folder in this package for derivations, control design notes, and verification results.