Skip to content

Commit 41f14a3

Browse files
authored
Merge pull request #778 from OpenSimulationInterface/750-define-mandatory-field-with-checker-rules
Define mandatory field with checker rules
2 parents 2466fcb + a6e0aa5 commit 41f14a3

22 files changed

+131
-3
lines changed

doc/architecture/architecture_overview.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ This has been done to allow backward-compatible changes in the field.
5151
Additionally, this is the default behavior in Protocol Buffer version 3 that no longer has the `required` type.
5252
Setting all fields to `optional` thus ensures update compatibility.
5353
However, this does not mean that it is optional to fill the field.
54-
For the purpose of providing a complete interface, all existing fields should be set, unless not setting a field carries a specific meaning, as indicated in the accompanying comment.
54+
Fields with the rule `is_set` are mandatory and have to be set at all times.
55+
All other fields have to be set according to the requirements of the connected models.
5556

5657
NOTE: All field numbers equal to or greater than 10000 are available for user-specific extensions via custom fields.
5758
No future evolution of OSI will therefore use field numbers equal to or greater than 10000.

osi_detectedobject.proto

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ message DetectedItemHeader
1717
// Specific ID of the detected item as assigned by the sensor internally.
1818
// Needs not to match with \c #ground_truth_id.
1919
//
20+
// \rules
21+
// is_set
22+
// \endrules
23+
//
2024
optional Identifier tracking_id = 1;
2125

2226
// The ID of the original detected item in the ground truth.

osi_featuredata.proto

+8
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ message SensorDetectionHeader
9292
// \par Reference:
9393
// [1] DIN Deutsches Institut fuer Normung e. V. (2013). <em>DIN ISO 8855 Strassenfahrzeuge - Fahrzeugdynamik und Fahrverhalten - Begriffe</em>. (DIN ISO 8855:2013-11). Berlin, Germany.
9494
//
95+
// \rules
96+
// is_set
97+
// \endrules
98+
//
9599
optional MountingPosition mounting_position = 3;
96100

97101
// The origin/orientation of the sensor frame represents the current
@@ -124,6 +128,10 @@ message SensorDetectionHeader
124128
// This ID can equal \c SensorData::sensor_id, if \c SensorData holds only
125129
// data from one sensor/sensor model.
126130
//
131+
// \rules
132+
// is_set
133+
// \endrules
134+
//
127135
optional Identifier sensor_id = 7;
128136

129137
// The extended qualifier describes the reason (not the effect) why the

osi_groundtruth.proto

+10-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ message GroundTruth
4747
// The interface version used by the sender (i.e. the simulation
4848
// environment).
4949
//
50+
// \rules
51+
// is_set
52+
// \endrules
53+
//
5054
optional InterfaceVersion version = 1;
5155

5256
// The data timestamp of the simulation environment. The zero time point is
@@ -60,6 +64,10 @@ message GroundTruth
6064
// (there is no inherent latency for ground truth data, as opposed to
6165
// sensor data).
6266
//
67+
// \rules
68+
// is_set
69+
// \endrules
70+
//
6371
optional Timestamp timestamp = 2;
6472

6573
// The ID of the host vehicle object referencing to \c MovingObject .
@@ -68,6 +76,7 @@ message GroundTruth
6876
//
6977
// \rules
7078
// refers_to: MovingObject
79+
// is_set
7180
// \endrules
7281
//
7382
optional Identifier host_vehicle_id = 3;
@@ -118,7 +127,7 @@ message GroundTruth
118127
// [1] ISO International Organization for Standardization. (2013). <em>ISO 3166-1 Codes for the representation of names of countries and their subdivisions - Part 1: Country codes</em>. (ISO 3166-1:2013). Geneva, Switzerland.
119128
//
120129
// \rules
121-
// is_iso_country_code:
130+
// is_iso_country_code
122131
// \endrules
123132
//
124133
optional uint32 country_code = 13;

osi_lane.proto

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ message Lane
4242
//
4343
// \rules
4444
// is_globally_unique
45+
// is_set
4546
// \endrules
4647
//
4748
optional Identifier id = 1;

osi_logicaldetectiondata.proto

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ message LogicalDetectionData
1919
// The interface version used by the sender (i.e. the simulation
2020
// environment).
2121
//
22+
// \rules
23+
// is_set
24+
// \endrules
25+
//
2226
optional InterfaceVersion version = 1;
2327

2428
// Header attributes of fused detections from multiple sensors and sensor types.

