@@ -2,11 +2,11 @@ OSI Sensor Model Packaging Specification
2
2
========================================
3
3
4
4
This document specifies the ways in which environmental effect models,
5
- sensor models and logical models using the ` Open Simulation Interface `_
6
- are to be packaged for their use in simulation environments using FMI
7
- 2.0.
5
+ sensor models, logical models and traffic participant models using the
6
+ ` Open Simulation Interface `_ are to be packaged for their use in simulation
7
+ environments using FMI 2.0.
8
8
9
- This is version 1.0 .0 of this document. The version number is to be
9
+ This is version 1.1 .0 of this document. The version number is to be
10
10
interpreted according to the `Semantic Versioning Specification (SemVer)
11
11
2.0.0 `_.
12
12
@@ -24,11 +24,22 @@ can be packaged as FMUs:
24
24
and produce ``osi::SensorView `` as output,
25
25
26
26
- Sensor models, which consume ``osi::SensorView `` as input and generate
27
- ``osi::SensorData `` as output, and
27
+ ``osi::SensorData `` as output,
28
28
29
29
- Logical models, like e.g. sensor fusion models, which consume
30
30
``osi::SensorData `` as input and produce ``osi::SensorData `` as output.
31
31
32
+ - Traffic Participant models, which consume ``osi::SensorView `` as input
33
+ and generate ``osi::TrafficUpdate `` as output. These models can
34
+ internally use e.g. Environmental effect, Sensor and/or Logical models
35
+ as part of a modeled autonomous vehicle, but they can also be used to
36
+ implement surrounding traffic in simplified ways. Optionally, traffic
37
+ participant models can consume ``osi::TrafficCommand `` as input, to
38
+ allow control by a scenario engine as part of the simulation.
39
+
40
+ All models can optionally also consume a global ``osi::GroundTruth ``
41
+ during initialization.
42
+
32
43
Additionally complex models that combine various aspects of the model
33
44
kinds above are possible, however configuration and setup of such FMUs
34
45
will require manual intervention in those cases.
@@ -78,10 +89,9 @@ The following basic conventions apply:
78
89
- Besides the model parameters, inputs and outputs specified below the
79
90
model can have additional inputs, outputs, and parameters (i.e. all
80
91
kinds of variables as specified in the FMI 2.0 standard), as long as
81
- the sensor model can be run correctly with all of those variables
82
- left unconnected and at their default values. The sensor model MUST
83
- NOT rely on other connections (beside the specified data connections)
84
- being made.
92
+ the model can be run correctly with all of those variables left
93
+ unconnected and at their default values. The model MUST NOT rely on
94
+ other connections (beside the specified data connections) being made.
85
95
86
96
Definition of Binary Variables
87
97
------------------------------
@@ -375,6 +385,120 @@ Sensor Data Inputs
375
385
processes that generated the data, i.e. the exact details of the
376
386
contents will depend on the processing pipeline.
377
387
388
+ GroundTruth Initialization Parameters
389
+ -------------------------------------
390
+
391
+ - All models CAN optionally consume an ``osi::GroundTruth `` as an
392
+ initialization parameter.
393
+
394
+ - If a model needs a ground truth during initialization, it MUST have
395
+ a parameter named ``OSMPGroundTruthInit ``. Its purpose is to provide
396
+ the model with a view of the static environment (i.e. the map), in
397
+ OSI format.
398
+
399
+ - ``OSMPGroundTruthInit `` MUST be defined as a notional discrete binary
400
+ input parameter variable, as specified above, with
401
+ ``causality="parameter" ``, ``variability="fixed" `` and ``initial="exact" ``.
402
+
403
+ - The MIME type of the variable MUST specify the ``type=GroundTruth ``, e.g.
404
+ ``application/x-open-simulation-interface; type=GroundTruth; version=3.3.0 ``.
405
+
406
+ - ``OSMPGroundTruthInit `` MUST be encoded as ``osi::GroundTruth `` (see the OSI
407
+ specification documentation for more details).
408
+
409
+ - ``OSMPGroundTruthInit `` MUST contain all static data (e.g. roads) encountered
410
+ by the model during a simulation run. Any dynamic data (e.g. MovingObjects)
411
+ it contains MUST NOT be used and has no specified semantics.
412
+
413
+ - The Ids of objects in ``OSMPGroundTruthInit `` MUST be identical to the Ids of
414
+ the same objects contained in later ``OSMPSensorViewIn `` or other input data.
415
+
416
+ - If the model is instantiated multiple times, then all instantiations SHOULD
417
+ receive the exact same content stored in the ``OSMPGroundTruthInit ``
418
+ parameter. This allows a model to do expensive map calculations only once
419
+ during initialization, and to share the calculated data between multiple
420
+ instantiations.
421
+
422
+ - The guaranteed lifetime of the ground truth protocol buffer pointer
423
+ provided as input to the FMU MUST be from the time of the call to
424
+ ``fmi2SetInteger `` that provides those values until the end of the following
425
+ ``fmi2ExitInitializationMode `` call.
426
+
427
+ Traffic Update Outputs
428
+ ----------------------
429
+
430
+ - Traffic update outputs MUST be named with the prefix
431
+ ``OSMPTrafficUpdateOut ``. If more than one traffic update output is
432
+ to be provided, the prefix MUST be extended by an array index
433
+ designator, i.e. two outputs will use the prefixes
434
+ ``OSMPTrafficUpdateOut[1] `` and ``OSMPTrafficUpdateOut[2] ``. The
435
+ indices MUST start at 1 and MUST be consecutive. If only one traffic
436
+ update output is needed the prefix MUST be just
437
+ ``OSMPTrafficUpdateOut ``.
438
+
439
+ - Each traffic update output MUST be defined as a notional discrete
440
+ binary output variable, as specified above, with
441
+ ``causality="output" `` and ``variability="discrete" ``.
442
+
443
+ - The MIME type of the variable MUST specify the ``type=TrafficUpdate ``,
444
+ e.g.
445
+ ``application/x-open-simulation-interface; type=TrafficUpdate; version=3.3.0 ``.
446
+
447
+ - The traffic update MUST be encoded as ``osi::TrafficUpdate `` (see the
448
+ OSI specification documentation for more details).
449
+
450
+ - The guaranteed lifetime of the traffic update protocol buffer pointer
451
+ provided as output by the FMU MUST be from the end of the call to
452
+ ``fmi2DoStep `` that calculated this buffer until the beginning of the
453
+ **second ** ``fmi2DoStep `` call after that, i.e. the simulation engine
454
+ can rely on the provided buffer remaining valid from the moment it is
455
+ passed out until the end of the next Co-Simulation calculation cycle,
456
+ and thus does not need to copy the contents in that case (zero copy
457
+ output for the simulation engine, at the cost of double buffering for
458
+ the model).
459
+
460
+ This arrangement (and hence the need for double buffering) is
461
+ required to support use of the model FMUs in simulation
462
+ engines that have no special support for the protocol buffer
463
+ pointers, i.e. using this convention it is possible to daisy chain
464
+ FMUs with protocol buffer inputs/outputs in a normal simulation
465
+ engine like e.g. MATLAB/Simulink, and get valid results.
466
+
467
+ Traffic Command Inputs
468
+ ----------------------
469
+
470
+ - Traffic command inputs are optionally present in traffic participant
471
+ models, in order to allow control of some parts of the traffic
472
+ participant behavior by scenario engines.
473
+
474
+ - Traffic command inputs MUST be named with the prefix
475
+ ``OSMPTrafficCommandIn ``. If more than one traffic command input is
476
+ to be configured, the prefix MUST be extended by an array index
477
+ designator, i.e. two inputs will use the prefixes
478
+ ``OSMPTrafficCommandIn[1] `` and ``OSMPTrafficCommandIn[2] ``. The
479
+ indices MUST start at 1 and MUST be consecutive. If only one traffic
480
+ command input is needed the prefix MUST be just
481
+ ``OSMPTrafficCommandIn ``.
482
+
483
+ - Each traffic command input MUST be defined as a notional discrete
484
+ binary input variable, as specified above, with ``causality="input" ``
485
+ and ``variability="discrete" ``.
486
+
487
+ - The MIME type of the variable MUST specify the ``type=TrafficCommand ``,
488
+ e.g.
489
+ ``application/x-open-simulation-interface; type=TrafficCommand; version=3.3.0 ``.
490
+
491
+ - The traffic command MUST be encoded as ``osi::TrafficCommand `` (see
492
+ the OSI specification documentation for more details).
493
+
494
+ - The guaranteed lifetime of the traffic command protocol buffer pointer
495
+ provided as input to the FMU MUST be from the time of the call to
496
+ ``fmi2SetInteger `` that provides those values until the end of the
497
+ following ``fmi2DoStep `` call, i.e. the model can rely on the provided
498
+ buffer remaining valid from the moment it is passed in until the end
499
+ of the corresponding calculation, and thus does not need to copy the
500
+ contents in that case (zero copy input).
501
+
378
502
Examples
379
503
--------
380
504
0 commit comments