DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Map Tracker

Detailed Description

Keep track of the current lane.

The map tracker allows to robustly query the current lane. The map tracker is subsequently updated with the current pose, and can then be queried for the current lane. This is more robust than just requesting the closest lane, as it takes into account the angle relative to a lane and lane connections, discarding lanes that are close but cannot be accessed.

Typedefs

typedef struct dwMapTrackerObject const * dwConstMapTrackerHandle_t
 
typedef struct dwMapTrackerObject * dwMapTrackerHandle_t
 

Functions

DW_API_PUBLIC dwStatus dwMapTracker_getCurrentCandidateLanes (dwMapsLaneBuffer *lanes, dwConstMapTrackerHandle_t mapTrackerHandle)
 Get current lane candidates that have been used to find the current lane. More...
 
DW_API_PUBLIC dwStatus dwMapTracker_getCurrentLane (const dwMapsLane **currentLane, dwConstMapTrackerHandle_t mapTrackerHandle)
 Get current lane that has been evaluated in the last update. More...
 
DW_API_PUBLIC dwStatus dwMapTracker_initialize (dwMapTrackerHandle_t *mapTrackerHandle, dwConstMapHandle_t map)
 Creates a map tracker handle that allows to track a pose on a map. More...
 
DW_API_PUBLIC dwStatus dwMapTracker_release (dwMapTrackerHandle_t mapTrackerHandle)
 Release map tracker handle. More...
 
DW_API_PUBLIC dwStatus dwMapTracker_updateWithGlobalPose (const dwMapsGeoPoint *position, const dwMatrix3d *localToENURotation33, dwTime_t timestamp, bool ignoreHeight, bool reset, dwMapTrackerHandle_t mapTrackerHandle)
 Update the tracker with the current pose defined by a WGS84 point and a rotation matrix. More...
 
DW_API_PUBLIC dwStatus dwMapTracker_updateWithLocalPose (const dwMapsRoadSegment *referenceRoadSegment, const dwVector3f *position, const dwMatrix3d *localToENURotation33, dwTime_t timestamp, bool reset, dwMapTrackerHandle_t mapTrackerHandle)
 dwMapTracker_updateWithLocalPose More...
 

Typedef Documentation

◆ dwConstMapTrackerHandle_t

typedef struct dwMapTrackerObject const* dwConstMapTrackerHandle_t

Definition at line 2023 of file Maps.h.

◆ dwMapTrackerHandle_t

typedef struct dwMapTrackerObject* dwMapTrackerHandle_t

Definition at line 2022 of file Maps.h.

Function Documentation

◆ dwMapTracker_getCurrentCandidateLanes()

DW_API_PUBLIC dwStatus dwMapTracker_getCurrentCandidateLanes ( dwMapsLaneBuffer lanes,
dwConstMapTrackerHandle_t  mapTrackerHandle 
)

Get current lane candidates that have been used to find the current lane.

Parameters
[out]lanesbuffer for lane candidates
[in]mapTrackerHandlemap tracker handle
Returns
DW_SUCCESS Successfully returned current lane candidates
DW_INVALID_ARGUMENT lanes is nullptr.
DW_BAD_CAST Could not successfully cast handle to map tracker object.

◆ dwMapTracker_getCurrentLane()

DW_API_PUBLIC dwStatus dwMapTracker_getCurrentLane ( const dwMapsLane **  currentLane,
dwConstMapTrackerHandle_t  mapTrackerHandle 
)

Get current lane that has been evaluated in the last update.

Parameters
[out]currentLaneClosest lane that has been found.
[in]mapTrackerHandlemap tracker handle
Returns
DW_SUCCESS Successfully returned current lane.
DW_INVALID_ARGUMENT currentLane is nullptr.
DW_BAD_CAST Could not successfully cast handle to map tracker object.

◆ dwMapTracker_initialize()

DW_API_PUBLIC dwStatus dwMapTracker_initialize ( dwMapTrackerHandle_t mapTrackerHandle,
dwConstMapHandle_t  map 
)

