From 06c579ed26dfc0f6d6c0bfdfd0bb8c1010b84a2a Mon Sep 17 00:00:00 2001 From: Viktor Kreschenski Date: Fri, 10 Jan 2020 17:21:50 +0100 Subject: [PATCH] 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. --- osi_common.proto | 29 +++++++ osi_detectedlane.proto | 15 +++- osi_detectedobject.proto | 25 +++++- osi_detectedoccupant.proto | 5 +- osi_detectedroadmarking.proto | 5 +- osi_detectedtrafficlight.proto | 5 +- osi_detectedtrafficsign.proto | 10 ++- osi_environment.proto | 21 +++++ osi_featuredata.proto | 123 ++++++++++++++++++++++++++---- osi_groundtruth.proto | 8 ++ osi_lane.proto | 67 ++++++++++++++++ osi_object.proto | 28 +++++++ osi_occupant.proto | 4 + osi_roadmarking.proto | 17 ++++- osi_sensorspecific.proto | 9 +++ osi_sensorview.proto | 8 ++ osi_sensorviewconfiguration.proto | 63 +++++++++++++++ osi_trafficlight.proto | 12 +++ osi_trafficsign.proto | 16 ++++ rules.yml | 12 +++ 20 files changed, 453 insertions(+), 29 deletions(-) create mode 100644 rules.yml diff --git a/osi_common.proto b/osi_common.proto index 4891a2a9a..213dc99ba 100644 --- a/osi_common.proto +++ b/osi_common.proto @@ -72,6 +72,10 @@ message Timestamp // // Unit: s // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional int64 seconds = 1; // The number of nanoseconds since the start of the last second. @@ -80,6 +84,11 @@ message Timestamp // // Unit: ns // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 999999999 + // \endrules + // optional uint32 nanos = 2; } @@ -100,18 +109,30 @@ message Dimension3d // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double length = 1; // The width of the box. // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double width = 2; // The height of the box. // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double height = 3; } @@ -187,6 +208,10 @@ message Identifier { // The identifier's value. // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional uint64 value = 1; } @@ -234,6 +259,10 @@ message Spherical3d // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double distance = 1; // The azimuth (horizontal) angle. diff --git a/osi_detectedlane.proto b/osi_detectedlane.proto index 4303c8b72..b1e541914 100644 --- a/osi_detectedlane.proto +++ b/osi_detectedlane.proto @@ -34,7 +34,10 @@ message DetectedLane // given under the condition of // \c DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_less_than_or_equal_to: 1 + // is_greater_than_or_equal_to: 0 + // \endrules // optional double probability = 1; @@ -94,7 +97,10 @@ message DetectedLaneBoundary // one \c #boundary_line_confidences confidence value is // specified which is suitable for all candidates. // - // Range: [0,1] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // repeated double boundary_line_confidences = 5; @@ -110,7 +116,10 @@ message DetectedLaneBoundary // given under the condition of // \c DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double probability = 1; diff --git a/osi_detectedobject.proto b/osi_detectedobject.proto index 9dfe0ec3f..27fb6a069 100644 --- a/osi_detectedobject.proto +++ b/osi_detectedobject.proto @@ -31,7 +31,10 @@ message DetectedItemHeader // \note Use as confidence measure where a low value means less confidence // and a high value indicates strong confidence. // - // Range: [0,1] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double existence_probability = 3; @@ -129,7 +132,10 @@ message DetectedStationaryObject // given under the condition of // \c DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double probability = 1; @@ -182,12 +188,22 @@ message DetectedMovingObject // // Percentage value of the object width in the corresponding lane. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 100 + // \endrules + // optional double percentage_side_lane_left = 6; // Percentage side lane right. // // Percentage value of the object width in the corresponding lane. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 100 + // \endrules + // optional double percentage_side_lane_right = 7; // A list of candidates for this moving object as estimated by the @@ -237,7 +253,10 @@ message DetectedMovingObject // given under the condition of // \c DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double probability = 1; diff --git a/osi_detectedoccupant.proto b/osi_detectedoccupant.proto index 2c27cae93..86bacb8c0 100644 --- a/osi_detectedoccupant.proto +++ b/osi_detectedoccupant.proto @@ -35,7 +35,10 @@ message DetectedOccupant // given under the condition of // \c DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double probability = 1; diff --git a/osi_detectedroadmarking.proto b/osi_detectedroadmarking.proto index f499e1688..efd5b578d 100644 --- a/osi_detectedroadmarking.proto +++ b/osi_detectedroadmarking.proto @@ -71,7 +71,10 @@ message DetectedRoadMarking // given under the condition of // \c DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_less_than_or_equal_to: 1 + // is_greater_than_or_equal_to: 0 + // \endrules // optional double probability = 1; diff --git a/osi_detectedtrafficlight.proto b/osi_detectedtrafficlight.proto index 2ddd0de56..16e27f452 100644 --- a/osi_detectedtrafficlight.proto +++ b/osi_detectedtrafficlight.proto @@ -55,7 +55,10 @@ message DetectedTrafficLight // given under the condition of // \c DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_less_than_or_equal_to: 1 + // is_greater_than_or_equal_to: 0 + // \endrules // optional double probability = 1; diff --git a/osi_detectedtrafficsign.proto b/osi_detectedtrafficsign.proto index e8daaee08..4d7320d76 100644 --- a/osi_detectedtrafficsign.proto +++ b/osi_detectedtrafficsign.proto @@ -79,7 +79,10 @@ message DetectedTrafficSign // probability is given under the condition of \c // DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_less_than_or_equal_to: 1 + // is_greater_than_or_equal_to: 0 + // \endrules // optional double probability = 1; @@ -204,7 +207,10 @@ message DetectedTrafficSign // probability is given under the condition of \c // DetectedItemHeader::existence_probability. // - // Range: [0,1] + // \rules + // is_less_than_or_equal_to: 1 + // is_greater_than_or_equal_to: 0 + // \endrules // optional double probability = 1; diff --git a/osi_environment.proto b/osi_environment.proto index fd4d40d1c..e6139d4ca 100644 --- a/osi_environment.proto +++ b/osi_environment.proto @@ -44,12 +44,22 @@ message EnvironmentalConditions // // Unit: Pa // + // \rules + // is_greater_than_or_equal_to: 80000 + // is_less_than_or_equal_to: 120000 + // \endrules + // optional double atmospheric_pressure = 3; // Temperature in Kelvin at z=0.0 in world frame. // // Unit: K // + // \rules + // is_greater_than_or_equal_to: 170 + // is_less_than_or_equal_to: 340 + // \endrules + // optional double temperature = 4; // Relative humidity in at z=0.0 in world frame. @@ -59,6 +69,12 @@ message EnvironmentalConditions // temperature and atmospheric_pressure are known. // // Unit: % + // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 100 + // \endrules + // optional double relative_humidity = 5; // Description of the precipitation. @@ -295,6 +311,11 @@ message EnvironmentalConditions // \note No changes of daylight saving time or time zones are // considered. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than: 86400 + // \endrules + // optional uint32 seconds_since_midnight = 1; } } diff --git a/osi_featuredata.proto b/osi_featuredata.proto index 625ca10bd..df274561b 100644 --- a/osi_featuredata.proto +++ b/osi_featuredata.proto @@ -72,6 +72,10 @@ message SensorDetectionHeader // In general the detection function is called periodically and // \c #cycle_counter corresponds to the number of periods. // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional uint64 cycle_counter = 2; // Mounting position of the sensor (origin and orientation of the sensor @@ -118,6 +122,10 @@ message SensorDetectionHeader // // \note This value has to be set if the list contains invalid detections. // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional uint32 number_of_valid_detections = 6; // The ID of the sensor at host vehicle's \c #mounting_position. @@ -254,17 +262,24 @@ message RadarDetection // Existence probability of the detection not based on history. Value does // not depend on any past experience with similar detections. // - // Range: [0.0, 1.0] - // // \note Use as confidence measure where a low value means less confidence // and a high value indicates strong confidence. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules + // optional double existence_probability = 1; // ID of the detected object this detection is associated to. // // \note ID = MAX(uint64) indicates no reference to an object. // + // \rules + // refers_to: DetectedObject + // \endrules + // optional Identifier object_id = 2; // Measured position of the detection given in spherical coordinates in the @@ -280,12 +295,20 @@ message RadarDetection // // Unit: m/s // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double radial_velocity = 5; // Root mean squared error of the object measured radial velocity. // // Unit: m/s // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double radial_velocity_rmse = 6; // The radar cross section (RCS) of the radar detection. @@ -303,7 +326,10 @@ message RadarDetection // Describes the possibility whether more than one object may have led to // this detection. // - // Range: [0.0, 1.0] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double point_target_probability = 9; @@ -349,17 +375,24 @@ message LidarDetection // Existence probability of the detection not based on history. Value does // not depend on any past experience with similar detections. // - // Range: [0.0, 1.0] - // // \note Used as confidence measure where a low value means less confidence // and a high value indicates strong confidence. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules + // optional double existence_probability = 1; // ID of the detected object this detection is associated to. // // \note ID = MAX(uint64) indicates no reference to an object. // + // \rules + // refers_to: DetectedObject + // \endrules + // optional Identifier object_id = 2; // Measured position of the detection given in spherical coordinates in the @@ -376,24 +409,40 @@ message LidarDetection // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double height = 5; // Root mean squared error of the object height. // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double height_rmse = 6; // Intensity or equivalent value of the detection's echo. // // Unit: % // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 100 + // \endrules + // optional double intensity = 7; // The free space probability in the range [0.0, 1.0] from the origin of the // sensor up to this detection, as given by the distance. // - // Range: [0.0, 1.0] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double free_space_probability = 8; @@ -487,23 +536,34 @@ message UltrasonicDetection // Existence probability of the detection not based on history. Value does // not depend on any past experience with similar detections. // - // Range: [0.0, 1.0] - // // \note Used as confidence measure where a low value means less confidence // and a high value indicates strong confidence. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules + // optional double existence_probability = 1; // ID of the detected object this detection is associated to. // // \note ID = MAX(uint64) indicates no reference to an object. // + // \rules + // refers_to: DetectedObject + // \endrules + // optional Identifier object_id = 2; // Measured distance (radius) of the detection. // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double distance = 3; } @@ -527,17 +587,24 @@ message UltrasonicIndirectDetection // Existence probability of the detection not based on history. Value does // not depend on any past experience with similar detections. // - // Range: [0.0, 1.0] - // // \note Used as confidence measure where a low value means less confidence // and a high value indicates strong confidence. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules + // optional double existence_probability = 1; // ID of the detected object this detection is associated to. // // \note ID = MAX(uint64) indicates no reference to an object. // + // \rules + // refers_to: DetectedObject + // \endrules + // optional Identifier object_id = 2; // First parameter b of an ellipsoid equation. @@ -573,6 +640,10 @@ message CameraDetectionSpecificHeader // // \note This value has to be set if the list contains invalid points. // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional uint32 number_of_valid_points = 1; } @@ -610,17 +681,24 @@ message CameraDetection // Existence probability of the detection not based on history. Value does // not depend on any past experience with similar detections. // - // Range: [0.0, 1.0] - // // \note Used as confidence measure where a low value means less confidence // and a high value indicates strong confidence. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules + // optional double existence_probability = 1; // ID of the detected object this detection is associated to. // // \note ID = MAX(uint64) indicates no reference to an object. // + // \rules + // refers_to: DetectedObject + // \endrules + // optional Identifier object_id = 2; // Difference to the base timestamp \c @@ -770,7 +848,10 @@ message CameraDetection // This probability defines the mininimum probability for each selected // shape classification. // - // Range: [0.0, 1.0] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double shape_classification_probability = 27; @@ -780,7 +861,10 @@ message CameraDetection // The probability of the shape's color. // - // Range: [0.0, 1.0] + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules // optional double color_probability = 29; @@ -799,6 +883,10 @@ message CameraDetection // Number of points which defines the shape. // \c #image_shape_type may restrict the number of possible values. // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional uint32 number_of_points = 32; // Definition of shape dominant color. @@ -936,11 +1024,14 @@ message CameraPoint // Existence probability of the point not based on history. Value does // not depend on any past experience with similar points. // - // Range: [0.0, 1.0] - // // \note Used as confidence measure where a low value means less confidence // and a high value indicates strong confidence. // + // \rules + // is_greater_than_or_equal_to: 0 + // is_less_than_or_equal_to: 1 + // \endrules + // optional double existence_probability = 1; // Measured point refered by one camera detection given in spherical diff --git a/osi_groundtruth.proto b/osi_groundtruth.proto index 6dcf02d5e..77c084d28 100644 --- a/osi_groundtruth.proto +++ b/osi_groundtruth.proto @@ -64,6 +64,10 @@ message GroundTruth // // \note This ID has to be filled and is not optional! // + // \rules + // refers_to: MovingObject + // \endrules + // optional Identifier host_vehicle_id = 3; // The list of stationary objects (excluding traffic signs and traffic @@ -130,6 +134,10 @@ message GroundTruth // ed., 2013] (https://www.iso.org/obp/ui/) // - [2] [Wikipedia ISO 3166/1] (https://en.wikipedia.org/wiki/ISO_3166-1) // + // \rules + // is_iso_country_code: + // \endrules + // optional uint32 country_code = 13; // Projection string that allows to transform all coordinates in GroundTruth diff --git a/osi_lane.proto b/osi_lane.proto index f7ab9e37b..56ef288e1 100644 --- a/osi_lane.proto +++ b/osi_lane.proto @@ -40,6 +40,10 @@ message Lane // // \note Note ID is global unique. // + // \rules + // is_globally_unique + // \endrules + // optional Identifier id = 1; // The classification of the lane. @@ -230,6 +234,10 @@ message Lane // // \note OSI uses singular instead of plural for repeated field names. // + // \rules + // check_if this.type is_different_to 4 else do_check is_set + // \endrules + // repeated Identifier left_adjacent_lane_id = 5; // List of IDs of all lane segments that are directly adjacent to the @@ -246,6 +254,10 @@ message Lane // // \note OSI uses singular instead of plural for repeated field names. // + // \rules + // check_if this.type is_different_to 4 else do_check is_set + // \endrules + // repeated Identifier right_adjacent_lane_id = 6; // The antecessor/successor lane pairings of this lane. There can be @@ -275,6 +287,10 @@ message Lane // // \note OSI uses singular instead of plural for repeated field names. // + // \rules + // check_if this.type is_different_to 4 else do_check is_set + // \endrules + // repeated Identifier right_lane_boundary_id = 8; // The left adjacent lane boundaries \c #left_lane_boundary_id may only @@ -292,6 +308,10 @@ message Lane // // \note OSI uses singular instead of plural for repeated field names. // + // \rules + // check_if this.type is_different_to 4 else do_check is_set + // \endrules + // repeated Identifier left_lane_boundary_id = 9; // The free boundaries which have no/unknown assignment to left/right. @@ -304,6 +324,10 @@ message Lane // // \note OSI uses singular instead of plural for repeated field names. // + // \rules + // check_if this.type is_different_to 4 else do_check is_set + // \endrules + // repeated Identifier free_lane_boundary_id = 10; // The condition of the lane, e.g. influenced by weather. @@ -350,12 +374,20 @@ message Lane // // Unit: K // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double surface_temperature = 1; // The height of the water film on top of the surface in mm. // // Unit: mm // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double surface_water_film = 2; // The temperature where the water on top of the surface would start @@ -363,12 +395,20 @@ message Lane // // Unit: K // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double surface_freezing_point = 3; // The percentage of ice covering the road. // // Unit: % // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double surface_ice = 4; // The coefficient representing the roughness or unevenness of the @@ -406,6 +446,10 @@ message Lane // - [1] SAYERS, M.W.; KARAMIHAS, S.M. Little Book of Profiling, // University of Michigan Transportation Research Institute, 1998. // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double surface_roughness = 5; // The surface texture or fine roughness @@ -473,10 +517,18 @@ message Lane { // The antecessor lane ID. // + // \rules + // refers_to: Lane + // \endrules + // optional Identifier antecessor_lane_id = 1; // The successor lane ID. // + // \rules + // refers_to: Lane + // \endrules + // optional Identifier successor_lane_id = 2; } } @@ -500,6 +552,10 @@ message LaneBoundary { // The ID of the lane boundary. // + // \rules + // is_globally_unique + // \endrules + // optional Identifier id = 1; // The list of individual points defining the location of the lane boundary @@ -527,6 +583,13 @@ message LaneBoundary // \attention For \c BoundaryPoint the same rule for the approximation // error applies as for \c Lane::Classification::centerline. // + // \rules + // first_element width is_equal_to 0.13 + // first_element height is_equal_to 0.14 + // last_element width is_equal_to 0.13 + // last_element height is_equal_to 0.13 + // \endrules + // repeated BoundaryPoint boundary_line = 2; // The classification of the lane boundary. @@ -677,6 +740,10 @@ message LaneBoundary // This field must be set if the \c #type is set to // \c #TYPE_STRUCTURE // + // \rules + // refers_to: StationaryObject + // \endrules + // repeated Identifier limiting_structure_id = 3; // The lane boundary type. diff --git a/osi_object.proto b/osi_object.proto index 42eec7c9d..e65654375 100644 --- a/osi_object.proto +++ b/osi_object.proto @@ -19,6 +19,10 @@ message StationaryObject { // The ID of the object. // + // \rules + // is_globally_unique + // \endrules + // optional Identifier id = 1; // The base parameters of the stationary object. @@ -279,6 +283,10 @@ message MovingObject { // The ID of the object. // + // \rules + // is_globally_unique + // \endrules + // optional Identifier id = 1; // The base parameters of the vehicle. @@ -305,6 +313,10 @@ message MovingObject // \note This field is mandatory if the \c #type is // #TYPE_VEHICLE . // + // \rules + // check_if this.type is_equal_to 2 else do_check is_set + // \endrules + // optional VehicleAttributes vehicle_attributes = 5; // Specific information about the classification of the vehicle. @@ -313,6 +325,10 @@ message MovingObject // \note This field is mandatory if the \c #type is // #TYPE_VEHICLE . // + // \rules + // check_if this.type is_equal_to 2 else do_check is_set + // \endrules + // optional VehicleClassification vehicle_classification = 6; // Opaque reference of an associated 3D model of the moving object. @@ -385,10 +401,18 @@ message MovingObject // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double radius_wheel = 2; // Number of independent wheels. // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 number_wheels = 3; // The vector pointing from the bounding box center point (\c @@ -437,6 +461,10 @@ message MovingObject // \note Field need not be set if has_Trailer is set to false or use // value for non valid id. // + // \rules + // check_if this.has_trailer is_equal_to true else do_check is_set + // \endrules + // optional Identifier trailer_id = 4; // Definition of vehicle types. diff --git a/osi_occupant.proto b/osi_occupant.proto index 10d2f04b7..131e109fa 100644 --- a/osi_occupant.proto +++ b/osi_occupant.proto @@ -13,6 +13,10 @@ message Occupant { // The ID of the driver. // + // \rules + // is_globally_unique + // \endrules + // optional Identifier id = 1; // Specific information about the classification of the occupant. diff --git a/osi_roadmarking.proto b/osi_roadmarking.proto index 0aeb529da..fd8cd0378 100644 --- a/osi_roadmarking.proto +++ b/osi_roadmarking.proto @@ -73,14 +73,23 @@ message RoadMarking // \note Field need not be set (or set to \c #TYPE_OTHER) // if road marking type (\c #type) does not require it. // - optional TrafficSign.MainSign.Classification.Type - traffic_main_sign_type = 2; + // \rules + // check_if this.type is_greater_than_or_equal_to 2 else do_check is_set + // check_if this.type is_less_than_or_equal_to 4 else do_check is_set + // \endrules + // + optional TrafficSign.MainSign.Classification.Type traffic_main_sign_type = 2; // The monochrome color of the road marking. // \note Field need not be set (or set to \c #COLOR_OTHER) // if road marking type does not require it (e.g. for \c #type == // \c #TYPE_PAINTED_TRAFFIC_SIGN). // + // \rules + // check_if this.type is_equal_to 2 else do_check is_set + // check_if this.monochrome_color is_equal_to 1 else do_check is_set + // \endrules + // optional Color monochrome_color = 3; // Additional value associated with the road marking, e.g. value of the @@ -104,6 +113,10 @@ message RoadMarking // // \note OSI uses singular instead of plural for repeated field names. // + // \rules + // refers_to: Lane + // \endrules + // repeated Identifier assigned_lane_id = 6; diff --git a/osi_sensorspecific.proto b/osi_sensorspecific.proto index 8acb12cb4..48b3ca9af 100644 --- a/osi_sensorspecific.proto +++ b/osi_sensorspecific.proto @@ -50,6 +50,10 @@ message UltrasonicSpecificObjectData // // Unit: m // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double maximum_measurement_distance_sensor = 1; // This value indicates the propability height for the classification in the @@ -57,6 +61,11 @@ message UltrasonicSpecificObjectData // // Unit: % // + // \rules + // is_less_than_or_equal_to: 1 + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double probability = 2; // This indicates if the detection was calculated based on one or multiple diff --git a/osi_sensorview.proto b/osi_sensorview.proto index 98a907fac..dd9276acf 100644 --- a/osi_sensorview.proto +++ b/osi_sensorview.proto @@ -56,6 +56,10 @@ message SensorView // object output; it is distinct from the IDs of its physical detectors, // which are used in the detected features. // + // \rules + // is_globally_unique + // \endrules + // optional Identifier sensor_id = 3; // The virtual mounting position of the sensor (origin and orientation @@ -119,6 +123,10 @@ message SensorView // The ID of the host vehicle in the \c #global_ground_truth data. // + // \rules + // refers_to: 'MovingObject' + // \endrules + // optional Identifier host_vehicle_id = 8; // Generic SensorView(s). diff --git a/osi_sensorviewconfiguration.proto b/osi_sensorviewconfiguration.proto index dda00adec..419f11168 100644 --- a/osi_sensorviewconfiguration.proto +++ b/osi_sensorviewconfiguration.proto @@ -144,6 +144,11 @@ message SensorViewConfiguration // that the simulation environment has to provide. // // Unit: m + // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double range = 7; // The update cycle time of the sensor model. @@ -363,18 +368,33 @@ message RadarSensorViewConfiguration // // \note This is a characteristic of the ray tracing engine of the // environment simulation, not a direct characteristic of the sensor. + // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 number_of_rays_horizontal = 6; // Number of rays to cast across vertical field of view (elevation). // // \note This is a characteristic of the ray tracing engine of the // environment simulation, not a direct characteristic of the sensor. + // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 number_of_rays_vertical = 7; // Maximum number of interactions to take into account. // // \note This is a characteristic of the ray tracing engine of the // environment simulation, not a direct characteristic of the sensor. + // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 max_number_of_interactions = 8; // Emitter Frequency. @@ -388,6 +408,11 @@ message RadarSensorViewConfiguration // purposes the frequency is also relevant. // // Unit: Hz + // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double emitter_frequency = 9; // This represents the TX antenna diagram @@ -499,18 +524,33 @@ message LidarSensorViewConfiguration // // \note This is a characteristic of the ray tracing engine of the // environment simulation, not a direct characteristic of the sensor. + // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 number_of_rays_horizontal = 6; // Number of rays to cast across vertical field of view. // // \note This is a characteristic of the ray tracing engine of the // environment simulation, not a direct characteristic of the sensor. + // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 number_of_rays_vertical = 7; // Maximum number of interactions to take into account. // // \note This is a characteristic of the ray tracing engine of the // environment simulation, not a direct characteristic of the sensor. + // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 max_number_of_interactions = 8; // Emitter Frequency. @@ -524,12 +564,21 @@ message LidarSensorViewConfiguration // purposes the frequency is also relevant. // // Unit: Hz + // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double emitter_frequency = 9; // Number of pixels in frame. // // This field includes the number of pixels in each frame // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 num_of_pixels = 10; // Ray tracing data. @@ -619,12 +668,22 @@ message CameraSensorViewConfiguration // // \note This is a characteristic of the rendering engine of the // environment simulation, not a direct characteristic of the sensor. + // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 number_of_pixels_horizontal = 6; // Number of pixels to produce across horizontal field of view. // // \note This is a characteristic of the rendering engine of the // environment simulation, not a direct characteristic of the sensor. + // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // optional uint32 number_of_pixels_vertical = 7; // Format for image data (includes number, kind and format of channels). @@ -641,6 +700,10 @@ message CameraSensorViewConfiguration // must be no value, indicating that the simulation environment // cannot provide image data in one of the requested formats. // + // \rules + // is_greater_than_or_equal_to: 1 + // \endrules + // repeated ChannelFormat channel_format = 8; // Channel format. diff --git a/osi_trafficlight.proto b/osi_trafficlight.proto index 8b9dae474..4ecead3b2 100644 --- a/osi_trafficlight.proto +++ b/osi_trafficlight.proto @@ -18,6 +18,10 @@ message TrafficLight { // The ID of the traffic light. // + // \rules + // is_globally_unique + // \endrules + // optional Identifier id = 1; // The base parameters of the traffic light. @@ -60,6 +64,10 @@ message TrafficLight // // \note Set value only if traffic light bulb is a countdown counter. // + // \rules + // is_greater_than_or_equal_to: 0 + // \endrules + // optional double counter = 4; // The IDs of the lanes that the traffic light is assigned to. @@ -68,6 +76,10 @@ message TrafficLight // // \note OSI uses singular instead of plural for repeated field names. // + // \rules + // refers_to: Lane + // \endrules + // repeated Identifier assigned_lane_id = 5; // Boolean flag to indicate that the traffic light is taken out of service. diff --git a/osi_trafficsign.proto b/osi_trafficsign.proto index 882c7f308..4e78ef130 100644 --- a/osi_trafficsign.proto +++ b/osi_trafficsign.proto @@ -139,6 +139,10 @@ message TrafficSign { // The ID of the traffic sign. // + // \rules + // is_globally_unique + // \endrules + // optional Identifier id = 1; // Main sign, e.g. speed limit 30 km/h @@ -253,6 +257,10 @@ message TrafficSign // \note OSI uses singular instead of plural for repeated field // names. // + // \rules + // refers_to: Lane + // \endrules + // repeated Identifier assigned_lane_id = 5; // Some traffic signs exist in two variants that have @@ -5495,6 +5503,10 @@ message TrafficSign // \note OSI uses singular instead of plural for repeated field // names. // + // \rules + // refers_to: Lane + // \endrules + // repeated Identifier assigned_lane_id = 4; // This enumerator indicates a traffic actor (e.g. @@ -9153,6 +9165,10 @@ message TrafficSign { // The IDs of the lanes the arrow applies to // + // \rules + // refers_to: Lane + // \endrules + // repeated Identifier lane_id = 1; // The direction to which the arrow points to diff --git a/rules.yml b/rules.yml new file mode 100644 index 000000000..99c8ff5be --- /dev/null +++ b/rules.yml @@ -0,0 +1,12 @@ +is_greater_than: '\b(is_greater_than)\b: ' +is_greater_than_or_equal_to: '\b(is_greater_than_or_equal_to)\b: ' +is_less_than_or_equal_to: '\b(is_less_than_or_equal_to)\b: ' +is_less_than: '\b(is_less_than)\b: ' +is_equal_to: '\b(is_equal_to)\b: ' +is_different_to: '\b(is_different_to)\b: ' +is_globally_unique: '\b(is_globally_unique)\b' +refers_to: '\b(refers_to)\b' +is_iso_country_code: '\b(is_iso_country_code)\b' +first_element: '\b(first_element)\b' +last_element: '\b(last_element)\b' +check_if: '(\bcheck_if\b)(.*\belse do_check\b)' \ No newline at end of file