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.
◆ dwConstMapTrackerHandle_t
◆ dwMapTrackerHandle_t
◆ dwMapTracker_getCurrentCandidateLanes()
Get current lane candidates that have been used to find the current lane.
- Parameters
-
[out] | lanes | buffer for lane candidates |
[in] | mapTrackerHandle | map 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()
Get current lane that has been evaluated in the last update.
- Parameters
-
[out] | currentLane | Closest lane that has been found. |
[in] | mapTrackerHandle | map 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()
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] | mapTrackerHandle | mapHandle to be initialized |
[in] | map | map |
- Returns
- DW_SUCCESS Map tracker handle is successfully initialized.
DW_INVALID_ARGUMENT mapTrackerHandle is nullptr.
◆ dwMapTracker_release()
Release map tracker handle.
- Parameters
-
[in,out] | mapTrackerHandle | map 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_updateCurrentPose()
Update the tracker with the current pose.
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] | position | Current position. |
[in] | localToENURotation33 | Current 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'. |
[in] | timestamp | Current time in microseconds. |
[in] | ignoreHeight | If true, all points are projected onto height 0 before computing the distances. |
[in] | reset | Ignore previous update and do a range search around current pose to get candidate lanes. |
[in] | mapTrackerHandle | map tracker handle |
- Returns
- DW_SUCCESS Successfully released map tracker object and handle.
DW_BAD_CAST Could not successfully cast handle to map tracker object.