13.4 Repeating objects
To avoid lengthy XML code, objects of the same type may be repeated using one or more <repeat> elements.
This element is mainly used to describe railings, railing posts, and street lamps.
Each <repeat> element specifies a section of repetition that starts at a given position (using @s and @tStart) and ends after a specified length (at @s + @length and @tEnd).
Sections do not need to be adjacent and are independent of each other.
The t-coordinate for each s-coordinate between tStart and tEnd is interpolated
-
using a parametric cubic polynomial based on @tStart, @bT, @cT, and @dT if at least one of the coefficients bT, cT, and dT are provided
-
using a linear interpolation based on @tStart and @tEnd if none of the coefficients are provided
Within each section, the distance attribute defines how the object is repeated:
-
If @distance is greater than 0, an instance of the object is repeatedly placed along the specified path as many time as the specified parameters of @distance and @length allow, rounded down.
-
If @distance is set to 0, the object’s profile is instead extruded from the start to the end point, creating one continuous shape within this section. This is also called a "continuous object".
For <repeat> elements with @distance greater than 0, it is not possible or allowed to create an "incomplete" instance at the end of the provided @length attribute of the <repeat> element.
The origin of each instance placed in a section of repetition must be inside that section (including its border).
The dimensions of each instance (e.g. its bounding volume) may extend beyond that section on either end and shall not be cut off at any of the borders of the section.
The attributes of the repeated object (e.g. length, width, and height) may change within and between each section.
These changes have both a "Start" and an "End" setting (hereinafter also referred to as *Start and *End).
For example, the object attribute @width can be overwritten using @widthStart and @widthEnd.
If the attributes of the object differ from the ones defined in a <repeat> element, the <repeat> element takes precedence.
If *Start and *End have different values, the respective attribute of the object is interpolated from the start to the end of the zone of repetition.
Unless coefficients for a parametric cubic polynomial are provided, the interpolation mode is linear.
For more information on interpolation, see Calculation.
Objects with an outline or a skeleton, however, may not change their dimensions within or between sections.
By default, the repetition follows the curvature of the road reference line. If @detachFromReferenceLine is set to true, each section of repetition will instead be applied in a straight line from its start to its end position.
<repeat> elementFigure 120 shows top and side views of a large angular continuous object extruded (@distance set to 0) along the specified path using a single <repeat> element.
The repetition starts at position (@s, @tStart, @zOffsetStart) and continues for a @length to the point (@s+@length, @tEnd, @zOffsetEnd).
Its width changes from @widthStart to @widthEnd.
Its height changes from @heightStart to @heightEnd.
Since this is a continuous repetition, the @lengthStart and @lengthEnd is ignored.
<repeat> elementFigure 121 shows top and side views of several smaller angular objects that are repeated every @distance for the specified @length using a single <repeat> element.
In this example, @length divided by @distance is not an integer.
As a result, no repeated object is placed at the position at the end (@s+@length, @tEnd, @zOffsetEnd).
<repeat> elementFigure 122 shows top and side views of several smaller circular objects that are repeated every @distance for the specified @length using a single <repeat> element.
Elements in UML model
<repeat> element
In ASAM OpenDRIVE, repeating objects are represented by the <repeat> element within the <object> element.
UML class: t_road_objects_object_repeat XML tag: <repeat> (Multiplicity: 0..*)
To avoid lengthy XML code, objects of the same type may be repeated. Attributes of the repeated object shall overrule the attributes from the original object. If attributes are omitted in the repeated objects, the attributes from the original object apply.
| Name | Type | Use | Unit | Introduced | Description |
|---|---|---|---|---|---|
|
optional |
1.9.0 |
Coefficient b for t. |
||
|
optional |
1.9.0 |
Coefficient c for t. |
||
|
optional |
1.9.0 |
Coefficient d for t. |
||
|
optional |
1.8.0 |
If true, the start and end positions are connected as a straight line which does not follow the road reference line. The default is false |
||
|
required |
m |
Distance between two instances of the object; |
||
|
optional |
m |
Height of the object at @s + @length |
||
|
optional |
m |
Height of the object at @s |
||
|
optional |
m |
Length of the object at @s + @length |
||
|
optional |
m |
Length of the object at @s |
||
|
required |
Length of the repeat area, along the road reference line in s-direction. |
|||
|
optional |
m |
Radius of the object at @s + @length |
||
|
optional |
m |
Radius of the object at @s |
||
|
required |
m |
s-coordinate of start position, overrides the corresponding argument in the original |
||
|
double |
required |
m |
Lateral offset of object’s reference point at @s + @length |
|
|
double |
required |
m |
Lateral offset of objects reference point at @s |
|
|
optional |
m |
Width of the object at @s + @length |
||
|
optional |
m |
Width of the object at @s |
||
|
double |
required |
m |
z-offset of the object at @s + @length, relative to the elevation of the road reference line |
|
|
double |
required |
m |
z-offset of the object at @s, relative to the elevation of the road reference line |
XML example
<objects>
<object type="streetLamp"
name="ExampleStreetLamp"
id="2"
s="15.00"
t="5.0"
zOffset="0.0"
orientation="none"
length="0.14"
width="1.28"
height="7.35"
hdg="0.0"
pitch="0.00"
roll="0.0000">
<repeat s="15.0"
length="180.0"
distance="60.00"
tStart="5.0"
tEnd="5.0"
widthStart="1.28"
widthEnd="1.28"
heightStart="7.35"
heightEnd="7.35"
zOffsetStart="0.0"
zOffsetEnd="0.0"/>
</object>
</objects>
Calculation
The value of a linearly interpolated attribute \(a\) at a given point is calculated using the following linear function:
where
\(a(ds)\) |
is the attribute value at a given ds-position |
\(aStart\) |
is the start value of the attribute in the zone of repetition |
\(aEnd\) |
is the end value of the attribute in the zone of repetition |
\(ds\) |
is the distance along the road reference line between the start of the element and the given position |
\(length\) |
is the length of the zone of repetition |
The t-coordinate at a given s-coordinate is calculated with the following function:
where
\(t(ds)\) |
is the t-coordinate at a given ds-position |
\(tStart\) |
is the t-coordinate at the start of the zone of repetition |
\(tEnd\) |
is the t-coordinate at the end of the zone of repetition |
\(ds\) |
is the distance along the road reference line between the start of the element and the given position |
\(bT, cT, dT\) |
are coefficients for the cubic polynomial |
\(length\) |
is the length of the zone of repetition |
If coefficients are specified, \(tEnd = t(length)\) shall be true.
Rules
The following rules apply to repeating objects:
-
Parameters of the repeated object may differ from the original object.
-
Applicable parameters of the repeated object shall overrule the parameters from the original object.
-
asam.net:xodr:1.9.0:road.object.repeating.valid_s_length: Repeated objects shall have valid s-coordinates and lengths.
-
asam.net:xodr:1.9.0:road.object.repeating.outline_use_cornerlocal: Repeated objects with an outline shall use
<cornerLocal>
-
asam.net:xodr:1.9.0:road.object.repeating.no_widthstart_end_with_radius: @widthStart and @widthEnd shall not be applicable for objects where @radius is set.
-
asam.net:xodr:1.9.0:road.object.repeating.attributes_with_outline_skeleton: @lengthStart, @lengthEnd, @widthStart, @widthEnd, @heightStart, and @heightEnd shall not be applicable for objects with an
<outlines>, an<outline>, or a<skeleton>element.
-
If t is defined by a cubic polynomial, tEnd must be equal to t(length).
-
Parameters @bT, @cT, and @dT shall be considered equal to 0.0 if not explicitly provided.
Related topics