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).
An overview of what each of these does:
File / Directory | Description |
---|---|
|
This repository contains the ArduCAM 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"; // 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());
}
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.