DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

maps/docs/usecase4.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page maps_usecase4 Map Tracker
4 
5 @note SW Release Applicability: This tutorial is applicable to modules in **NVIDIA DRIVE Software** releases.
6 
7 The Map Tracker tracks a trajectory on the map and selects the lane that corresponds to the current pose of a trajectory. The current lane is updated based on position, orientation, and time. It is chosen from a list of candidate lanes that are reachable from the lane selected in the previous update of the Tracker. Considering connectivity helps to avoid erroneously selecting crossing or nearby lanes that are not actually reachable from the previous position. If there is no previous update or if the result is bad (further away than 10 meters), the search is extended to all nearby lanes ignoring connectivity. This extended search is used only for the first frame or for recovery in case of a tracking error.
8 
9 The Map Tracker is initialized with an existing Map Handle:
10 
11 ```{.cpp}
12  dwStatus dwMapTracker_initialize(
13  dwMapTrackerHandle_t* mapTrackerHandle,
14  dwConstMapHandle_t map);
15 ```
16 The current lane is being tracked by subsequently updating the Tracker with the current position, orientation, and time. Orientation is represented as a rotation matrix that transforms from local coordinates (forward-left-up) into East-North-Up (ENU) coordinate system. For more information, see GPS and HD Maps Coordinate Systems in @ref dwx_conventions. There's a helper function `dwMaps_computeRotationFromBearing()` to create such a rotation matrix from a bearing (clockwise angle relative to north):
17 
18 ```{.cpp}
19  dwStatus dwMaps_computeRotationFromBearing(
20  dwMatrix3d* localToENURotation33,
21  float32_t bearingRadian);
22 ```
23 
24 Another helper function `dwMaps_computeBearingFromGeoPoints()` computes the bearing from 2 gps points:
25 
26 ```{.cpp}
27  dwStatus dwMaps_computeBearingFromGeoPoints(
28  float64_t* bearingRadian,
29  const dwMapsGeoPoint* position,
30  const dwMapsGeoPoint* headingPoint);
31 ```
32 
33 The tracker update also works without the orientation (a nullptr can be passed), in that case the angle against the lanes is ignored, and only distance is used when looking for the best point on the candidate lanes.
34 
35 ```{.cpp}
36  dwStatus dwMapTracker_updateWithGlobalPose(
37  const dwMapsGeoPoint* position,
38  const dwMatrix3d* localToENURotation33,
39  dwTime_t timestamp,
40  bool ignoreHeight,
41  bool reset,
42  dwMapTrackerHandle_t mapTrackerHandle);
43 ```
44 
45 If the height at the current position is not known or inaccurate, set ignoreHeight to True.
46 
47 The tracker can be reset manually, thus discarding the tracking result of the previous update. To obtain the result of the update, call:
48 
49 ```{.cpp}
50  dwStatus dwMapTracker_getCurrentLane(
51  const dwMapsLane** currentLane,
52  dwConstMapTrackerHandle_t mapTrackerHandle);
53 ```
54 
55 To identify the candidate lanes among which the current lane has been selected, call:
56 
57 ```{.cpp}
58  dwStatus dwMapTracker_getCurrentCandidateLanes(
59  dwMapsLaneBuffer* lanes,
60  dwConstMapTrackerHandle_t mapTrackerHandle);
61 ```
62 
63 For more information see @ref dwx_hd_map_access_sample .