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).
The common architecture shown in the diagram above has been developed for the NOS3 simulations. This architecture has been developed for the following reasons:
- Bus level communication is the goal of NOS3 simulations
- Decoupling the HW Model and Data Provider allows for mix and match, e.g. for a GPS:
- NovAtel 615 vs. FOTON vs. some other model:
- The byte communication is different, commands and telemetry different, etc., but any GPS model needs PVT data
- PVT data could be provided by:
- 42 over a TCP/IP socket
- A fixed file of data
- Some other data provider
- This architecture allows mix and match between hardware models and data providers
An overview of what each of these does:
File / Directory | Description |
---|---|
|
This repository contains the ArduCAM NOS3 Simulator. |
|
This repository contains the Clyde Space NOS3 Simulator. |
|
This repository contains the Clyde Space NOS3 Simulator. |
|
This repository contains an example Generic Reaction Wheel NOS3 Simulator. |
|
This repository contains the NOS engine time driver to synchronize time between 42, Simulators and Flight software |
|
This repository contains the NovAtel OEM 615 NOS3 Simulator. |
|
This repository contains the Sample NOS3 Simulator. |
|
NOS3 configuration files, 42 configuration files, and simulator hardware factory models |
|
NOS Engine Server configuration file |
|
Command terminal to send commands over the NOS engine interfaces, can be used to test and command individual hardware simulators |
|
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:
- Create a main source file with the following contents:
- Change “foosim” to whatever you would like the name of your simulator to be
#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());
}
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.