Skip to content

Commit c853a1c

Browse files
vkreschpmai
authored andcommitted
Add rules to fields for osi-validator validation
This commit adds the feature to define rules in the comments which can be used by the validator. This adds a rules file called rules.yml in which the user can define the regex syntax for valid rules to be parsed.
1 parent eee2663 commit c853a1c

20 files changed

+453
-29
lines changed

osi_common.proto

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ message Timestamp
7272
//
7373
// Unit: s
7474
//
75+
// \rules
76+
// is_greater_than_or_equal_to: 0
77+
// \endrules
78+
//
7579
optional int64 seconds = 1;
7680

7781
// The number of nanoseconds since the start of the last second.
@@ -80,6 +84,11 @@ message Timestamp
8084
//
8185
// Unit: ns
8286
//
87+
// \rules
88+
// is_greater_than_or_equal_to: 0
89+
// is_less_than_or_equal_to: 999999999
90+
// \endrules
91+
//
8392
optional uint32 nanos = 2;
8493
}
8594

@@ -100,18 +109,30 @@ message Dimension3d
100109
//
101110
// Unit: m
102111
//
112+
// \rules
113+
// is_greater_than_or_equal_to: 0
114+
// \endrules
115+
//
103116
optional double length = 1;
104117

105118
// The width of the box.
106119
//
107120
// Unit: m
108121
//
122+
// \rules
123+
// is_greater_than_or_equal_to: 0
124+
// \endrules
125+
//
109126
optional double width = 2;
110127

111128
// The height of the box.
112129
//
113130
// Unit: m
114131
//
132+
// \rules
133+
// is_greater_than_or_equal_to: 0
134+
// \endrules
135+
//
115136
optional double height = 3;
116137
}
117138

@@ -187,6 +208,10 @@ message Identifier
187208
{
188209
// The identifier's value.
189210
//
211+
// \rules
212+
// is_greater_than_or_equal_to: 0
213+
// \endrules
214+
//
190215
optional uint64 value = 1;
191216
}
192217

@@ -234,6 +259,10 @@ message Spherical3d
234259
//
235260
// Unit: m
236261
//
262+
// \rules
263+
// is_greater_than_or_equal_to: 0
264+
// \endrules
265+
//
237266
optional double distance = 1;
238267

239268
// The azimuth (horizontal) angle.

osi_detectedlane.proto

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ message DetectedLane
3434
// given under the condition of
3535
// \c DetectedItemHeader::existence_probability.
3636
//
37-
// Range: [0,1]
37+
// \rules
38+
// is_less_than_or_equal_to: 1
39+
// is_greater_than_or_equal_to: 0
40+
// \endrules
3841
//
3942
optional double probability = 1;
4043

@@ -94,7 +97,10 @@ message DetectedLaneBoundary
9497
// one \c #boundary_line_confidences confidence value is
9598
// specified which is suitable for all candidates.
9699
//
97-
// Range: [0,1]
100+
// \rules
101+
// is_greater_than_or_equal_to: 0
102+
// is_less_than_or_equal_to: 1
103+
// \endrules
98104
//
99105
repeated double boundary_line_confidences = 5;
100106

@@ -110,7 +116,10 @@ message DetectedLaneBoundary
110116
// given under the condition of
111117
// \c DetectedItemHeader::existence_probability.
112118
//
113-
// Range: [0,1]
119+
// \rules
120+
// is_greater_than_or_equal_to: 0
121+
// is_less_than_or_equal_to: 1
122+
// \endrules
114123
//
115124
optional double probability = 1;
116125

osi_detectedobject.proto

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ message DetectedItemHeader
3131
// \note Use as confidence measure where a low value means less confidence
3232
// and a high value indicates strong confidence.
3333
//
34-
// Range: [0,1]
34+
// \rules
35+
// is_greater_than_or_equal_to: 0
36+
// is_less_than_or_equal_to: 1
37+
// \endrules
3538
//
3639
optional double existence_probability = 3;
3740

@@ -129,7 +132,10 @@ message DetectedStationaryObject
129132
// given under the condition of
130133
// \c DetectedItemHeader::existence_probability.
131134
//
132-
// Range: [0,1]
135+
// \rules
136+
// is_greater_than_or_equal_to: 0
137+
// is_less_than_or_equal_to: 1
138+
// \endrules
133139
//
134140
optional double probability = 1;
135141

