Skip to content

Commit

Permalink
Merge pull request #778 from OpenSimulationInterface/750-define-manda…
Browse files Browse the repository at this point in the history
…tory-field-with-checker-rules

Define mandatory field with checker rules
  • Loading branch information
pmai authored Feb 26, 2024
2 parents 2466fcb + a6e0aa5 commit 41f14a3
Show file tree
Hide file tree
Showing 22 changed files with 131 additions and 3 deletions.
3 changes: 2 additions & 1 deletion doc/architecture/architecture_overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ This has been done to allow backward-compatible changes in the field.
Additionally, this is the default behavior in Protocol Buffer version 3 that no longer has the `required` type.
Setting all fields to `optional` thus ensures update compatibility.
However, this does not mean that it is optional to fill the field.
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.
Fields with the rule `is_set` are mandatory and have to be set at all times.
All other fields have to be set according to the requirements of the connected models.

NOTE: All field numbers equal to or greater than 10000 are available for user-specific extensions via custom fields.
No future evolution of OSI will therefore use field numbers equal to or greater than 10000.
4 changes: 4 additions & 0 deletions osi_detectedobject.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ message DetectedItemHeader
// Specific ID of the detected item as assigned by the sensor internally.
// Needs not to match with \c #ground_truth_id.
//
// \rules
// is_set
// \endrules
//
optional Identifier tracking_id = 1;

// The ID of the original detected item in the ground truth.
Expand Down
8 changes: 8 additions & 0 deletions osi_featuredata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ message SensorDetectionHeader
// \par Reference:
// [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.
//
// \rules
// is_set
// \endrules
//
optional MountingPosition mounting_position = 3;

// The origin/orientation of the sensor frame represents the current
Expand Down Expand Up @@ -124,6 +128,10 @@ message SensorDetectionHeader
// This ID can equal \c SensorData::sensor_id, if \c SensorData holds only
// data from one sensor/sensor model.
//
// \rules
// is_set
// \endrules
//
optional Identifier sensor_id = 7;

// The extended qualifier describes the reason (not the effect) why the
Expand Down
11 changes: 10 additions & 1 deletion osi_groundtruth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ message GroundTruth
// The interface version used by the sender (i.e. the simulation
// environment).
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

// The data timestamp of the simulation environment. The zero time point is
Expand All @@ -60,6 +64,10 @@ message GroundTruth
// (there is no inherent latency for ground truth data, as opposed to
// sensor data).
//
// \rules
// is_set
// \endrules
//
optional Timestamp timestamp = 2;

// The ID of the host vehicle object referencing to \c MovingObject .
Expand All @@ -68,6 +76,7 @@ message GroundTruth
//
// \rules
// refers_to: MovingObject
// is_set
// \endrules
//
optional Identifier host_vehicle_id = 3;
Expand Down Expand Up @@ -118,7 +127,7 @@ message GroundTruth
// [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.
//
// \rules
// is_iso_country_code:
// is_iso_country_code
// \endrules
//
optional uint32 country_code = 13;
Expand Down
1 change: 1 addition & 0 deletions osi_lane.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ message Lane
//
// \rules
// is_globally_unique
// is_set
// \endrules
//
optional Identifier id = 1;
Expand Down
4 changes: 4 additions & 0 deletions osi_logicaldetectiondata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ message LogicalDetectionData
// The interface version used by the sender (i.e. the simulation
// environment).
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

