1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page maps_mainsection Maps
5 @note SW Release Applicability: This module is available in **NVIDIA DRIVE Software** releases.
9 The maps module provides an API to access NVIDIA<sup>®</sup> DriveWorks HD maps data.
11 DriveWorks currently provides a conversion tool of HERE HD maps format into a DriveWorks map cache
12 file (XML). For more details about the tool, please refer to @ref dwx_maptool_here_to_dw_maps.
16 In DriveWorks the Map represents both geometric landmarks and semantic "payload" information that
17 is used to enable safe operation and planning for an autonomous vehicle (AV).
19 In-memory representation of a "complete map" of drivable roads is a non-goal of DriveWorks Maps.
20 It is assumed that the Map contains a relevant local scope for the vehicle, representing a fraction
21 of the full world data available from a regional, continental or global scale backend database.
23 In general, multiple Map requests may be required over the duration of a long-distance drive.
27 The Core Layer of the Map contains the basic data required for camera-only localization and short
28 to medium-range planning. This data is fully loaded in RAM as an object graph covering the full
29 extent of the requested Map.
31 - Road Segments: `dwMapsRoadSegment`
32 - Lane Groups: `dwMapsLaneGroup`
34 - Lane Divider Groups: `dwMapsLaneDividerGroup`
35 - Lane Dividers: `dwMapsLaneDivider`
36 - Features: `dwMapsFeature`
38 The basic elements are the Road Segments, all data can be accessed through them. A Road Segment
39 represents a piece of road containing several Lanes, Lane Groups, Lane Dividers, and Features.
40 Every Road Segment has an associated local ENU coordinate system defined by its WGS84 Origin.
41 Element geometries for the Road Segment are polylines of 3D points in local ENU coordinates.
43 Each Lane Group represents a "bundle" of adjacent Lanes with associated Lane Group Traversability.
44 This bitmask is used by the Lane Planner module to determine connectivity between adjacent lanes.
45 Lane Group Traversability may be determined automatically by Lane Divider Type or directly modified
46 by a server-side manual annotation or editing process.
48 For Lanes, a local polyline represents the centerline geometry of the Lane. Each Lane has pointers
49 to adjacent Lane Divider Groups, representing physical boundaries both left and right of the Lane.
50 Lane Divider Groups are contained by a parent Road Segment along with all referencing Lanes making
51 the ownership model for a Road Segment fully "self-contained".
53 Lane Dividers belonging to a Lane Divider Group are modeled by local polylines with an associated
54 Lane Divider Type. Although usually there is often a single Lane Divider at a lane boundary, there
55 are cases where Lanes are separated with multiple Lane Dividers, for example a painted solid line
56 and a physical Jersey barrier.
58 Features are a generic representation of objects encountered along the road, e.g. traffic signs,
59 traffic lights, etc. Each Feature is described by its type field and local geometry, expressed
60 like other elements in local ENU coordinates of its parent Road Segment.
64 Road Segments and Lanes have connections to predecessors and successors along the road, represented
65 by `dwMapsRoadSegmentConnection` and `dwMapsLaneConnection` structs. Lane Connections for a Lane
66 may be `next` or `previous`. This is a reflection not of driving direction, but geometry ordering.
68 A connection is represented by the ID of the connected element, and if available, a pointer to it.
69 If the connected element is currently not in memory, the pointer is a NULL. It is possible that
70 connected elements have opposite geometry directions, meaning for a `next` connection, the end of
71 a polyline connects to the end of the connected polyline (and similarly on the start side for
72 `previous` connections). The `sameDirection` boolean flag in the Lane Connection struct indicates
73 the geometry directions of connected Lanes are either matching or opposing each other.
75 Lane Groups, Lanes, Lane Dividers, Lane Divider Groups, and Features each have pointers to parents:
77 - `dwMapsLaneGroup` -> `dwMapsRoadSegment`
78 - `dwMapsLane` -> `dwMapsLaneGroup`
79 - `dwMapsLaneDivider` -> `dwMapsLaneDividerGroup`
80 - `dwMapsLaneDividerGroup` -> `dwMapsRoadSegment`
81 - `dwMapsFeature` -> `dwMapsRoadSegment`
85 As of this release there is no publicly available encoding for data specific to road junctions in
86 DriveWorks Maps. That is a feature that we are currently developing and plan to expose publicly
87 in a future DriveWorks release.
91 Road Segments, Lanes, Lane Dividers and Features have attributes specifying type and properties.
93 | Main Data Structure | Type and Properties |
94 |-------------|------------|
95 | Road Segment | Type (bridge, tunnel, etc.) |
96 | Lane | Type (shoulder, car pool, etc.) <br>Driving direction, relative to the geometry polyline |
97 | Lane Divider | Type (dashed, solid, etc.) <br>Material<br>Color |
98 | Feature | Type (traffic sign, traffic light, etc.) |
100 Lane Groups are defined such that Lane attributes are constant over the full length of all Lanes.
101 Wherever Lane or Lane Divider attributes change, that may affect the Lane Group Traversability
102 therefore a new Lane Group is required.
106 The Map Provider interface defines methods for requesting a Map according to application needs.
107 Map requests are the way clients communicate their needs for Map content to the Map Provider.
109 Each implementation of Map Provider is specialized to a particular backend Map data source.
110 Initially we provide only a basic implementation of Map Provider assuming content exists in the
111 local filesystem as a cache file (XML) or "map directory" also containing Core and Content Layers.
115 Here is an example of using the Map Provider to request a Map and query the Core Layer content:
118 // init map provider with XML cache file
119 dwMapProviderHandle_t providerHandle = DW_NULL_HANDLE;
120 dwMapProvider_initializeWithCacheFile(...);
122 // select bounds of interest
123 dwMapsBounds mapBounds{...};
125 // request a map with core layer only (no content layers)
126 // request processing occurs asynchronously on a worker thread
127 dwMapsRequestToken token{};
128 dwMapProvider_requestMapForBounds(&requestToken, &mapBounds, NULL, providerHandle);
130 // handle to the requested map
131 dwConstMapHandle mapHandle = DW_NULL_HANDLE;
133 // poll for request completion
134 dwStatus requestStatus = DW_NOT_READY;
135 while (requestStatus != DW_SUCCESS)
137 // application code needs to handle error cases
138 requestStatus = dwMapProvider_tryGetRequestedMap(&mapHandle, requestToken, providerHandle);
141 // memory for road segment query result
142 dwMapsRoadSegmentBuffer roadSegments{...};
146 // select bounds of interest
147 dwMapsBounds queryBounds{...};
150 roadSegments.size = 0;
151 dwMaps_getRoadSegments(&roadSegments, &queryBounds, ...);
154 for (uint32_t i = 0; i < roadSegments.size; ++i)
156 const dwMapsRoadSegment& roadSegment = roadSegments.buffer[i];
161 // release map back to map provider
162 dwMapProvider_releaseMap(mapHandle, providerHandle);
164 // release map provider
165 dwMapProvider_release(...);
168 ## Relevant Tutorials