You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The framework is based on adaptions of OSI Sensor Model Packaging (OSMP) to load individual code modules called strategies and get parameters from profiles into the strategies.
9
-
OSMP specifies ways in which models (like e.g. environmental effect models, sensor models and logical models) using the [Open Simulation Interface (OSI)](https://github.com/OpenSimulationInterface/open-simulation-interface) are to be packaged for their use in simulation environments using FMI 2.0.
9
+
OSMP specifies ways in which models using the [Open Simulation Interface (OSI)](https://github.com/OpenSimulationInterface/open-simulation-interface) are to be packaged for their use in simulation environments using [FMI 2.0](https://fmi-standard.org).
10
10
11
-
## Important
12
-
13
-
This work is based on the [`OSMPDummySensor`](https://github.com/OpenSimulationInterface/osi-sensor-model-packaging/tree/master/examples/OSMPDummySensor) example from the [Open Simulation Inferface Sensor Model Packaging project](https://github.com/OpenSimulationInterface/osi-sensor-model-packaging).
11
+
The actual logic of the model is packed in so called strategies.
12
+
This is where the magic happens.
13
+
The `apply()` function of the strategy is called by the `do_calc()` function of the Framework.
14
+
There are two exemplary strategies delivered with this framework:
14
15
15
-
Before modifying files, carefully read the files [COPYING](COPYING) and [CONTRIBUTING.md](CONTRIBUTING.md).
16
+
1. Example strategy: It simply logs some input data to show that it is running.
17
+
2. CSV output gt objects strategy: It outputs a .csv file to `CSV_PATH` set via `CMakeLists.txt` containing moving objects from the received ground truth.
16
18
17
-
### Usage
19
+
##Configuration
18
20
19
-
The actual logic of the model is packed in so called strategies.
20
-
The `apply()` function of a strategy is called by the `do_calc()` function of the OSMP Framework.
21
+
### Model name
21
22
22
-
When building and installing, the framework will build an fmu package into `_FMU_INSTALL_DIR_`, which can be used with a simulation tool like CarMaker, dSpace ASM or others.
23
+
The model's name (in this case "FrameworkDemoModel") used for CMake-projects and the FMU at the end is defined in file `model_name.conf` located at `src/model`.
23
24
24
-
##Build Instructions for Ubuntu 18.04 / 20.04
25
+
### Install path
25
26
26
-
When building and installing, the framework will build an FMU package, which can be used with a simulation tool like CarMaker, dSpace ASM or others.
27
+
When building and installing, the framework will build an FMU package into `FMU_INSTALL_DIR`, which can be used with a simulation tool that supports OSI and fills the required fields listed below.
27
28
28
-
### Install Dependencies
29
+
### VariableNamingConvention
29
30
30
-
1. Install cmake 3.12: e.g. with
31
-
```bash
32
-
$ git clone https://github.com/Kitware/CMake
33
-
$ sudo apt install libssl-dev
34
-
$ cd CMake
35
-
$ ./bootstrap
36
-
$ make -j
37
-
$ sudo make install
38
-
```
39
-
2. Install protobuf 3.0.0:
40
-
* Check your version via `protoc --version`. It should output: `libprotoc 3.0.0`
41
-
* If needed, you can install it via `sudo apt-get install libprotobuf-dev protobuf-compiler`
42
-
* or from source:
43
-
* Download it from https://github.com/protocolbuffers/protobuf/releases/tag/v3.0.0 and extract the archive.
44
-
* Try to run `./autogen.sh`, if it failes, download the gmock-1.7.0.zip from https://pkgs.fedoraproject.org/repo/pkgs/gmock/gmock-1.7.0.zip/073b984d8798ea1594f5e44d85b20d66/gmock-1.7.0.zip, extract it into the protobuf folder and rename the gmock-1.7.0 folter to gmock.
45
-
* Proceed with the install with
46
-
```bash
47
-
$ make
48
-
$ sudo make install
49
-
$ sudo ldconfig # refresh shared library cache.
50
-
```
31
+
The parameter variableNamingConvention for the FMU specified within the modelDescription.xml is taken from file `variableNamingConvention.conf` located at `src/osmp`.
32
+
Possible values are "flat" or "structured".
51
33
52
-
### Clone with Submodules, Build, and Install
34
+
### Profiles for Parameterization
53
35
54
-
1. Clone this repository <ins>with submodules</ins>:
The profiles are parameterized in the files `profile_*.hpp.in`.
37
+
The parameters are declared in the files `profile.hpp.in`.
38
+
The profiles can be extended by the strategies with additional parameters and values in their respective folders.
71
39
72
-
(Please note that sources are not packed into the FMU at the moment.)
40
+
The profile to be loaded for simulation is set via a model parameter defined in the `modelDescription.xml` of the FMU.
41
+
The first name in `src/model/profiles/profile_list.conf` is taken as default.
42
+
If you would like to have a different one or if your simulation master does not support the configuration of model parameters, you have to adapt the *start* value of the parameter `profile` in `src/osmp/modelDescription.in.xml`.
73
43
74
44
## How to use (= extend) this framework
75
45
@@ -126,7 +96,7 @@ Have a look at the existing strategies to get an idea about how easy it is to in
126
96
/* TODO add further profiles and profile generators here */
2. Build the model in [MSYS-2020](install_model_Win64_MSYS-2020.md) or [Visual Studio 2017](install_model_Win64_VS2017.md)
124
+
3. Take FMU from `FMU_INSTALL_DIR`
125
+
126
+
(Please note that sources are not packed into the FMU at the moment.)
127
+
128
+
## Build Instructions in Ubuntu 18.04 / 20.04
129
+
130
+
### Install Dependencies in Ubuntu 18.04 / 20.04
131
+
132
+
1. Install cmake 3.12
133
+
* as told in [these install instructions](install_cmake_ubuntu_3-12.md)
134
+
2. Install protobuf 3.0.0:
135
+
* Check your version via `protoc --version`. It should output: `libprotoc 3.0.0`
136
+
* If needed, you can install it via `sudo apt-get install libprotobuf-dev protobuf-compiler`
137
+
* or from source:
138
+
* Download it from https://github.com/protocolbuffers/protobuf/releases/tag/v3.0.0 and extract the archive.
139
+
* Try to run `./autogen.sh`, if it failes, download the gmock-1.7.0.zip from https://pkgs.fedoraproject.org/repo/pkgs/gmock/gmock-1.7.0.zip/073b984d8798ea1594f5e44d85b20d66/gmock-1.7.0.zip, extract it into the protobuf folder and rename the gmock-1.7.0 folter to gmock.
To install (copy) the binary and libraries to the new destination, run:
27
+
```bash
28
+
$ sudo make install
29
+
```
30
+
31
+
If you haven't already installed a newer cmake installation, run the following command to tell Ubuntu that the cmake command is now being replaced by an alternative installation:
If you already have a custom cmake version installed (in my case I still had the 3.10.1 version active), the update-alternatives command is not necessary.
37
+
The make install command will replace the existing binary in /usr/local/bin/cmake. This can be verified using:
38
+
```bash
39
+
$ cmake --version
40
+
cmake version 3.12.1
41
+
42
+
CMake suite maintained and supported by Kitware (kitware.com/cmake).
The lib folder contains libraries used for the entire model. At the moment only OSIand FMI are included, but you can add other libraries for your model, e.g. as git submodules.
3
+
The lib folder contains libraries used for the entire model. At the moment OSI, FMI and Eigen are included, but you can add other libraries for your model, e.g. as git submodules.
Copy file name to clipboardexpand all lines: src/model/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# FZD OSMP Framework - *model* Folder
1
+
# Modular OSMP Framework - *model* Folder
2
2
3
3
The *model* folder contains the actual model logic and is subdevided into *include*, *profiles* and *strategies*. It also contains the *model_name.conf*. In this file the name of the model can be set. This will define the name of the overall fmu package as well as the name inside the model description.
The include folder does not have to be changed by the user. It contains the definition of the strategy class and defines framework in which the strategies are called.
The strategies folder contains individual folders for every strategy. Inside the modular strategies the actual model code is written. So every strategy is contained in their own folder with their own includes, src and CMakeLists.
4
4
5
-
The *sequence.conf* defines, in which order the strategies are called by the framework. The indicidual strategies are listed in lines in this file. In this example only the "empty-strategy" is called.
5
+
The *sequence.conf* defines, in which order the strategies are called by the framework. The individual strategies are listed in lines in this file. In this example first the "empty-strategy" is called, then the "csv-output-gtobjects-strategy".
0 commit comments