10.6 Road CRG surface
The description of the surface of a road is part of ASAM OpenCRG, not ASAM OpenDRIVE.
It is possible to reference data created by ASAM OpenCRG in ASAM OpenDRIVE.
In ASAM OpenDRIVE, the road surface is represented by the <surface>
element within the <road>
element.
Data described in ASAM OpenCRG is represented by the <CRG>
element within the <surface>
element.
Neither ASAM OpenDRIVE nor ASAM OpenCRG contain data regarding the visual representation of the road surface.

Figure 49 shows how it is possible with ASAM OpenCRG to model detailed road surface attributes, for example cobble stone or pot holes.
Besides modeling of elevation, CRG data can also be used to model detailed friction values of the road (see Section 10.6.5, “Defining friction using ASAM OpenCRG”).
As the name indicates, CRG (Curved Regular Grid) data is organized in a regular grid which is laid out along a reference line, which is comparable to ASAM OpenDRIVE’s road reference line. At each grid position, it contains the absolute elevation measured along a real road and some additional data which allows for the computation of the delta elevation relative to the reference line.

Figure 50 shows the reference line and different coordinate systems of ASAM OpenCRG.
The key to combining ASAM OpenDRIVE and CRG data is to define a correlation between the two reference lines and a rule for using the elevation data of both descriptions.

Figure 51 shows CRG data that may be offset from the ASAM OpenDRIVE road reference line using @tOffset and it may be oriented in the same or opposite direction as the layout direction of the road (see Section 10.6.2, “Switching orientation”).
10.6.1 Modes of combining ASAM OpenDRIVE and ASAM OpenCRG
The CRG data may be applied to a given ASAM OpenDRIVE road in different modes:
Mode | ASAM OpenCRG reference line | Total height | Typical use case |
---|---|---|---|
attached |
discarded |
ASAM OpenDRIVE height plus ASAM OpenCRG height |
Relative road height to road surface (including elevation, lateral profile, interpolated elevation grid, and lane height) |
attached0 |
discarded |
ASAM OpenCRG height only |
Absolute height measurement |
genuine |
shifted and rotated so beginning of reference line matches position given in ASAM OpenDRIVE |
ASAM OpenCRG height only |
Combining complete ASAM OpenCRG tracks (for example, racing tracks) with ASAM OpenDRIVE data |
global |
taken unmodified |
ASAM OpenCRG height only |
On junctions |
10.6.1.1 @mode = attached

Figure 52 shows the attachment mode attached
.
The reference line of the CRG data set is replaced with the ASAM OpenDRIVE road reference line, taking into account the @tOffset and the @sOffset parameters.
The local CRG elevation values, which are calculated by evaluating the CRG grid and applying @zOffset and @zScale, are added to the surface elevation data of the ASAM OpenDRIVE road, which are derived from the combination of elevation, superelevation and crossfall.
With this mode, the surface information relative to the original CRG data reference line is transferred from an arbitrary CRG road to an ASAM OpenDRIVE road without having to make sure that the overall geometries of the road match.
The original position, heading, curvature, elevation and superelevation of the CRG road are disregarded.
The CRG grid is evaluated along the ASAM OpenDRIVE reference line instead of the CRG reference line.

Figure 53 shows the calculation of the height.
The calculation looks as follows, assuming @orientation=same, and using the crgEvaluv2z
function from the ASAM OpenCRG C-API and a hypothetical laneHeightNoCRG
function, which returns what the lane height would be if the CRG file was not present:
10.6.1.2 @mode = attached0
This mode is the same as the attached mode, with the exception that only the CRG data elevation value is considered (that is, the ASAM OpenDRIVE elevation is set to zero).

To avoid problems, set @sStart and @sEnd exactly to the CRG data boundaries. Figure 54 shows the case when the @sStart or the @sEnd attributes are not set to the exact boundaries and therefore do not cover the CRG data boundaries. Otherwise this results in inconsistencies in the road surface.
The height calculation is very similar to attached
, again assuming @orientation=same:
10.6.1.3 @mode = genuine

Figure 55 shows the attachment mode genuine
.
The start point of the CRG data set reference line is positioned relative to the point on the ASAM OpenDRIVE road reference line at the position defined by @sStart, @sOffset and @tOffset.
By providing offset values for the longitudinal (@sOffset) and lateral (@tOffset) displacement, the heading (@hOffset) and the elevation (@zOffset), the correlation between the two descriptions reference lines is clear.
In genuine mode, the CRG data replace the ASAM OpenDRIVE elevation data, that is, the absolute elevation of a given point of the road surface is directly computed from the CRG data.
When using this method, it must be assured that the geometry of the CRG data matches – within certain tolerance – the geometry of the underlying ASAM OpenDRIVE road.
The height of a given (x,y)
position on the lane is calculated as displayed below.
The calculation uses the following helper functions:
-
st2xyh
takes ax/y
-coordinate on the road, and returns the worldx/y
-coordinate, in addition to the heading angle of the reference line at the givens
-position. -
crgEvalxy2z
is the function from the ASAM OpenCRG C API. -
REFERENCE_LINE_START_X
,REFERENCE_LINE_START_Y
andREFERENCE_LINE_START_PHI
are road parameters from the CRG file. -
sOffset
,tOffset
,hOffset
,zOffset
andzScale
are attributes from the<CRG>
element.
10.6.1.4 @mode = global
The CRG data set is referenced from a given track or a junction record but no translatory or rotatory transformation is applied.
All data in the CRG file remains in its native coordinate system.
Elevation data is interpreted as inertial data, that is, AS IS.
The ASAM OpenDRIVE height is ignored.
This can be used to define heights for junctions.
This is also the only mode that can be applied directly to <junction>
elements.
The height of a given (x,y)
position on the lane is calculated as follows:
10.6.2 Switching orientation
In modes attached
and attached0
, ASAM OpenCRG files can be rotated by 180 degrees, via the @orientation attribute:

Figure 56 shows the switching orientation states.
It is calculated as follows:
The @orientation attribute rotates the CRG file at the origin of the u/v coordinate system of the ASAM OpenCRG.
The value same
has a rotation angle of 0° and the value opposite
has a value of 180°.
The t-offset is not affected by the @orientation attribute.
10.6.3 Combining ASAM OpenCRG with superelevation
When using modes attached0
, genuine
or global
, the height of the road is determined purely based on the CRG file.
It can still be useful (and is allowed by this standard) to add <elevation>
, <superelevation>
, <height>
elements and similar to the road, to approximate the road height for tools not supporting ASAM OpenCRG.
Elements, such as |
10.6.4 Using ASAM OpenCRG on junctions
In principle, ASAM OpenCRG files can be added to junctions the same way they can be added to other roads with the help of a junction reference line or, depending on the mode, by attaching it directly to the <junction>
element, see Section 12.12, "Junction CRG surface".
|
10.6.5 Defining friction using ASAM OpenCRG
CRG files can also be used to define friction values for the roads.
To do this, set @purpose to friction
.
Friction values are calculated similarly to elevation values (see formulas above).
Rules
The following additional rules apply:
-
asam.net:xodr:1.7.0:road.crg.attach_vs_friction:
@mode=attached
shall not be used together with@purpose=friction
.
-
asam.net:xodr:1.7.0:road.crg.friction_no_z _offset_scale:
@zOffset
and@zScale
shall not be set for friction values.
The formulas are calculated as if @zOffset=0
and @zScale=1
.
That means, if a CRG file with @purpose=friction is added to a road, the values from the CRG file directly replace the friction value set via the <material>
element, see Section 11.7.2, "Lane material".
10.6.6 List of attributes and rules
Elements in UML model
<surface>
element
In ASAM OpenDRIVE, the road surface is represented by the <surface>
element within the <road>
element.
UML class: t_road_surface XML tag: <surface> (Multiplicity: 0..1)
Contains a series of elements describing a surface.
<CRG>
element
In ASAM OpenDRIVE, the CRG data is represented by the <CRG>
element within the <surface>
element.
UML class: t_road_surface_CRG XML tag: <CRG> (Multiplicity: 0..*)
Links road surface data defined according to ASAM OpenCRG format.
Name | Type | Use | Unit | Description |
---|---|---|---|---|
|
string |
required |
Name of the file containing the CRG data |
|
|
double |
optional |
rad |
Heading offset between CRG center line and reference line of the road (only allowed for mode genuine, default = 0.0). |
|
required |
Attachment mode for the surface data, see specification. |
||
|
required |
Orientation of the CRG data set relative to the parent |
||
|
optional |
Physical purpose of the data contained in the CRG file; if the attribute is missing, data will be interpreted as elevation data. |
||
|
required |
m |
End of the application of CRG |
|
|
double |
optional |
m |
s-offset between CRG center line and reference line of the road |
|
required |
m |
Start of the application of CRG data |
|
|
double |
optional |
m |
t-offset between CRG center line and reference line of the road |
|
double |
optional |
m |
z-offset between CRG center line and reference line of the road (default = 0.0). Only allowed for purpose elevation. |
|
double |
optional |
z-scale factor for the surface description (default = 1.0). Only allowed for purpose elevation. |
XML example
<surface>
<CRG file="fancyData.crg"
sStart="0.0"
sEnd="100.0"
orientation="same"
mode="attached"
tOffset="0.0" />
</surface>
|
Rules
The following rules apply to the use of CRG data in ASAM OpenDRIVE:
-
asam.net:xodr:1.7.0:road.crg.use_last_entry: If more than one CRG entry is given for the same physical property (attribute purpose) at a given location, then the last entry in the sequence of occurrence in the ASAM OpenDRIVE file shall be the relevant one. All others are ignored (but see the note).
-
asam.net:xodr:1.7.0:road.crg.junction: If a
<junction>
element contains a<CRG>
element, none of the connecting roads that belong to this junction shall have a<CRG>
element.
-
asam.net:xodr:1.7.0:road.crg.no_opposite: @orientation=opposite shall not be used for modes other than @mode=attached and @mode=attached0.
-
asam.net:xodr:1.7.0:road.crg.h_offset_only_genuine: @hOffset shall not be used for modes other than @mode=genuine.
-
asam.net:xodr:1.7.0:road.crg.s_t_offset_no_global: @sOffset and @tOffset shall not be used with @mode=global.
Related topics