This repository contains the source code for a simulated BSP Module for the Apache Strap-Down Pilotage program. It builds a shared library that can be used to simulate the behavior of the BSP module in a controlled environment.
This repository has a submodule, which must be initialized after cloning the repository. This can be done as follows:
git clone https://github.com/arizonaCameraLab/ASDP_Camera_Simulator
git submodule init
or it can be done in one step as follows:
git clone --recursive https://github.com/arizonaCameraLab/ASDP_Camera_Simulator
This repository also depends on the ASDP_Core_API repository to have been installed on this machine. See that repository for more information.
Build: ASDP_Camera__Simulator uses CMake to configure the builds (though other build systems could be used). On Ubuntu Linux, this can be done as follows:
sudo apt install cmake
cd; mkdir src; cd src; git clone --recursive https://github.com/arizonaCameraLab/ASDP_Camera_Simulator
cd; mkdir -p build/ASDP_Camera_Simulator; cd build/ASDP_Camera_Simulator
cmake ../../src/ASDP_Camera_Simulator
make
Install: The ASDP_Camera_Simulator installs a shared library that is loaded by the ASDP_Core_Module application at run time. It is installed as follows:
sudo make install
Configure: The shared library is configured using a configuration file. The
configuration file is installed in the bin directory as ASDP_Camera_Simulator.conf.
There is a convention that simulated camera serial numbers are the value 65000 plus
the number of cameras -- a 21-camera simulator would have serial number 65021. This
makes it easy to produce a range of simulated cameras without having to change the
rendering configuration file when the numnber of cameras changes because one can be
provided for each. When editing the configuration file, be sure to modify both the
General/SerialNumber and Camera/NumCameras fields to keep them consistent.
Documentation: The primary documentation is available in DOxygen, and is generated by as part of the build process when DOxygen is available. On Ubuntu Linux, this can be generated as follows:
sudo apt install doxygen- When you build using CMake, it will build DOxygen by default.
- Open doc_doxygen/html/index.html in the build directory with a web browser to view the documentation.
This simulator generates a dynamic library that is loaded by the https://github.com/arizonaCameraLab/ASDP_Core_Module project when it is run. The shared library is installed in the /usr/local/lib directory by default on Linux.
Test: CMake includes the concept of test applications. You can run the tests
by running make test in the build directory to run unit tests on components.
There is a test_BSP.cpp program available in the Core module that can be used to
validate that the simulator is working.
The ASDP_Camera_Simulator.cpp file contains the main source code for the simulated BSP module. It makes use of an ImageSource library to generate simulated images. It makes use of the ASDP_Core_Module API to send the UDP packets.
TemperatureSensor and Pose classes implement the temperature and pose results based on specified timing periods for each.