osi_logicallane.proto

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ message LogicalLaneBoundary
5656
//
5757
// \rules
5858
// is_globally_unique
59+
// is_set
5960
// \endrules
6061
//
6162
optional Identifier id = 1;

osi_motionrequest.proto

+8
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ message MotionRequest
2525
{
2626
// The interface version used by the sender (simulation environment).
2727
//
28+
// \rules
29+
// is_set
30+
// \endrules
31+
//
2832
optional InterfaceVersion version = 1;
2933

3034
// The data timestamp of the simulation environment.
3135
// A reference to \c Timestamp message.
3236
//
37+
// \rules
38+
// is_set
39+
// \endrules
40+
//
3341
optional Timestamp timestamp = 2;
3442

3543
// Define the type that is used to specify the motion request.

osi_object.proto

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ message StationaryObject
2121
//
2222
// \rules
2323
// is_globally_unique
24+
// is_set
2425
// \endrules
2526
//
2627
optional Identifier id = 1;
@@ -388,6 +389,7 @@ message MovingObject
388389
//
389390
// \rules
390391
// is_globally_unique
392+
// is_set
391393
// \endrules
392394
//
393395
optional Identifier id = 1;

osi_referenceline.proto

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ message ReferenceLine
3232
//
3333
// \rules
3434
// is_globally_unique
35+
// is_set
3536
// \endrules
3637
//
3738
optional Identifier id = 1;

osi_roadmarking.proto

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ message RoadMarking
2929
{
3030
// The ID of the road marking.
3131
//
32+
// \rules
33+
// is_set
34+
// \endrules
35+
//
3236
optional Identifier id = 1;
3337

3438
// The base parameters of the road marking.

osi_route.proto

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ message Route
4040
// \note This id must be unique within all route messages exchanged with
4141
// one traffic participant.
4242
//
43+
// \rules
44+
// is_set
45+
// \endrules
46+
//
4347
optional Identifier route_id = 1;
4448

4549
// Route segments that form the route of an agent.

osi_sensordata.proto

+16
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ message SensorData
102102
{
103103
// The interface version used by the sender.
104104
//
105+
// \rules
106+
// is_set
107+
// \endrules
108+
//
105109
optional InterfaceVersion version = 1;
106110

107111
// The timestamp of the sensor data. Zero time is arbitrary but must be
@@ -129,6 +133,10 @@ message SensorData
129133
// a dumb sensor with no internal time concept), the two timestamps might
130134
// also be identical, but delayed from the \c GroundTruth timestamp.
131135
//
136+
// \rules
137+
// is_set
138+
// \endrules
139+
//
132140
optional Timestamp timestamp = 2;
133141

134142
// The sensors estimated location of the host vehicle
@@ -156,6 +164,10 @@ message SensorData
156164
// object output; it is distinct from the IDs of its physical detectors,
157165
// which are used in the detected features.
158166
//
167+
// \rules
168+
// is_set
169+
// \endrules
170+
//
159171
optional Identifier sensor_id = 5;
160172

161173
// The virtual mounting position of the sensor (origin and orientation
@@ -186,6 +198,10 @@ message SensorData
186198
// vehicle's bounding box \c MovingObject::base . \c
187199
// BaseMoving::orientation.
188200
//
201+
// \rules
202+
// is_set
203+
// \endrules
204+
//
189205
optional MountingPosition mounting_position = 6;
190206

191207
// The root mean squared error of the mounting position.

osi_sensorview.proto

+14
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ message SensorView
3636
{
3737
// The interface version used by the sender (simulation environment).
3838
//
39+
// \rules
40+
// is_set
41+
// \endrules
42+
//
3943
optional InterfaceVersion version = 1;
4044

4145
// The data timestamp of the simulation environment. Zero time is arbitrary
@@ -48,6 +52,10 @@ message SensorView
4852
// (there is no inherent latency for sensor view data, as opposed to
4953
// sensor data).
5054
//
55+
// \rules
56+
// is_set
57+
// \endrules
58+
//
5159
optional Timestamp timestamp = 2;
5260

5361
// The ID of the sensor at host vehicle's \c #mounting_position.
@@ -58,6 +66,7 @@ message SensorView
5866
//
5967
// \rules
6068
// is_globally_unique
69+
// is_set
6170
// \endrules
6271
//
6372
optional Identifier sensor_id = 3;
@@ -92,6 +101,10 @@ message SensorView
92101
// vehicle's bounding box \c MovingObject::base . \c
93102
// BaseMoving::orientation.
94103
//
104+
// \rules
105+
// is_set
106+
// \endrules
107+
//
95108
optional MountingPosition mounting_position = 4;
96109

97110
// The root mean squared error of the mounting position.
@@ -127,6 +140,7 @@ message SensorView
127140
//
128141
// \rules
129142
// refers_to: 'MovingObject'
143+
// is_set
130144
// \endrules
131145
//
132146
optional Identifier host_vehicle_id = 8;

osi_sensorviewconfiguration.proto

+8
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ message SensorViewConfiguration
6666
{
6767
// The interface version used by the sender (simulation environment).
6868
//
69+
// \rules
70+
// is_set
71+
// \endrules
72+
//
6973
optional InterfaceVersion version = 1;
7074

7175
// The ID of the sensor at host vehicle's mounting_position.
@@ -77,6 +81,10 @@ message SensorViewConfiguration
7781
// The ID is to be provided by the environment simulation, the sensor
7882
// model is not in a position to provide a useful default value.
7983
//
84+
// \rules
85+
// is_set
86+
// \endrules
87+
//
8088
optional Identifier sensor_id = 2;
8189

8290
// The virtual mounting position of the sensor (origin and orientation

osi_streamingupdate.proto

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ message StreamingUpdate
3030
{
3131
// The interface version used by the sender.
3232
//
33+
// \rules
34+
// is_set
35+
// \endrules
36+
//
3337
optional InterfaceVersion version = 1;
3438

3539
// The data timestamp where the information of contained objects is calculated.
@@ -38,6 +42,10 @@ message StreamingUpdate
3842
// Zero time does not need to coincide with the UNIX epoch.
3943
// Recommended is the starting time point of the simulation.
4044
//
45+
// \rules
46+
// is_set
47+
// \endrules
48+
//
4149
optional Timestamp timestamp = 2;
4250

4351
// The list of stationary objects (excluding traffic signs and traffic

osi_trafficcommand.proto

+12
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ message TrafficCommand
2121
{
2222
// The interface version used by the sender (scenario engine).
2323
//
24+
// \rules
25+
// is_set
26+
// \endrules
27+
//
2428
optional InterfaceVersion version = 1;
2529

2630
// The data timestamp of the simulation environment. Zero time is arbitrary
@@ -33,10 +37,18 @@ message TrafficCommand
3337
// There is no inherent latency for traffic command data, as opposed
3438
// to sensor data.
3539
//
40+
// \rules
41+
// is_set
42+
// \endrules
43+
//
3644
optional Timestamp timestamp = 2;
3745

3846
// The ID of this traffic participant.
3947
//
48+
// \rules
49+
// is_set
50+
// \endrules
51+
//
4052
optional Identifier traffic_participant_id = 3;
4153

4254
// Commanded traffic action(s) if any.

osi_trafficcommandupdate.proto

+12
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,30 @@ message TrafficCommandUpdate
2929
{
3030
// The interface version used by the sender (traffic participant model).
3131
//
32+
// \rules
33+
// is_set
34+
// \endrules
35+
//
3236
optional InterfaceVersion version = 1;
3337

3438
// The data timestamp of the simulation environment. Zero time is arbitrary
3539
// but must be identical for all messages. Zero time does not need to
3640
// coincide with the UNIX epoch. It is recommended to use zero timestamp as
3741
// the starting time point of the simulation.
3842
//
43+
// \rules
44+
// is_set
45+
// \endrules
46+
//
3947
optional Timestamp timestamp = 2;
4048

4149
// The ID of this traffic participant which must coincide with a prior sent ID, cf.
4250
// \c TrafficCommand::traffic_participant_id.
4351
//
52+
// \rules
53+
// is_set
54+
// \endrules
55+
//
4456
optional Identifier traffic_participant_id = 3;
4557

4658
// Actions which a traffic participant dismisses and which are not yet ended or

osi_trafficlight.proto

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ message TrafficLight
2020
//
2121
// \rules
2222
// is_globally_unique
23+
// is_set
2324
// \endrules
2425
//
2526
optional Identifier id = 1;

osi_trafficsign.proto

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ message TrafficSign
173173
//
174174
// \rules
175175
// is_globally_unique
176+
// is_set
176177
// \endrules
177178
//
178179
optional Identifier id = 1;

0 commit comments

Comments
 (0)