42 Configuration

File Paths:

/opt/42 - 42 built & packaged for NOS3

nos3/sims/cfg/InOut - Configuration files can be found here.

Common Problems:

  1. 42 expects the input files to be plain vanilla text files. If your text editor adds formatting, makes straight quotes into smart quotes, etc, 42 may get confused. The most common symptom is generating the "Bogus input in DecodeString" error.
  2. Also text-related, 42 is very simple-minded about reading the input files. Adding extra lines, or accidentally deleting a line, or swapping lines, will throw things out of synch. Again, the most common symptom is the "Bogus input in DecodeString" error. Use your debugger to trace back where the error was generating. (The actual mistake may be at that line, or may be somewhere upstream.)

42 Overview

Some of the simulated hardware components require dynamic environmental data. 42 is an open source visualization and simulation tool for spacecraft attitude and orbital dynamics and environmental data developed by NASA's Goddard Space Flight Center (GSFC). The role of 42 within NOS3 is to provide dynamic environmental data required by the simulated hardware components.

The presentation material on 42 describes it as a general-purpose, multi-body, multi-spacecraft simulation. The presentation materials describe the following features of 42 which are of interest to NOS3 (other features are described as well):

  1. Multiple spacecraft, anywhere in the solar system
    1. Two-body, three-body orbit dynamics (with seamless transition between)
    2. One sun, nine planets, 45 major moons

The presentation materials also list the following environmental models which are of interest to NOS3 (other models are described as well):

  1. Planetary Ephemerides
    1. From Meeus, “Astronomical Algorithms”
    2. Good enough for GNC validation, not intended for mission planning
  2. Gravity Models have coefficients up to 18th order and degree
    1. Earth: EGM96
  3. Planetary Magnetic Field Models
    1. IGRF up to 10th order (Earth only)
  4. Earth Atmospheric Density Models
    1. MSIS-86 (thanks to John Downing)
    2. Jacchia-Roberts Atmospheric Density Model (NASA SP-8021)

42 uses a collection of input files to control its execution. For NOS3, the main configuration files of interest are the following:

  1. Inp_Sim.txt – The main configuration file which defines items such as the environment (epoch, gravity models, celestial bodies, etc.), spacecraft reference orbits and configuration files, spacecraft and configuration files, and ground station locations.
  2. Orb_LEO.txt – Spacecraft reference orbit file referred to by Inp_Sim.txt. This file specifies the orbit center (Earth) and contains the Keplerian orbital elements or refers to a two line element set file which defines the spacecraft orbit. A two-line element set (TLE) is a data format encoding a list of orbital elements of an Earth-orbiting object for a given point in time, the epoch. Using suitable prediction formula, the state (position and velocity) at times in the past or future can be estimated to some accuracy. The TLE data representation is specific to the simplified perturbations models (SGP, SGP4, SDP4, SGP8 and SDP8), so any algorithm using a TLE as a data source must implement one of the SGP models to correctly compute the state at a time of interest. Prior to STF-1 launch the orbital elements are notional, based on a probable STF-1 orbit.
  3. SC_NOS3.txt – Spacecraft definition file referred to by Inp_Sim.txt. This file defines labels, orbit parameters, initial attitude, body parameters (e.g. mass and moments of inertia), and other parameters specific to the spacecraft.. It also defines the flight software used, which for NOS3 should be set to PASSIVE_FSW.
  4. Inp_IPC.txt – File defining the TCP/IP or file parameters for communicating input and output to and from 42. This is the typical interface for communicating sensor data and actuator commands between 42 and the NOS3 simulators.
  5. Inp_Graphics.txt – File defining the GUI configuration for 42, including what windows to display, parameters for the point of view, various display elements such as grids and labels, and other graphic elements properties.
  6. Inp_NOS3.txt – File defining the connection to NOS Engine for 42 to receive synchronized time ticks.
  7. There are several other 42 input files which are not typically used in NOS3, including Inp_Cmd.txt (defining a command script for 42), Inp_FOV.txt (defining fields of view), Inp_Region.txt (defining regions for 42), and Inp_TDRS.txt (defining TDRS satellites for 42).