@@ -7,139 +7,6 @@ import "osi_lane.proto";
77
88package osi3 ;
99
10- //
11- // \brief A reference line for defining a non-euclidean ST coordinate system
12- //
13- // A reference line is a 3D polyline, used for generating a non-euclidean
14- // ST coordinate system.
15- //
16- // Notes on design decisions:
17- // - This is a polyline, and not some more complex curve. The advantage of a
18- // polyline is that it is very simple to generate from various map formats,
19- // and it is also easy to handle. The downside is that a polyline has no
20- // direct curvature, and even the angle is not continuous (only C0 smooth).
21- // In the author's experience, the benefits of a polyline outweigh the costs.
22- //
23- // TODO Test whether the current definition is good enough for wide roads with
24- // strong curvature (e.g. roundabouts with several lanes).
25- //
26- message ReferenceLine
27- {
28- // The ID of the logical lane.
29- //
30- // \note Note ID is global unique.
31- //
32- // \rules
33- // is_globally_unique
34- // \endrules
35- //
36- optional Identifier id = 1 ;
37-
38- // Points comprising the polyline.
39- //
40- // At least 2 points must be given.
41- // The polyline is defined as the lines between consecutive points.
42- // Each point has an S coordinate. There are a few requirements on the S
43- // position:
44- // - Later points in the list must have strictly larger S coordinates than
45- // earlier points.
46- // - For consecutive points, the S difference between them must be at
47- // least as large as the 2D euclidean distance between the points (2D
48- // distance == euclidean distance between the points taking only X and Y
49- // into account).
50- // - The S distance between two points may be larger than the 2D euclidean
51- // distance, but should be not much larger. It is allowed to be larger if
52- // the underlying reference line (e.g. in an OpenDRIVE map) is a curve,
53- // and thus the sampled reference line has a smaller length than the original
54- // curve.
55- //
56- // Together, these rules allow directly putting OpenDRIVE S coordinates
57- // into an OSI ReferenceLine.
58- //
59- // If the reference line approximates a curve (e.g. a clothoid in
60- // OpenDRIVE), the points must be chosen in a way that the lateral distance
61- // to the ideal line does not exceed 5cm. As shown in the following image:
62- //
63- // \image html line_approximation_error.svg "Approximation error"
64- // Approximation error green line.
65- //
66- // Between two ReferenceLinePoints, both the world coordinate and the S
67- // coordinate is interpolated linearly. So each S value uniquely describes
68- // a point on the polyline.
69- //
70- // For the purpose of this discussion, let's call the S position of the
71- // first point sStart, and the S position of the last point sEnd.
72- //
73- // For some purposes, S positions outside the normally defined range (i.e.
74- // outside [sStart,sEnd]) need to be defined. For this purpose, the first
75- // line of the polyline is infinitely extended in negative S direction.
76- // Similarly, the last line of the polyline is infinitely extended beyond
77- // the last point. The S value of points outside [sStart,sEnd] is defined
78- // by the euclidean 2D distance from the start or end point, respectively.
79- // So if sStart = 15, and a point is on the line extended from the start
80- // position, with a 2D euclidean distance of 10 from the first point, then
81- // it has an S position of 5.
82- //
83- // A point is "before" the reference line, if its s coordinate is < sStart.
84- // A point is "after" the reference line, if its s coordinate is > sEnd.
85- //
86- // To describe points that are not directly on the polyline, a T
87- // coordinate is added. T is the signed 2D distance (i.e. hypot(A.X-B.X,
88- // A.Y-B.Y), if A and B are the two points) between the point to describe
89- // and the nearest point on the polyline (this point might either be on a
90- // line segment or at an edge between two line segments). The distance is
91- // positive if the point is left of the polyline (in definition direction),
92- // negative if it is right of it. Note that the "nearest point on the
93- // polyline" is calculated in 3D, in order to choose the correct point for
94- // 3D curves (think reference lines for roads in parking decks). If there
95- // are several "nearest points", the one with the smallest S coordinate on
96- // the polyline is chosen.
97- //
98- // Sometimes an angle to a reference line is needed. This shall be defined
99- // as follows:
100- // First the nearest point on the polyline is determined, as described
101- // above. If this point is on a line segment, then the angle is calculated
102- // relative to the line segment on which the reference point lays.
103- // If the nearest point is at the edge between line segments, then the
104- // angle of the following line shall be chosen.
105- //
106- // Notes on OpenDRIVE compatibility:
107- // Ideally, one would want the polyline to be fully compatible with
108- // OpenDRIVE, so that calculations done for OpenDRIVE directly match those
109- // in OSI. There are a few difficulties with this:
110- // - The T coordinate is nearly the same as for OpenDRIVE, but
111- // unfortunately not perfectly. In OpenDRIVE, if the road is tilted using
112- // superElevation, then the t coordinate system is tilted along, so the T
113- // coordinate is no longer calculated in the XY plane (as proposed for
114- // OSI). It doesn't seem feasable to implement the same tilting for OSI,
115- // so simulation tools will have to consider superElevation and convert
116- // the T coordinate accordingly: t_OSI = t_OpenDRIVE * cos(alpha), where
117- // alpha is the superelevation angle.
118- // - The angle will not be perfectly the same, due to the use of line
119- // segments in OSI, and curves in OpenDRIVE. In the authors opinion, the
120- // difference will be negligible if the poly_line is suitably sampled.
121- //
122- // Notes on design decisions:
123- // - The S coordinate is included directly, both for OpenDRIVE
124- // compatibility, and to speed up calculations.
125- // - The rules on S coordinates (e.g. the calculation in 2D space) are
126- // there to ensure OpenDRIVE compatibility.
127- // - The rules on T coordinates are there to ensure OpenDRIVE compatibility
128- // for lanes without superelevation, and to make it easier to convert
129- // between OSI and OpenDRIVE in case superelevation is present.
130- //
131- repeated ReferenceLinePoint poly_line = 2 ;
132-
133- // A point on the reference line
134- message ReferenceLinePoint {
135- // A world position
136- optional Vector3d world_position = 1 ;
137-
138- // S position on the reference line
139- optional double s_position = 2 ;
140- }
141- }
142-
14310// Similar to a LaneBoundary, but with a reference and ST positions.
14411//
14512// A logical lane boundary describes the boundary between two logical lanes. As
0 commit comments