From b9d108b1176d2fce1c33fb25d62fc560ae5adf23 Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Fri, 22 Dec 2023 10:14:47 +0100 Subject: [PATCH 01/10] Added draft for traffic rule and speed limit. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 117 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index e55437011..8bea2a9c5 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -3,6 +3,7 @@ syntax = "proto2"; option optimize_for = SPEED; import "osi_common.proto"; +import "osi_object.proto"; package osi3; @@ -587,6 +588,10 @@ message LogicalLane // optional string street_name = 16; + // A list of traffic rules on the lane. + // + repeated TrafficRule traffic_rule = 17; + // // Definition of available lane types. // @@ -822,5 +827,117 @@ message LogicalLane // optional double end_s_other = 5; } + + // + // Describes traffic rules on a lane. + // The traffic rule can thereby induced by regulations, traffic signs + // or by other means. If the modeled traffic rule is induced by a traffic sign + // the information should be identical with the respective traffic sign. + // + // Note: Every instance should be corresponding to only one specific rule. + // The type of the traffic rule should be set using the respective filed. + // Additionally, every message should contain the traffic rule validity information + // and the respective field for the respective traffic rule type. + // + // Note: Each traffic rule corresponds to only one lane. If the traffic rule + // is also valid on adjacent/successing/predecessing lanes it needs to be + // specified for each lane individually. + // + // \brief Logical Model of a traffic rule on a lane. + // + message TrafficRule { + + // The type of the traffic rule. + // + // This specifies the type of the traffic rule to be modeled. + // Based on the type the respective message containing the information + // corresponding to the traffic rule should be filled. + // + optional TrafficRuleType traffic_rule_type = 1; + + // The validity information of the traffic rule. + // + optional TrafficRuleValidity traffic_rule_validity = 2; + + // Traffic rule information for traffic rule of type speed limit. + // + optional SpeedLimit speed_limit = 3; + + // + // The type of the the traffic rule. + // + enum TrafficRuleType { + + // Traffic rule is of type speed limit + // + TRAFFIC_RULE_TYPE_SPEED_LIMIT = 0; + } + + // + // \brief Validity information for a traffic rule. + // + message TrafficRuleValidity { + + // + // The starting point of the traffic rule validity on the lane. + // Must be in range [\c sStart,\c sEnd] of the reference line. + // + optional double start_s = 1; + + // + // The ending point of the traffic rule validity on the lane. + // Must be in range [\c sStart,\c sEnd] of the reference line. + // Note: Should always be greater than the starting point. + // + optional double end_s = 2; + + // + // List of vehicle types for which the speed limit is valid. + // If the traffic rule validity is independent of the vehicle type + // the list should be empty. + // + repeated MovingObject.VehicleClassification.Type valid_for_type = 3; + } + + // + // \brief Speed limit on a lane. + // + message SpeedLimit { + + // + // The speed limit in the unit specified by the respective files + // + optional double speed_limit = 1; + + // + // The unit in which the speed limit is specified. + // + optional Unit speed_limit_unit = 2; + + // Unit of the specified speed limit. + // + enum Unit + { + // Meters per second. + // + // Unit: km/h + // + UNIT_METER_PER_SECOND = 1; + + // Kilometers per hour. + // + // Unit: km/h + // + UNIT_KILOMETER_PER_HOUR = 2; + + // Miles per hour. + // + // Unit: mph + // + UNIT_MILE_PER_HOUR = 3; + } + } + } + } From be43ed87471b24585c373ad40044192e63270529 Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Fri, 2 Feb 2024 14:14:53 +0100 Subject: [PATCH 02/10] Fixed enumerations. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index 8bea2a9c5..968e5db5f 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -870,7 +870,7 @@ message LogicalLane // Traffic rule is of type speed limit // - TRAFFIC_RULE_TYPE_SPEED_LIMIT = 0; + TRAFFIC_RULE_TYPE_SPEED_LIMIT = 1; } // @@ -920,7 +920,7 @@ message LogicalLane { // Meters per second. // - // Unit: km/h + // Unit: m/s // UNIT_METER_PER_SECOND = 1; From 6dfc814f057ef4297f35f43ff7a0019356af1613 Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Fri, 2 Feb 2024 14:25:58 +0100 Subject: [PATCH 03/10] Improved documentation. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index 968e5db5f..be21ad5e1 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -838,6 +838,9 @@ message LogicalLane // The type of the traffic rule should be set using the respective filed. // Additionally, every message should contain the traffic rule validity information // and the respective field for the respective traffic rule type. + // In case of traffic rule (priority) conflicts for rules of the same type that + // can not be depicted using the traffic rule validity only the currently + // valid rule should be provided. // // Note: Each traffic rule corresponds to only one lane. If the traffic rule // is also valid on adjacent/successing/predecessing lanes it needs to be From b9535300b45990ab218492d63a8916da8319d69e Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Tue, 6 Feb 2024 09:01:47 +0100 Subject: [PATCH 04/10] Changes enums to start with 0. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index be21ad5e1..30bee06d6 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -873,7 +873,7 @@ message LogicalLane // Traffic rule is of type speed limit // - TRAFFIC_RULE_TYPE_SPEED_LIMIT = 1; + TRAFFIC_RULE_TYPE_SPEED_LIMIT = 0; } // @@ -925,19 +925,19 @@ message LogicalLane // // Unit: m/s // - UNIT_METER_PER_SECOND = 1; + UNIT_METER_PER_SECOND = 0; // Kilometers per hour. // // Unit: km/h // - UNIT_KILOMETER_PER_HOUR = 2; + UNIT_KILOMETER_PER_HOUR = 1; // Miles per hour. // // Unit: mph // - UNIT_MILE_PER_HOUR = 3; + UNIT_MILE_PER_HOUR = 2; } } } From c3f987fb8d3970d92608e3456bc244707cfa91f7 Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Thu, 22 Feb 2024 09:18:31 +0100 Subject: [PATCH 05/10] Fixed typos. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index 30bee06d6..ad219dfa0 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -830,12 +830,12 @@ message LogicalLane // // Describes traffic rules on a lane. - // The traffic rule can thereby induced by regulations, traffic signs + // The traffic rule can thereby be induced by regulations, traffic signs // or by other means. If the modeled traffic rule is induced by a traffic sign // the information should be identical with the respective traffic sign. // // Note: Every instance should be corresponding to only one specific rule. - // The type of the traffic rule should be set using the respective filed. + // The type of the traffic rule should be set using the respective field. // Additionally, every message should contain the traffic rule validity information // and the respective field for the respective traffic rule type. // In case of traffic rule (priority) conflicts for rules of the same type that From 2c7ce0ea9e1d42088675f96157d11fcd21a370bd Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Wed, 13 Mar 2024 17:33:00 +0100 Subject: [PATCH 06/10] Modified type and speed limit value as discussed in CCB meeting. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 61 +++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index ad219dfa0..cb41e57e4 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -4,6 +4,7 @@ option optimize_for = SPEED; import "osi_common.proto"; import "osi_object.proto"; +import "osi_trafficsign.proto"; package osi3; @@ -895,51 +896,53 @@ message LogicalLane optional double end_s = 2; // - // List of vehicle types for which the speed limit is valid. + // List of traffic participan types for which the speed limit is valid. // If the traffic rule validity is independent of the vehicle type // the list should be empty. // - repeated MovingObject.VehicleClassification.Type valid_for_type = 3; - } - - // - // \brief Speed limit on a lane. - // - message SpeedLimit { + repeated TypeValidity valid_for_type = 3; // - // The speed limit in the unit specified by the respective files + // \brief Type of traffic paricipant for which a rule is valid. // - optional double speed_limit = 1; + message TypeValidity { - // - // The unit in which the speed limit is specified. - // - optional Unit speed_limit_unit = 2; - - // Unit of the specified speed limit. - // - enum Unit - { - // Meters per second. // - // Unit: m/s + // The type of objects for which the traffic rule applys. + // Must not be UNKNOWN or OTHER // - UNIT_METER_PER_SECOND = 0; - - // Kilometers per hour. + optional MovingObject.Type type = 1; + // - // Unit: km/h + // Vehicle classification type for trafic participants + // May only be set if type is TYPE_VEHICLE. Must not be UNKNOWN or OTHER. // - UNIT_KILOMETER_PER_HOUR = 1; + optional MovingObject.VehicleClassification.Type vehicle_type = 2; - // Miles per hour. // - // Unit: mph + // Role of traffic participant. + // May only be set if type is TYPE_VEHICLE. Must not be UNKNOWN or OTHER. // - UNIT_MILE_PER_HOUR = 2; + optional MovingObject.VehicleClassification.Role vehicle_role = 3; } } + + // + // \brief Speed limit on a lane. + // + message SpeedLimit { + + // + // The value of the speed limit. + // The unit filed in the TrafficSigneValue message may only be set to + // units associated with velocities and must not be UNKNOWN or OTHER. + // + // Note: All speed limits are to be modelled this way, indpendent + // of how they are induced. + // + optional TrafficSignValue speed_limit_value = 1; + + } } } From c9e4b46a0517b425df5d1b76f0f43a44eb69ea32 Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Thu, 14 Mar 2024 08:21:15 +0100 Subject: [PATCH 07/10] Fixed spelling issues. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index cb41e57e4..87e3bd942 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -844,7 +844,7 @@ message LogicalLane // valid rule should be provided. // // Note: Each traffic rule corresponds to only one lane. If the traffic rule - // is also valid on adjacent/successing/predecessing lanes it needs to be + // is also valid on adjacent/successor/predecessor lanes it needs to be // specified for each lane individually. // // \brief Logical Model of a traffic rule on a lane. @@ -896,25 +896,25 @@ message LogicalLane optional double end_s = 2; // - // List of traffic participan types for which the speed limit is valid. + // List of traffic participant types for which the speed limit is valid. // If the traffic rule validity is independent of the vehicle type // the list should be empty. // repeated TypeValidity valid_for_type = 3; // - // \brief Type of traffic paricipant for which a rule is valid. + // \brief Type of traffic participant for which a rule is valid. // message TypeValidity { // - // The type of objects for which the traffic rule applys. + // The type of object for which the traffic rule is valid. // Must not be UNKNOWN or OTHER // optional MovingObject.Type type = 1; // - // Vehicle classification type for trafic participants + // Vehicle classification type for traffic participants // May only be set if type is TYPE_VEHICLE. Must not be UNKNOWN or OTHER. // optional MovingObject.VehicleClassification.Type vehicle_type = 2; @@ -934,10 +934,10 @@ message LogicalLane // // The value of the speed limit. - // The unit filed in the TrafficSigneValue message may only be set to + // The unit filed in the TrafficSignValue message may only be set to // units associated with velocities and must not be UNKNOWN or OTHER. // - // Note: All speed limits are to be modelled this way, indpendent + // Note: All speed limits are to be led this way, independent // of how they are induced. // optional TrafficSignValue speed_limit_value = 1; From 2b2122bbac5d5dc5894d3023f46cffd4ca4d3143 Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Mon, 25 Mar 2024 09:57:19 +0100 Subject: [PATCH 08/10] Fixed spelling issues. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index 87e3bd942..aa06f4f0c 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -934,7 +934,7 @@ message LogicalLane // // The value of the speed limit. - // The unit filed in the TrafficSignValue message may only be set to + // The unit field in the TrafficSignValue message may only be set to // units associated with velocities and must not be UNKNOWN or OTHER. // // Note: All speed limits are to be led this way, independent From 939daa6a7830d1e44a0cc379f7c1f84d1227566e Mon Sep 17 00:00:00 2001 From: Markus Lemmer Date: Mon, 25 Mar 2024 11:06:30 +0100 Subject: [PATCH 09/10] Adjusted documentation for type validty. Signed-off-by: Markus Lemmer --- osi_logicallane.proto | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index aa06f4f0c..3bdee257e 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -909,19 +909,20 @@ message LogicalLane // // The type of object for which the traffic rule is valid. - // Must not be UNKNOWN or OTHER // optional MovingObject.Type type = 1; // // Vehicle classification type for traffic participants - // May only be set if type is TYPE_VEHICLE. Must not be UNKNOWN or OTHER. + // Should be set to UNKNOWN if type is not TYPE_VEHICLE or the rule + // is valid for all vehicle types. // optional MovingObject.VehicleClassification.Type vehicle_type = 2; // // Role of traffic participant. - // May only be set if type is TYPE_VEHICLE. Must not be UNKNOWN or OTHER. + // Should be set to UNKNOWN if type is not TYPE_VEHICLE or the rule + // is valid for all vehicle roles. // optional MovingObject.VehicleClassification.Role vehicle_role = 3; } @@ -935,9 +936,9 @@ message LogicalLane // // The value of the speed limit. // The unit field in the TrafficSignValue message may only be set to - // units associated with velocities and must not be UNKNOWN or OTHER. + // units associated with velocities and must not be UNKNOWN. // - // Note: All speed limits are to be led this way, independent + // Note: All speed limits are to be modeled this way, independent // of how they are induced. // optional TrafficSignValue speed_limit_value = 1; From e41415ea83b8c731bef59aac11c8e761261f4549 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Thu, 4 Apr 2024 12:08:11 +0200 Subject: [PATCH 10/10] Apply suggestions from code review, formatting fixes Signed-off-by: Pierre R. Mai --- osi_logicallane.proto | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/osi_logicallane.proto b/osi_logicallane.proto index 3bdee257e..fc5d9f86a 100644 --- a/osi_logicallane.proto +++ b/osi_logicallane.proto @@ -886,12 +886,19 @@ message LogicalLane // The starting point of the traffic rule validity on the lane. // Must be in range [\c sStart,\c sEnd] of the reference line. // + // Note: The traffic rule applies only to traffic with notional + // direction of travel from the start_s coordinate towards + // the end_s coordinate. For unidirectional lanes this must + // match the direction of travel as specified by the + // move_direction field of the logical lane. For bidirectional + // lanes this allows the specification of separate rules for + // each direction of travel. + // optional double start_s = 1; // // The ending point of the traffic rule validity on the lane. // Must be in range [\c sStart,\c sEnd] of the reference line. - // Note: Should always be greater than the starting point. // optional double end_s = 2; @@ -913,16 +920,18 @@ message LogicalLane optional MovingObject.Type type = 1; // - // Vehicle classification type for traffic participants - // Should be set to UNKNOWN if type is not TYPE_VEHICLE or the rule - // is valid for all vehicle types. + // Vehicle classification type for traffic participants. + // + // Should be set to TYPE_UNKNOWN if type is not TYPE_VEHICLE + // or the rule is valid for all vehicle types. // optional MovingObject.VehicleClassification.Type vehicle_type = 2; // // Role of traffic participant. - // Should be set to UNKNOWN if type is not TYPE_VEHICLE or the rule - // is valid for all vehicle roles. + // + // Should be set to ROLE_UNKNOWN if type is not TYPE_VEHICLE + // or the rule is valid for all vehicle roles. // optional MovingObject.VehicleClassification.Role vehicle_role = 3; }