DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Lane.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2019 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
31 #ifndef DW_WORLDMODEL_LANE_H_
32 #define DW_WORLDMODEL_LANE_H_
33 
49 #include <dw/core/Types.h>
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
56 typedef enum dwLaneOccupancy {
58 
63 
66 typedef enum dwLaneEdgeClass {
68 
74 
77 
79 typedef enum dwLaneEdgeColor {
81 
91 
94 
95 #define DW_LANE_EDGE_STYLE_IS_GROUP 1
96 
98 typedef enum dwLaneEdgeStyle {
100 
101  //Markings
119 
120  //Physical obstacles
131 
132  //Virtual
140 
141  //Other
145 
147 #define DW_LANE_CHUNK_SIZE_TWO_LOG 3u
148 #define DW_LANE_CHUNK_SIZE (1u << DW_LANE_CHUNK_SIZE_TWO_LOG)
149 #define DW_LANE_CHUNK_SIZE_MASK (DW_LANE_CHUNK_SIZE - 1)
150 
169 typedef struct dwLaneChunk
170 {
172 
173  // Geometry
178 
179  // Uncertainty [meters] in lateral direction
184 
185  // Uncertainty [meters] in vertical direction
190 
191  // Visibility 0-255 confidence range that left and right are visible
194 
195  // Occupancy
198 
199  // Class
204 
205  //Color
210 
211  //Style
216 
217  //Speed
220 } dwLaneChunk;
221 
222 #define DW_LANE_CHUNK_ARRAY_MAX_COUNT 2000
223 
225 typedef struct dwLaneChunkArray
226 {
227  uint32_t count;
230 
232 #define DW_LANE_IS_VEHICLE (1 << 16)
233 #define DW_LANE_IS_OTHER_ANIMATE (1 << 17)
234 #define DW_LANE_IS_VRU (1 << 18)
235 #define DW_LANE_IS_BIKE (1 << 19)
236 #define DW_LANE_IS_PEDESTRIAN (1 << 20)
237 #define DW_LANE_IS_INFRA (1 << 21)
238 #define DW_LANE_IS_SPECIAL (1 << 22)
239 
240 #define DW_LANE_VEHICLE_BASE (DW_LANE_IS_VEHICLE)
241 #define DW_LANE_SPECIAL_BASE (DW_LANE_IS_VEHICLE + DW_LANE_IS_SPECIAL)
242 #define DW_LANE_VRU_BASE (DW_LANE_IS_VRU + DW_LANE_IS_OTHER_ANIMATE)
243 #define DW_LANE_BIKE_BASE (DW_LANE_IS_BIKE + DW_LANE_VRU_BASE)
244 #define DW_LANE_PEDESTRIAN_BASE (DW_LANE_IS_PEDESTRIAN + DW_LANE_VRU_BASE)
245 #define DW_LANE_TRAIN_BASE (DW_LANE_IS_INFRA + DW_LANE_IS_OTHER_ANIMATE)
246 #define DW_LANE_ANIMAL_BASE (DW_LANE_IS_VRU + DW_LANE_IS_OTHER_ANIMATE)
247 
249 typedef enum dwLaneClass {
251 
265 
267 
269 } dwLaneClass;
270 
272 typedef enum dwLaneEndType {
274 
279 
281 } dwLaneEndType;
282 
284 typedef enum dwLaneTurnsAllowed {
286 
287  DW_LANE_TURN_LEFT = (1 << 1),
289  DW_LANE_TURN_RIGHT = (1 << 3),
290  DW_LANE_TURN_UTURN = (1 << 4),
293 
295 
296  DW_LANE_TURN_UNKNOWN = (1 << 8),
298 
299 #define DW_LANE_PREVIOUS_ID_MAX_COUNT 10
300 #define DW_LANE_CHUNK_INDICES_MAX_COUNT 500
301 
304 typedef struct dwLane
305 {
306  // Basic information
308  uint64_t currentId;
309  uint32_t previousIdCount;
310  // Matching previous lane IDs (zero=invalid)
311  uint64_t previousIds[DW_LANE_PREVIOUS_ID_MAX_COUNT];
313 
314  // Class
319 
321 
324 
325  // Chunks with geometry and detailed information
326  uint32_t vertexCount;
327  uint32_t chunkCount;
328  uint32_t chunkIndices[DW_LANE_CHUNK_INDICES_MAX_COUNT];
329 } dwLane;
330 
331 #define DW_LANE_ARRAY_MAX_COUNT 200U
332 
334 typedef struct dwLaneArray
335 {
336  uint32_t count;
338  uint32_t egoIndex; // best guess of what ego lane is
339 } dwLaneArray;
340 
341 #define DW_LANE_CONTINUATIONS_MAX_COUNT 16U
342 
345 typedef struct dwLaneContinuation
346 {
347  uint32_t count;
348  uint32_t continuations[DW_LANE_CONTINUATIONS_MAX_COUNT];
350 
355 {
356  uint32_t count;
359 
361 typedef struct dwLaneSegment
362 {
363  bool isValid;
364  uint32_t laneIndex;
365  uint32_t entryVertex;
367  uint32_t exitVertex;
371 } dwLaneSegment;
372 
373 #define DW_PATH_SEGMENT_MAX_COUT 8U
374 
377 typedef struct dwPathSegment
378 {
379  uint32_t count; //Number of lanes referenced by the path segment
380  uint32_t laneIndices[DW_PATH_SEGMENT_MAX_COUT]; //array of lane indices into dwLaneArray
381  uint32_t entryVertex;
383  uint32_t exitVertex;
387 } dwPathSegment;
388 
390 typedef struct dwLaneVertex
391 {
392  bool isValid;
393  uint32_t laneIndex;
394  uint32_t vertex;
395 } dwLaneVertex;
396 
398 typedef struct dwLaneChange
399 {
400  // Basic information
402  uint64_t id;
403 
404  // path segments involved
407 } dwLaneChange;
408 
409 #define DW_LANE_CHANGE_ARRAY_MAX_COUNT 20U
410 
412 typedef struct dwLaneChangeArray
413 {
414  uint32_t count;
417 
419 typedef enum dwLaneRelationType {
422 
425 
428 
431 
434 
438 
440 typedef struct dwLaneRelation
441 {
446 
447 #define DW_LANE_RELATION_ARRAY_MAX_COUNT 20
448 
450 typedef struct dwLaneRelationArray
451 {
452  uint32_t count;
455 
456 #ifdef __cplusplus
457 }
458 #endif
459 
462 #endif // DW_WORLDMODEL_LANE_H_
#define DW_LANE_RELATION_ARRAY_MAX_COUNT
Definition: Lane.h:447
Diagonal right allowed.
Definition: Lane.h:292
uint32_t laneIndex
lane index into dwLaneArray
Definition: Lane.h:393
Shoulder, not a real lane.
Definition: Lane.h:260
Short dashed line, by itself.
Definition: Lane.h:104
Such as square reflex, part of group.
Definition: Lane.h:111
dwConfidence1f leftVerticalConfidence
Definition: Lane.h:187
animal crossing
Definition: Lane.h:266
NVIDIA DriveWorks API: Core Types
uint32_t vertex
vertex index referencing vertices of lane
Definition: Lane.h:394
float float32_t
Specifies POD types.
Definition: Types.h:70
#define DW_PATH_SEGMENT_MAX_COUT
Definition: Lane.h:373
dwPathSegment startSegment
Definition: Lane.h:405
uint8_t rightClassConfidence[DW_LANE_CHUNK_SIZE]
Right classification 0-255 confidence.
Definition: Lane.h:203
uint32_t count
Definition: Lane.h:379
Such as square reflex, by itself.
Definition: Lane.h:110
uint8_t visibilityConfidenceRight[DW_LANE_CHUNK_SIZE]
Visibility confidence right.
Definition: Lane.h:193
uint32_t previousIdCount
Number of previous IDs in below array.
Definition: Lane.h:309
Other type of marking, by itself.
Definition: Lane.h:116
Straight ahead allowed.
Definition: Lane.h:288
uint8_t rightColor[DW_LANE_CHUNK_SIZE]
Right color.
Definition: Lane.h:207
bool isValid
Whether lane segment is valid.
Definition: Lane.h:363
dwLaneSegment first
Definition: Lane.h:442
uint64_t currentId
Lane ID for tracking purposes.
Definition: Lane.h:308
float32_t confidence
Confidence that lane exists.
Definition: Lane.h:312
Defines a three-element floating-point vector.
Definition: Types.h:319
Lanes only for buses.
Definition: Lane.h:256
Diagonal left allowed.
Definition: Lane.h:291
Lane for prioritized vehicles.
Definition: Lane.h:253
float32_t exitFraction
[-1, 1]
Definition: Lane.h:370
dwTime_t timestamp_us
Timestamp.
Definition: Lane.h:171
dwLaneEdgeColor
Edge color, mutually exclusive. Describes the first encountered from inside lane. ...
Definition: Lane.h:79
Right allowed.
Definition: Lane.h:289
dwVector3f right[DW_LANE_CHUNK_SIZE]
Right (inner) edge of lane.
Definition: Lane.h:176
uint8_t rightStyle[DW_LANE_CHUNK_SIZE]
Right style.
Definition: Lane.h:213
Virtual during split to left.
Definition: Lane.h:134
Regular vehicle lane.
Definition: Lane.h:252
Virtual with adjacent parking.
Definition: Lane.h:138
dwLaneTurnsAllowed
The turn restrictions on a dwLane.
Definition: Lane.h:284
dwConfidence1f leftLateralConfidence
Definition: Lane.h:181
uint32_t count
Definition: Lane.h:336
uint8_t leftClassConfidence[DW_LANE_CHUNK_SIZE]
Left classification 0-255 confidence.
Definition: Lane.h:202
dwLaneEndType
The type of lane dwLane begins and end.
Definition: Lane.h:272
invalid class
Definition: Lane.h:273
#define DW_LANE_CHUNK_INDICES_MAX_COUNT
Definition: Lane.h:300
float32_t entryFraction
[-1, 1], e.g.
Definition: Lane.h:382
uint64_t id
ID for tracking purposes (zero is invalid)
Definition: Lane.h:402
uint32_t egoIndex
Definition: Lane.h:338
Describes lane change availability between two lane segments.
Definition: Lane.h:398
dwVector3f center[DW_LANE_CHUNK_SIZE]
Center of lane suggested to follow.
Definition: Lane.h:174
Two are joining at some point.
Definition: Lane.h:430
A relation container.
Definition: Lane.h:450
Cannot see past the end.
Definition: Lane.h:277
dwTime_t timestamp_us
Timestamp.
Definition: Lane.h:307
Forward/Next connecting lanes of a lane in the dwLaneArray A lane may continue to zero...
Definition: Lane.h:345
Our strategy for uncertainty representation is to give classification confidence scalars for classifi...
Definition: Types.h:510
uint32_t chunkCount
Number of chunks in the array.
Definition: Lane.h:327
#define DW_LANE_PEDESTRIAN_BASE
Definition: Lane.h:244
dwConfidence1f centerLateralConfidence
Definition: Lane.h:180
Two are forking apart at some point.
Definition: Lane.h:433
dwTime_t timestamp_us
Timestamp.
Definition: Lane.h:401
uint32_t count
Definition: Lane.h:227
uint8_t leftStyleConfidence[DW_LANE_CHUNK_SIZE]
Style 0-255 confidence.
Definition: Lane.h:214
Unmarked.
Definition: Lane.h:294
#define DW_LANE_CHUNK_ARRAY_MAX_COUNT
Definition: Lane.h:222
Invalid occupancy class.
Definition: Lane.h:57
dwLaneEndType beginType
Information about how a lane begins (first vertex)
Definition: Lane.h:322
Curb, such as transition to sidewalk.
Definition: Lane.h:123
uint8_t rightStyleConfidence[DW_LANE_CHUNK_SIZE]
Style 0-255 confidence.
Definition: Lane.h:215
uint32_t count
Definition: Lane.h:414
Rumble strip, by itself.
Definition: Lane.h:114
#define DW_LANE_PREVIOUS_ID_MAX_COUNT
Definition: Lane.h:299
The lane chunks hold a fixed number of vertices.
Definition: Lane.h:169
dwConfidence1f normalSidewayConfidence
Definition: Lane.h:183
Is unoccupied.
Definition: Lane.h:60
The main data structure, holds or refers to the core information, such as the left or right inner edg...
Definition: Lane.h:304
dwConfidence1f normalForwardConfidence
Definition: Lane.h:189
Virtual during split to right.
Definition: Lane.h:135
dwPathSegment endSegment
Definition: Lane.h:406
Two segments are corresponding.
Definition: Lane.h:436
No relation/invalid.
Definition: Lane.h:421
Continues but is at the end of local scope.
Definition: Lane.h:278
Curb, such as drivable into driveway.
Definition: Lane.h:124
Solid line, part of group.
Definition: Lane.h:103
Physical vertical bars.
Definition: Lane.h:129
Described a vertex in a dwLane object.
Definition: Lane.h:390
No information.
Definition: Lane.h:142
A path segment composed of continues dwLane objects, lanes are by referenced by the lane indices in t...
Definition: Lane.h:377
dwLaneEdgeClass
Edge main classes.
Definition: Lane.h:66
A lane chunk container.
Definition: Lane.h:225
uint8_t leftColorConfidence[DW_LANE_CHUNK_SIZE]
Color 0-255 confidence.
Definition: Lane.h:208
Center left turn lane.
Definition: Lane.h:254
Describes the relationship between a pair of lane segments.
Definition: Lane.h:440
Vertical wall.
Definition: Lane.h:128
float32_t exitFraction
[-1, 1]
Definition: Lane.h:386
invalid
Definition: Lane.h:285
float32_t officialSpeed_mps
Official speed limit in meters/second.
Definition: Lane.h:218
pedestrian crossing or path
Definition: Lane.h:263
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
dwLaneRelationType
Types of relationship between a pair of lane segments.
Definition: Lane.h:419
Other than above categories.
Definition: Lane.h:143
Curb, intended for pedestrian entry.
Definition: Lane.h:125
invalid class
Definition: Lane.h:250
uint8_t leftClass[DW_LANE_CHUNK_SIZE]
Left class.
Definition: Lane.h:200
Virtual during intersection.
Definition: Lane.h:133
uint8_t occupancy[DW_LANE_CHUNK_SIZE]
Definition: Lane.h:196
dwVector3f normal[DW_LANE_CHUNK_SIZE]
Unit surface normal at center.
Definition: Lane.h:177
Other type of marking, part of group.
Definition: Lane.h:117
dwLaneSegment second
Definition: Lane.h:443
dwLaneRelationType type
Definition: Lane.h:444
Continues (for example because vehicle lane changes into divider lane)
Definition: Lane.h:424
uint8_t leftColor[DW_LANE_CHUNK_SIZE]
Left color.
Definition: Lane.h:206
uint32_t count
Definition: Lane.h:347
dwLaneEndType endType
Information about how a lane ends (last vertex)
Definition: Lane.h:323
uint8_t visibilityConfidenceLeft[DW_LANE_CHUNK_SIZE]
Visibility confidence left.
Definition: Lane.h:192
Ends in the real world (stub)
Definition: Lane.h:275
uint8_t rightClass[DW_LANE_CHUNK_SIZE]
Right class.
Definition: Lane.h:201
dwLaneEdgeStyle
Edge style, mutually exclusive. Describes the first encountered from inside lane. ...
Definition: Lane.h:98
Rumble strip, part of group.
Definition: Lane.h:115
A lane container.
Definition: Lane.h:334
dwConfidence1f rightVerticalConfidence
Definition: Lane.h:188
Shared bi-directional lane.
Definition: Lane.h:255
#define DW_LANE_ANIMAL_BASE
Definition: Lane.h:246
lane undefined type
Definition: Lane.h:268
Unknown.
Definition: Lane.h:280
dwConfidence1f centerVerticalConfidence
Definition: Lane.h:186
Two intersect at a point.
Definition: Lane.h:427
Is occupied.
Definition: Lane.h:61
uint32_t laneIndex
lane index into dwLaneArray
Definition: Lane.h:364
Zig-zag line, by itself.
Definition: Lane.h:112
Solid line, by itself.
Definition: Lane.h:102
Such as Botts dot, by itself.
Definition: Lane.h:108
Changes (such as from vehicle lane to divider)
Definition: Lane.h:276
Zig-zag line, part of group.
Definition: Lane.h:113
uint32_t entryVertex
entry point vertex index referencing vertices of first lane, i.e laneIndices[0]
Definition: Lane.h:381
#define DW_LANE_ARRAY_MAX_COUNT
Definition: Lane.h:331
uint8_t rightColorConfidence[DW_LANE_CHUNK_SIZE]
Color 0-255 confidence.
Definition: Lane.h:209
float32_t commonSpeed_mps
Commonly used (de-facto) speed in meters/sec.
Definition: Lane.h:219
Virtual during merge to right.
Definition: Lane.h:137
dwConfidence1f rightLateralConfidence
Definition: Lane.h:182
#define DW_LANE_BIKE_BASE
Definition: Lane.h:243
Transition of material, grass, gravel.
Definition: Lane.h:121
Unknown.
Definition: Lane.h:296
#define DW_LANE_CHANGE_ARRAY_MAX_COUNT
Definition: Lane.h:409
float32_t classConfidence
Classification confidence.
Definition: Lane.h:316
U-turn allowed.
Definition: Lane.h:290
uint32_t entryVertex
entry point vertex index referencing vertices of lane
Definition: Lane.h:365
Such as Botts dot, part of group.
Definition: Lane.h:109
dwLaneOccupancy
Lane occupancy, indicating if we know whether there is another actor in a certain portion of lane...
Definition: Lane.h:56
Not blocked, but not for driving.
Definition: Lane.h:261
Lanes only for taxis.
Definition: Lane.h:257
#define DW_LANE_CONTINUATIONS_MAX_COUNT
Definition: Lane.h:341
train or tram line
Definition: Lane.h:264
uint8_t occupancyConfidence[DW_LANE_CHUNK_SIZE]
0-255 Occupancy confidence
Definition: Lane.h:197
float32_t entryFraction
[-1, 1], e.g.
Definition: Lane.h:366
A lane change container.
Definition: Lane.h:412
dwVector3f left[DW_LANE_CHUNK_SIZE]
Left (inner) edge of lane.
Definition: Lane.h:175
#define DW_LANE_VEHICLE_BASE
Definition: Lane.h:240
dwLaneClass
Classification of lanes.
Definition: Lane.h:249
#define DW_LANE_TRAIN_BASE
Definition: Lane.h:245
Virtual during merge to left.
Definition: Lane.h:136
uint8_t leftStyle[DW_LANE_CHUNK_SIZE]
Left style.
Definition: Lane.h:212
#define DW_LANE_CHUNK_SIZE
Definition: Lane.h:148
bool bidirectional
Has corresponding path in the opposite direction.
Definition: Lane.h:318
Lanes only for loading/unloading.
Definition: Lane.h:258
Left turn allowed.
Definition: Lane.h:287
Short dashed line, part of group.
Definition: Lane.h:105
A segment of a dwLane object, by referenced by the id and point indices.
Definition: Lane.h:361
Specifies forward connecting lanes for all the lanes in the dwLaneArray.
Definition: Lane.h:354
#define DW_LANE_SPECIAL_BASE
Definition: Lane.h:241
bool isValid
Whether lane vertex is valid.
Definition: Lane.h:392
uint32_t count
Definition: Lane.h:452
dwLaneClass laneClass
Lane class.
Definition: Lane.h:315
Different direction at different times.
Definition: Lane.h:259
bike lane or bike crossing
Definition: Lane.h:262
May be occupied, may not be.
Definition: Lane.h:59
float32_t subclassConfidence
Subclassification confidence.
Definition: Lane.h:317
dwLaneTurnsAllowed turnsAllowed
Information about future turns allowed.
Definition: Lane.h:320
Gore area.
Definition: Lane.h:118
uint32_t vertexCount
Number of vertices.
Definition: Lane.h:326