// Header attributes of fused detections from multiple sensors and sensor types.
Expand Down
1 change: 1 addition & 0 deletions osi_logicallane.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ message LogicalLaneBoundary
//
// \rules
// is_globally_unique
// is_set
// \endrules
//
optional Identifier id = 1;
Expand Down
8 changes: 8 additions & 0 deletions osi_motionrequest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ message MotionRequest
{
// The interface version used by the sender (simulation environment).
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

// The data timestamp of the simulation environment.
// A reference to \c Timestamp message.
//
// \rules
// is_set
// \endrules
//
optional Timestamp timestamp = 2;

// Define the type that is used to specify the motion request.
Expand Down
2 changes: 2 additions & 0 deletions osi_object.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ message StationaryObject
//
// \rules
// is_globally_unique
// is_set
// \endrules
//
optional Identifier id = 1;
Expand Down Expand Up @@ -388,6 +389,7 @@ message MovingObject
//
// \rules
// is_globally_unique
// is_set
// \endrules
//
optional Identifier id = 1;
Expand Down
1 change: 1 addition & 0 deletions osi_referenceline.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ message ReferenceLine
//
// \rules
// is_globally_unique
// is_set
// \endrules
//
optional Identifier id = 1;
Expand Down
4 changes: 4 additions & 0 deletions osi_roadmarking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ message RoadMarking
{
// The ID of the road marking.
//
// \rules
// is_set
// \endrules
//
optional Identifier id = 1;

// The base parameters of the road marking.
Expand Down
4 changes: 4 additions & 0 deletions osi_route.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ message Route
// \note This id must be unique within all route messages exchanged with
// one traffic participant.
//
// \rules
// is_set
// \endrules
//
optional Identifier route_id = 1;

// Route segments that form the route of an agent.
Expand Down
16 changes: 16 additions & 0 deletions osi_sensordata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ message SensorData
{
// The interface version used by the sender.
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

// The timestamp of the sensor data. Zero time is arbitrary but must be
Expand Down Expand Up @@ -129,6 +133,10 @@ message SensorData
// a dumb sensor with no internal time concept), the two timestamps might
// also be identical, but delayed from the \c GroundTruth timestamp.
//
// \rules
// is_set
// \endrules
//
optional Timestamp timestamp = 2;

// The sensors estimated location of the host vehicle
Expand Down Expand Up @@ -156,6 +164,10 @@ message SensorData
// object output; it is distinct from the IDs of its physical detectors,
// which are used in the detected features.
//
// \rules
// is_set
// \endrules
//
optional Identifier sensor_id = 5;

// The virtual mounting position of the sensor (origin and orientation
Expand Down Expand Up @@ -186,6 +198,10 @@ message SensorData
// vehicle's bounding box \c MovingObject::base . \c
// BaseMoving::orientation.
//
// \rules
// is_set
// \endrules
//
optional MountingPosition mounting_position = 6;

// The root mean squared error of the mounting position.
Expand Down
14 changes: 14 additions & 0 deletions osi_sensorview.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ message SensorView
{
// The interface version used by the sender (simulation environment).
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

// The data timestamp of the simulation environment. Zero time is arbitrary
Expand All @@ -48,6 +52,10 @@ message SensorView
// (there is no inherent latency for sensor view data, as opposed to
// sensor data).
//
// \rules
// is_set
// \endrules
//
optional Timestamp timestamp = 2;

// The ID of the sensor at host vehicle's \c #mounting_position.
Expand All @@ -58,6 +66,7 @@ message SensorView
//
// \rules
// is_globally_unique
// is_set
// \endrules
//
optional Identifier sensor_id = 3;
Expand Down Expand Up @@ -92,6 +101,10 @@ message SensorView
// vehicle's bounding box \c MovingObject::base . \c
// BaseMoving::orientation.
//
// \rules
// is_set
// \endrules
//
optional MountingPosition mounting_position = 4;

// The root mean squared error of the mounting position.
Expand Down Expand Up @@ -127,6 +140,7 @@ message SensorView
//
// \rules
// refers_to: 'MovingObject'
// is_set
// \endrules
//
optional Identifier host_vehicle_id = 8;
Expand Down
8 changes: 8 additions & 0 deletions osi_sensorviewconfiguration.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ message SensorViewConfiguration
{
// The interface version used by the sender (simulation environment).
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

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

// The virtual mounting position of the sensor (origin and orientation
Expand Down
8 changes: 8 additions & 0 deletions osi_streamingupdate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ message StreamingUpdate
{
// The interface version used by the sender.
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

// The data timestamp where the information of contained objects is calculated.
Expand All @@ -38,6 +42,10 @@ message StreamingUpdate
// Zero time does not need to coincide with the UNIX epoch.
// Recommended is the starting time point of the simulation.
//
// \rules
// is_set
// \endrules
//
optional Timestamp timestamp = 2;

// The list of stationary objects (excluding traffic signs and traffic
Expand Down
12 changes: 12 additions & 0 deletions osi_trafficcommand.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ message TrafficCommand
{
// The interface version used by the sender (scenario engine).
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

// The data timestamp of the simulation environment. Zero time is arbitrary
Expand All @@ -33,10 +37,18 @@ message TrafficCommand
// There is no inherent latency for traffic command data, as opposed
// to sensor data.
//
// \rules
// is_set
// \endrules
//
optional Timestamp timestamp = 2;

// The ID of this traffic participant.
//
// \rules
// is_set
// \endrules
//
optional Identifier traffic_participant_id = 3;

// Commanded traffic action(s) if any.
Expand Down
12 changes: 12 additions & 0 deletions osi_trafficcommandupdate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,30 @@ message TrafficCommandUpdate
{
// The interface version used by the sender (traffic participant model).
//
// \rules
// is_set
// \endrules
//
optional InterfaceVersion version = 1;

// The data timestamp of the simulation environment. Zero time is arbitrary
// but must be identical for all messages. Zero time does not need to
// coincide with the UNIX epoch. It is recommended to use zero timestamp as
// the starting time point of the simulation.
//
// \rules
// is_set
// \endrules
//
optional Timestamp timestamp = 2;

// The ID of this traffic participant which must coincide with a prior sent ID, cf.
// \c TrafficCommand::traffic_participant_id.
//
// \rules
// is_set
// \endrules
//
optional Identifier traffic_participant_id = 3;

// Actions which a traffic participant dismisses and which are not yet ended or
Expand Down
1 change: 1 addition & 0 deletions osi_trafficlight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ message TrafficLight
//
// \rules
// is_globally_unique
// is_set
// \endrules
//
optional Identifier id = 1;
Expand Down
1 change: 1 addition & 0 deletions osi_trafficsign.proto
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ message TrafficSign
//
// \rules
// is_globally_unique
// is_set
// \endrules
//
optional Identifier id = 1;
Expand Down
Loading

0 comments on commit 41f14a3

Please sign in to comment.