DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

planning/laneplanner/docs/usecase6.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page laneplanner_usecase6 Lane Plan Events
4 
5 @note SW Release Applicability: This tutorial is applicable to modules in **NVIDIA DRIVE Software** releases.
6 
7 There are 3 kinds of events that appear while driving along a Lane Plan:
8 
9 - Lane changes
10 - Lane splits
11 - Lane merges
12 
13 An any point on the lane plan the next appearance of each event can be queried:
14 
15 ```{.cpp}
16  dwStatus dwLanePlan_getNextLaneChange(
17  dwLanePlanIndex* laneChangePointIndex,
18  dwLanePlanLaneChange* laneChange,
19  const dwLanePlanIndex* queryPointIndex,
20  dwConstLanePlanHandle_t lanePlan);
21 
22  dwStatus dwLanePlan_getNextLaneSplit(
23  dwLanePlanIndex* laneSplitPointIndex,
24  dwLanePlanLaneSplit* laneSplit,
25  const dwLanePlanIndex* queryPointIndex,
26  dwConstLanePlanHandle_t lanePlan);
27 
28  dwStatus dwLanePlan_getNextLaneMerge(
29  dwLanePlanIndex* laneMergelanePlanIndex,
30  dwLanePlanLaneMerge* laneMerge,
31  const dwLanePlanIndex* queryPointIndex,
32  dwConstLanePlanHandle_t lanePlan);
33 ```
34 
35 ##### Lane Change
36 
37 A Lane Change is described by the lane change side in driving direction and the number of lane changes that are necessary:
38 
39 ```{.cpp}
40  typedef struct dwLanePlanLaneChange {
41  // Side towards the lane change is going.
42  dwMapsSide laneChangeSide;
43 
44  // Number of lanes that need to be changed.
45  uint32_t laneChangeCount;
46  } dwLanePlanLaneChange;
47 ```
48 
49 The exact geometry about where the lane change must happen can be extracted from the Lane Plan Segment, where the lane change happens.
50 
51 ##### Lane Split
52 
53 A Lane Split is a case where a lane has more than one outgoing connections. The exact point of the lane split is the point on the Lane Plan that corresponds to the returned laneSplitPointIndex.
54 
55 The involved lanes are described in the dwLanePlanLaneSplit struct:
56 
57 ```{.cpp}
58  typedef struct dwLanePlanLaneSplit
59  {
60  // lane that splits
61  const dwMapsLane* laneBeforeSplit;
62 
63  // list of connections leading into const the new lanes,
64  // sorted from left to right.
65  dwMapsLaneConnection* splitLanes[DW_MAPS_MAX_LANE_CONNECTIONS];
66 
67 
68  // Number of lanes emerging from
69  // the lane before the split.
70  uint32_t splitCount;
71 
72  // Index of the connection that follows the lane plan.
73  // DW_PLANNING_LANEPLANNER_INVALID_LANE_INDEX
74  // if the information is not available.
75  uint32_t splitIndex;
76  } dwLanePlanLaneSplit;
77 ```
78 
79 The key fields in this structure are:
80 
81 - laneBeforeSplit enters the lane split point.
82 - splitLanes lists all outgoing connections.
83 - splitIndex refers to the connection in that list that must be followed to stay on the Lane Plan.
84 
85 ##### Lane Merge
86 
87 A Lane Merge is a case where a lane has more than one incoming connections. The exact point where the joining lanes merge into a single lane is the point on the Lane Plan that corresponds to the returned lanePlanMergeIndex. The involved lanes in the merge are described in the `dwLanePlanLaneMerge` struct:
88 
89 ```{.cpp}
90  typedef struct dwLanePlanLaneMerge
91  {
92  //< lane into which the lanes merge.
93  const dwMapsLane* laneAfterMerge;
94 
95  //< connections leading from
96  // 'laneAfterMerge' into the
97  // merging lanes.
98  // Sorted from left to right.
99  const dwMapsLaneConnection* mergingLanes[DW_MAPS_MAX_LANE_CONNECTIONS];
100 
101  // number of merging lanes
102  uint32_t mergingLaneCount;
103 
104  // Index of the connection that connects to the lane on
105  // the lane plan. DW_ROUTPLANNER_INVALID_LANE_INDEX
106  // if the information is not available.
107  uint32_t mergingLaneIndex;
108  } dwLanePlanLaneMerge;
109 ```
110 
111 ‘laneAfterMerge’ is the lane after the merge point. All incoming connections forming the merge are listed in the ‘mergingLanes’ list, with ‘mergingLaneIndex’ referring to the connection that comes from the Lane Plan.