Hardware Simulators

NOS3 simulator code has been developed in C++ with Boost and relies on the NASA Operational Simulator (NOS) Engine for providing the software busses, nodes, and other connections that simulate the hardware busses such as UART (universal asynchronous receiver/transmitter), I2C (Inter-Integrated Circuit), SPI (Serial Peripheral Interface), CAN (Controller Area Network), and discrete I/O (input/output) signals/connections/busses. NOS Engine also provides the mechanism to distribute time to all the simulators (and to the flight software and 42).

Simulator Framework

The common architecture shown in the diagram above has been developed for the NOS3 simulations. This architecture has been developed for the following reasons:

  1. Bus level communication is the goal of NOS3 simulations
  2. Decoupling the HW Model and Data Provider allows for mix and match, e.g. for a GPS:
  3. NovAtel 615 vs. FOTON vs. some other model:
    1. The byte communication is different, commands and telemetry different, etc., but any GPS model needs PVT data
    2. PVT data could be provided by:
      1. 42 over a TCP/IP socket
      2. A fixed file of data
      3. Some other data provider
  4. This architecture allows mix and match between hardware models and data providers


├── ~/nos3/

|   ├── /sims

|   |   ├── /arducam_sim

|   |   ├── /clyde_battery_sim

|   |   ├── /clyde_eps_sim

|   |   ├── /generic_reaction_wheel_sim

|   |   ├── /nos_time_driver

|   |   ├── /novatel_oem615_sim

|   |   ├── /sample_sim

|   |   ├── /sim_common

|   |   ├── /sim_server

|   |   ├── /sim_terminal

|   |   ├── CMakeLists.txt

|   |   ├── MissionSettings.cmake

|   └── ... 

                        

An overview of what each of these does:

File / DirectoryDescription

/arducam_sim

This repository contains the ArduCAM NOS3 Simulator.

/clyde_battery_sim

This repository contains the Clyde Space NOS3 Simulator.

/clyde_eps_sim

This repository contains the Clyde Space NOS3 Simulator.

/generic_reaction_wheel_sim

This repository contains an example Generic Reaction Wheel NOS3 Simulator.

/nos_time_driver

This repository contains the NOS engine time driver to synchronize time between 42, Simulators and Flight software

/novatel_oem615_sim

This repository contains the NovAtel OEM 615 NOS3 Simulator.

/sample_sim

This repository contains the Sample NOS3 Simulator.

/sim_common

NOS3 configuration files, 42 configuration files, and simulator hardware factory models

/sim_server

NOS Engine Server configuration file

/sim_terminal

Command terminal to send commands over the NOS engine interfaces, can be used to test and command individual hardware simulators

MissionSettings.cmake

CMAKE build file

Writing Your Own Simulator

The following formula describes how to create a simulator using a hardware model (and optionally a data provider) created using the formulas above:

  1. Create a main source file with the following contents:
  2. 
    
    #include <ItcLogger/Logger.hpp>
    
    #include <sim_config.hpp>
    
    
    
    namespace Nos3
    
    {
    
        ItcLogger::Logger *sim_logger;
    
    }
    
    
    
    int main(int argc, char *argv[])
    
    {
    
        std::string simulator_name = "foosim"; // the ONLY simulator specific line! 
    
        // Determine the configuration and run the simulator
    
        Nos3::SimConfig sc(argc, argv);
    
        Nos3::sim_logger->info("main: %s simulator starting",
    
        simulator_name.c_str());
    
        sc.run_simulator(simulator_name);
    
        Nos3::sim_logger->info("main: %s simulator terminating",
    
        simulator_name.c_str());
    
    }
    
                                    
  3. Change “foosim” to whatever you would like the name of your simulator to be
XML Configuration

Once the above steps are completed, you can find the XML Configuration steps in the Configuration Files tab located on the right side of the page.