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.
|
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...
|
|
◆ 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_updateWithGlobalPose()
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] | 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'. If nullptr, the orientation is ignored. |
[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 updated the map tracker.
DW_INVALID_ARGUMENT Could not successfully cast handle to map tracker object, or 'position' is a nullptr.
◆ dwMapTracker_updateWithLocalPose()
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] | referenceRoadSegment | Road segment that defines the local space of 'position': ENU (east-north-up) space at referenceRoadSegment->origin . |
[in] | position | Current positions in local space coordinates of referenceRoadSegment. |
[in] | localToENURotation33 | 3x3 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.