DriveWorks SDK Reference 3.5.78 Release For Test and Development only
Map Tracker
Note
SW Release Applicability: This tutorial is applicable to modules in NVIDIA DRIVE Software releases.

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.

The Map Tracker is initialized with an existing Map Handle:

dwMapTrackerHandle_t* mapTrackerHandle,

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 DriveWorks Conventions. There's a helper function dwMaps_computeRotationFromBearing() to create such a rotation matrix from a bearing (clockwise angle relative to north):

dwMatrix3d* localToENURotation33,

Another helper function dwMaps_computeBearingFromGeoPoints() computes the bearing from 2 gps points:

const dwMapsGeoPoint* position,

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.

const dwMapsGeoPoint* position,
const dwMatrix3d* localToENURotation33,
dwTime_t timestamp,
bool ignoreHeight,
bool reset,
dwMapTrackerHandle_t mapTrackerHandle);

If the height at the current position is not known or inaccurate, set ignoreHeight to True.

The tracker can be reset manually, thus discarding the tracking result of the previous update. To obtain the result of the update, call:

const dwMapsLane** currentLane,
dwConstMapTrackerHandle_t mapTrackerHandle);

To identify the candidate lanes among which the current lane has been selected, call:

dwConstMapTrackerHandle_t mapTrackerHandle);