@@ -182,12 +188,22 @@ message DetectedMovingObject
182188
//
183189
// Percentage value of the object width in the corresponding lane.
184190
//
191+
// \rules
192+
// is_greater_than_or_equal_to: 0
193+
// is_less_than_or_equal_to: 100
194+
// \endrules
195+
//
185196
optional double percentage_side_lane_left = 6;
186197

187198
// Percentage side lane right.
188199
//
189200
// Percentage value of the object width in the corresponding lane.
190201
//
202+
// \rules
203+
// is_greater_than_or_equal_to: 0
204+
// is_less_than_or_equal_to: 100
205+
// \endrules
206+
//
191207
optional double percentage_side_lane_right = 7;
192208

193209
// A list of candidates for this moving object as estimated by the
@@ -237,7 +253,10 @@ message DetectedMovingObject
237253
// given under the condition of
238254
// \c DetectedItemHeader::existence_probability.
239255
//
240-
// Range: [0,1]
256+
// \rules
257+
// is_greater_than_or_equal_to: 0
258+
// is_less_than_or_equal_to: 1
259+
// \endrules
241260
//
242261
optional double probability = 1;
243262

osi_detectedoccupant.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ message DetectedOccupant
3535
// given under the condition of
3636
// \c DetectedItemHeader::existence_probability.
3737
//
38-
// Range: [0,1]
38+
// \rules
39+
// is_greater_than_or_equal_to: 0
40+
// is_less_than_or_equal_to: 1
41+
// \endrules
3942
//
4043
optional double probability = 1;
4144

osi_detectedroadmarking.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ message DetectedRoadMarking
7171
// given under the condition of
7272
// \c DetectedItemHeader::existence_probability.
7373
//
74-
// Range: [0,1]
74+
// \rules
75+
// is_less_than_or_equal_to: 1
76+
// is_greater_than_or_equal_to: 0
77+
// \endrules
7578
//
7679
optional double probability = 1;
7780

osi_detectedtrafficlight.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ message DetectedTrafficLight
5555
// given under the condition of
5656
// \c DetectedItemHeader::existence_probability.
5757
//
58-
// Range: [0,1]
58+
// \rules
59+
// is_less_than_or_equal_to: 1
60+
// is_greater_than_or_equal_to: 0
61+
// \endrules
5962
//
6063
optional double probability = 1;
6164

osi_detectedtrafficsign.proto

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ message DetectedTrafficSign
7979
// probability is given under the condition of \c
8080
// DetectedItemHeader::existence_probability.
8181
//
82-
// Range: [0,1]
82+
// \rules
83+
// is_less_than_or_equal_to: 1
84+
// is_greater_than_or_equal_to: 0
85+
// \endrules
8386
//
8487
optional double probability = 1;
8588

@@ -204,7 +207,10 @@ message DetectedTrafficSign
204207
// probability is given under the condition of \c
205208
// DetectedItemHeader::existence_probability.
206209
//
207-
// Range: [0,1]
210+
// \rules
211+
// is_less_than_or_equal_to: 1
212+
// is_greater_than_or_equal_to: 0
213+
// \endrules
208214
//
209215
optional double probability = 1;
210216

osi_environment.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,22 @@ message EnvironmentalConditions
4444
//
4545
// Unit: Pa
4646
//
47+
// \rules
48+
// is_greater_than_or_equal_to: 80000
49+
// is_less_than_or_equal_to: 120000
50+
// \endrules
51+
//
4752
optional double atmospheric_pressure = 3;
4853

4954
// Temperature in Kelvin at z=0.0 in world frame.
5055
//
5156
// Unit: K
5257
//
58+
// \rules
59+
// is_greater_than_or_equal_to: 170
60+
// is_less_than_or_equal_to: 340
61+
// \endrules
62+
//
5363
optional double temperature = 4;
5464

5565
// Relative humidity in at z=0.0 in world frame.
@@ -59,6 +69,12 @@ message EnvironmentalConditions
5969
// temperature and atmospheric_pressure are known.
6070
//
6171
// Unit: %
72+
//
73+
// \rules
74+
// is_greater_than_or_equal_to: 0
75+
// is_less_than_or_equal_to: 100
76+
// \endrules
77+
//
6278
optional double relative_humidity = 5;
6379

6480
// Description of the precipitation.
@@ -295,6 +311,11 @@ message EnvironmentalConditions
295311
// \note No changes of daylight saving time or time zones are
296312
// considered.
297313
//
314+
// \rules
315+
// is_greater_than_or_equal_to: 0
316+
// is_less_than: 86400
317+
// \endrules
318+
//
298319
optional uint32 seconds_since_midnight = 1;
299320
}
300321
}

0 commit comments

Comments
 (0)