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), 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).

.
├── ~/nos3/
|   ├── /sims
|   |   ├── /arducam_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.

/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"; // this is 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.