3.3.1 Building and installing examples
OSMP includes three examples located in osmp/examples
:
OSMPDummySensor/
-
Can be used as a simple dummy sensor model, demonstrating the use of OSI for sensor models consuming sensor view data and generating sensor data output.
OSMPDummySource/
-
Can be used as a simple source of sensor view data and ground-truth data. It can be connected to the input of an
OSMPDummySensor
model, for simple testing and demonstration purposes. OSMPCNetworkProxy/
-
Demonstrates a simple C network proxy that can send and receive OSI data via TCP sockets.
Prerequisites
-
You have installed all prerequisites according to the way of linking of your choice, as described in Section 2.3, "Setting up OSI".
Steps
-
Clone the OSMP repository.
git clone https://github.com/OpenSimulationInterface/osi-sensor-model-packaging.git
-
Switch to the OSMP repository.
cd osi-sensor-model-packaging
-
Update and initialize the OSI submodule.
git submodule update --init
-
Run cmake and build
-
If you followed the protobuf installation instructions for Windows using vcpkg, you can use the built protobuf libraries to automatically build the examples by specifying the triplet and toolchain file from VCPKG on the cmake configuration command-line:
cd examples mkdir build cd build cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DCMAKE_TOOLCHAIN_FILE=../../../vcpkg/scripts/buildsystems/vcpkg.cmake cmake –-build .
The CMAKE_TOOLCHAIN_FILE must point to your vcpkg directory, which in this example was parallel to the osi-sensor-model-packaging directory.
-
If you did not install and build protobuf using vcpkg, use:
cd examples mkdir build cd build cmake .. cmake --build .
-