DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

planning/laneplanner/docs/usecase3.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page laneplanner_usecase3 Lane Plan
4 
5 @note SW Release Applicability: This tutorial is applicable to modules in **NVIDIA DRIVE Software** releases.
6 
7 A Lane Plan is described by the `dwLanePlan` struct:
8 
9 ```{.cpp}
10  typedef struct dwLanePlan
11  {
12  // List of segments along the lane plan.
13  const dwLanePlanSegment* segments;
14 
15  // Number segments in lane plan.
16  uint32_t segmentCount;
17  } dwLanePlan;
18 ```
19 
20 To access the dwLanePlan struct, call:
21 
22 ```{.cpp}
23  dwStatus dwLanePlan_get(
24  dwLanePlan* lanePlan,
25  dwConstLanePlanHandle_t lanePlanHandle);
26 ```
27 
28 The dwLanePlan struct is a list of Lane Plan Segments. Each Lane Plan Segment has a list of Lane Plan Lanes that describe the current lane change situation at that segment:
29 
30 ```{.cpp}
31  typedef struct dwLanePlanSegment
32  {
33  // List of lanes. The first lane in the list is the lane
34  // where the lane plan segment is entered, the last one
35  // is where the lane plan segment is exited. If there is
36  // more than one lane, lane changes must be done from the
37  // first to the last lane, traversing all in-between
38  // lanes in order.
39  const dwLanePlanLane* lanes;
40 
41  // Number of lanes in this segment. If there are more than
42  // one, it is a lane change segment.
43  uint32_t laneCount;
44 
45  // Left, right, none
46  dwMapsSide laneChangeSide;
47  } dwLanePlanSegment;
48 ```
49 
50 A Lane Plan Lane is a polyline, together with pointers to the original dwMapsLane for each point:
51 
52 ```{.cpp}
53  typedef struct dwLanePlanLane
54  {
55  // Polyline point array
56  const dwMapsGeoPoint* points;
57 
58  // Pointers to the corresponding lane (per point)
59  const dwMapsLane** pointLanes;
60 
61  // Estimated time of arrival (per point)
62  // relative to beginning of first lane of the lane plan,
63  // computed based on lane speed limits. 50 km/h is assumed
64  // if no speed limit is defined for a lane.
65  const dwTime_t* times;
66 
67  // number of points
68  uint32_t pointCount;
69  } dwLanePlanLane;
70 ```
71 
72 If the segment has only one Lane Plan Lane, then that lane must be followed. If there is more than one lane, the last lane of the list is the target lane that must be reached to follow the Lane Plan.
73 
74 Each point on a Lane Plan can be accessed through dwLanePlanIndex:
75 
76 ```{.cpp}
77  typedef struct dwLanePlanIndex
78  {
79  uint32_t segmentIndex; //!< index of a the lane plan point
80  uint32_t laneIndex; //!< index of lane in the segment
81  uint32_t pointIndex; //!< index of a point in the lane
82  // plan lane
83  } dwLanePlanIndex;
84 ```
85 
86 `dwLanePlanIndex` provides a reference into the Lane Plan defined by the segment index, the lane index on the segment, and the point index on the lane.
87 
88 The example image below shows a small Lane Plan with three segments. The first segment has two Lane Plan Lanes, the second segment has three Lane Plan Lanes due to a lane split at the end of the target lane of the first segment. The third segment shows the lane that must be followed to reach the target point (indicated by the red box). So, the first two segments describe where and how many lane changes must be executed to reach the target.
89 
90 ![](lane_plan.png)