Creates a map tracker handle that allows to track a pose on a map.

This allows for a robust query of the current dwMapsLane.

Parameters
[out]mapTrackerHandlemapHandle to be initialized
[in]mapmap
Returns
DW_SUCCESS Map tracker handle is successfully initialized.
DW_INVALID_ARGUMENT mapTrackerHandle is nullptr.

◆ dwMapTracker_release()

DW_API_PUBLIC dwStatus dwMapTracker_release ( dwMapTrackerHandle_t  mapTrackerHandle)

Release map tracker handle.

Parameters
[in,out]mapTrackerHandlemap tracker handle to be released
Returns
DW_SUCCESS Successfully released map tracker object and handle.
DW_BAD_CAST Could not successfully cast handle to map object.

◆ dwMapTracker_updateWithGlobalPose()

DW_API_PUBLIC dwStatus dwMapTracker_updateWithGlobalPose ( const dwMapsGeoPoint position,
const dwMatrix3d localToENURotation33,
dwTime_t  timestamp,
bool  ignoreHeight,
bool  reset,
dwMapTrackerHandle_t  mapTrackerHandle 
)

Update the tracker with the current pose defined by a WGS84 point and a rotation matrix.

This updates the dwMapsLane the current pose most likely belongs to. The pose is represented by a position and an orientation. The timestamp allows to compute a time difference since the last update and therefore restrict the lane candidates to lanes that can be reached from the previous pose in the given time difference. If the time difference is negative, there hasn't been a previous update, or the reset bool is set, the previous pose is ignored and a range search is executed around the current position to find the lane candidates. Also, if the distance from the current position to the closest point on the best candidate is too big, a range search is executed. This prevents the tracker from sticking to a wrong lane for too long in case of a wrong lane assignment.

From the lane candidates, the best lane is selected based on distance and angle to the current orientation.

Parameters
[in]positionCurrent position.
[in]localToENURotation33Current orientation. 3x3 Rotation matrix that transforms from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'localOrigin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'localOrigin'. If nullptr, the orientation is ignored.
[in]timestampCurrent time in microseconds.
[in]ignoreHeightIf true, all points are projected onto height 0 before computing the distances.
[in]resetIgnore previous update and do a range search around current pose to get candidate lanes.
[in]mapTrackerHandlemap tracker handle
Returns
DW_SUCCESS Successfully updated the map tracker.
DW_INVALID_ARGUMENT Could not successfully cast handle to map tracker object, or 'position' is a nullptr.

◆ dwMapTracker_updateWithLocalPose()

DW_API_PUBLIC dwStatus dwMapTracker_updateWithLocalPose ( const dwMapsRoadSegment referenceRoadSegment,
const dwVector3f position,
const dwMatrix3d localToENURotation33,
dwTime_t  timestamp,
bool  reset,
dwMapTrackerHandle_t  mapTrackerHandle 
)

dwMapTracker_updateWithLocalPose

Same as dwMapTracker_updateWithGlobalPose, but the current pose is represented by a point and rotation matrix in the ENU (east-north-up) space of a reference road segment.

Parameters
[in]referenceRoadSegmentRoad segment that defines the local space of 'position': ENU (east-north-up) space at referenceRoadSegment->origin .
[in]positionCurrent positions in local space coordinates of referenceRoadSegment.
[in]localToENURotation333x3 Rotation matrix that rotates from local coordinate system (x: forward, y: left, z: up) into ENU local cartesian coordinate system with origin at point 'referenceRoadSegment->origin' (x: east, y: north, z: up). z coordinate of ENU is the normal of the earth spheroid at point 'referenceRoadSegment->origin'. No rotation is applied if localToENURotation33 is nullptr, meaning x-axis points east.
[in]timestamp
[in]reset
[in]mapTrackerHandle
Returns
DW_SUCCESS Successfully update the map tracker.
DW_INVALID_ARGUMENT Could not successfully cast handle to map tracker object, or 'position' or 'referenceRoadSegment' is a nullptr.