DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Detailed Description

Lane Tree to follow a lane along its driving direction.

The lane tree starts at a given lane and follows the driving direction, branching whenever there is a lane split.

Data Structures

struct  dwMapsLaneTreeNode
 Lane Tree Node. More...
 
struct  dwMapsLaneTreeNodeBuffer
 User provided buffer of dwMapsLaneTreeNode. More...
 

Typedefs

typedef struct dwMapsLaneTreeObject const * dwConstMapsLaneTreeHandle_t
 
typedef struct dwMapsLaneTreeObject * dwMapsLaneTreeHandle_t
 

Enumerations

enum  dwMapsLaneTreeLimit {
  DW_MAPS_LANE_TREE_LIMIT_DISTANCE = 0,
  DW_MAPS_LANE_TREE_LIMIT_TIME = 1
}
 Enum to select the lane tree limit type. More...
 

Functions

DW_API_PUBLIC dwStatus dwMapsLaneTree_create (const dwMapsLane *lane, float32_t limit, dwMapsLaneTreeLimit limitType, bool doLaneChanges, bool forward, bool relativeToDrivingDirection, dwMapsLaneTreeHandle_t laneTree)
 Create a lane tree starting at a given lane. More...
 
DW_API_PUBLIC dwStatus dwMapsLaneTree_get (dwMapsLaneTreeNode **root, dwMapsLaneTreeNodeBuffer *laneTreeNodes, dwConstMapsLaneTreeHandle_t laneTree)
 Get the created lane tree. More...
 
DW_API_PUBLIC dwStatus dwMapsLaneTree_getLaneCount (uint32_t *laneCount, dwConstMapsLaneTreeHandle_t laneTree)
 Get total number of lanes in the lane tree. More...
 
DW_API_PUBLIC dwStatus dwMapsLaneTree_getLaneListToLeaf (dwMapsLaneBuffer *laneBuffer, uint32_t leafIndex, dwConstMapsLaneTreeHandle_t laneTree)
 Get the list of lanes that connect the root lane to a leaf. More...
 
DW_API_PUBLIC dwStatus dwMapsLaneTree_getLanes (dwMapsLaneBuffer *laneBuffer, dwConstMapsLaneTreeHandle_t laneTree)
 Get all lanes in lane tree. More...
 
DW_API_PUBLIC dwStatus dwMapsLaneTree_getLeafCount (uint32_t *leafCount, dwConstMapsLaneTreeHandle_t laneTree)
 dwMapsLaneTree_getLeafCount More...
 
DW_API_PUBLIC dwStatus dwMapsLaneTree_initialize (dwMapsLaneTreeHandle_t *laneTreeHandle, uint32_t maxLaneCount, dwConstMapHandle_t map)
 Creates a lane tree object that allows to create a tree of connected lanes. More...
 
DW_API_PUBLIC dwStatus dwMapsLaneTree_release (dwMapsLaneTreeHandle_t laneTreeHandle)
 Release lane tree handle. More...
 

Data Structure Documentation

◆ dwMapsLaneTreeNode

struct dwMapsLaneTreeNode
Data Fields
dwMapsLaneTreeNode * children children node array
uint32_t childrenCount size of children node array
const dwMapsLane * lane lane
dwMapsLaneTreeNode * parent parent node

◆ dwMapsLaneTreeNodeBuffer

struct dwMapsLaneTreeNodeBuffer
Data Fields
dwMapsLaneTreeNode * buffer pointer to node buffer
uint32_t maxSize maximum number of nodes that fit into the buffer
uint32_t size current number of valid nodes in the buffer

Typedef Documentation

◆ dwConstMapsLaneTreeHandle_t

typedef struct dwMapsLaneTreeObject const* dwConstMapsLaneTreeHandle_t

Definition at line 2173 of file Maps.h.

◆ dwMapsLaneTreeHandle_t

typedef struct dwMapsLaneTreeObject* dwMapsLaneTreeHandle_t

Definition at line 2172 of file Maps.h.

Enumeration Type Documentation

◆ dwMapsLaneTreeLimit

Enum to select the lane tree limit type.

The tree can be grown by distance or lane traversal time.

Enumerator
DW_MAPS_LANE_TREE_LIMIT_DISTANCE 
DW_MAPS_LANE_TREE_LIMIT_TIME 

Definition at line 2179 of file Maps.h.

Function Documentation

◆ dwMapsLaneTree_create()

DW_API_PUBLIC dwStatus dwMapsLaneTree_create ( const dwMapsLane lane,
float32_t  limit,
dwMapsLaneTreeLimit  limitType,
bool  doLaneChanges,
bool  forward,
bool  relativeToDrivingDirection,
dwMapsLaneTreeHandle_t  laneTree 
)

Create a lane tree starting at a given lane.

Follow connected lanes until the limit (distance or traversal time) is reached.

Parameters
[in]laneLane to start the lane tree.
[in]limitLimit at which to stop following the lane. It only starts counting after the the input lane, to ensure that the lanes in the leaf nodes are at least the given limit (distance or time) away.
[in]limitTypeDistance or lane traversal time.
[in]doLaneChangesIf true, also lanes that are reachable through a lane change are followed.
[in]forwardWhether to grow the lane tree forward or backward from given lane.
[in]relativeToDrivingDirectionDefines what the 'forward' parameter refers to. If true, it is relative to the driving direction of the lane. This only works if the lane has a unique driving direction. It fails if it is DW_MAPS_DIRECTION_NONE or DW_MAPS_DIRECTION_BOTH. If false, 'forward' refers to the geometry direction of the polylines and uses 'next' connections when 'forward' is true, 'previous' connections if it is false.
[in]laneTreeLane tree object that runs the tree creation and stores the result.
Returns
DW_SUCCESS Successfully created a lane tree at the given lane.
DW_BAD_CAST Could not successfully cast handle to lane tree object. DW_BUFFER_FULL Not enough space reserved in lane tree object. Increase maxLaneCount.

◆ dwMapsLaneTree_get()

DW_API_PUBLIC dwStatus dwMapsLaneTree_get ( dwMapsLaneTreeNode **  root,
dwMapsLaneTreeNodeBuffer laneTreeNodes,
dwConstMapsLaneTreeHandle_t  laneTree 
)

Get the created lane tree.

This function returns the root of the created lane tree. The tree can be traversed by following the parent and children pointers.

Parameters
[out]rootRoot node of the the tree.
[in,out]laneTreeNodesBuffer to return all tree nodes.
[in]laneTreeLane tree object containing the previosly created tree.
Returns
DW_SUCCESS Successfully returned the lane tree nodes. DW_INVALID_ARGUMENT root or laneTreeNodes is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object. DW_BUFFER_FULL Provided laneTreeNodes buffer not big enough.

◆ dwMapsLaneTree_getLaneCount()

DW_API_PUBLIC dwStatus dwMapsLaneTree_getLaneCount ( uint32_t *  laneCount,
dwConstMapsLaneTreeHandle_t  laneTree 
)

Get total number of lanes in the lane tree.

Parameters
[out]laneCountLane count.
[in]laneTreeLane tree object containing the previosly created tree.
Returns
DW_SUCCESS Successfully returned number of lanes in tree. DW_INVALID_ARGUMENT root or laneCount is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object.

◆ dwMapsLaneTree_getLaneListToLeaf()

DW_API_PUBLIC dwStatus dwMapsLaneTree_getLaneListToLeaf ( dwMapsLaneBuffer laneBuffer,
uint32_t  leafIndex,
dwConstMapsLaneTreeHandle_t  laneTree 
)

Get the list of lanes that connect the root lane to a leaf.

This is a helper function to iterate all leaves and create a connected list of lanes for each leaf.

Parameters
[in,out]laneBufferBuffer to return the lane list.
[in]leafIndexIndex of the leaf to be reached by the lane list.
[in]laneTreeLane tree object containing the previosly created tree.
Returns
DW_SUCCESS Successfully returned list of lanes to a leaf. DW_INVALID_ARGUMENT root or laneBuffer is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object. DW_BUFFER_FULL Provided laneBuffer not big enough.

◆ dwMapsLaneTree_getLanes()

DW_API_PUBLIC dwStatus dwMapsLaneTree_getLanes ( dwMapsLaneBuffer laneBuffer,
dwConstMapsLaneTreeHandle_t  laneTree 
)

Get all lanes in lane tree.

This function returns the set of lanes in the lane tree in undefined order.

Parameters
[in,out]laneBufferBuffer to return the set of lanes in the tree.
[in]laneTreeLane tree object containing the previosly created tree.
Returns
DW_SUCCESS Successfully returned list of lanes in tree. DW_INVALID_ARGUMENT laneBuffer is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object. DW_BUFFER_FULL Provided laneBuffer not big enough.

◆ dwMapsLaneTree_getLeafCount()

DW_API_PUBLIC dwStatus dwMapsLaneTree_getLeafCount ( uint32_t *  leafCount,
dwConstMapsLaneTreeHandle_t  laneTree 
)

dwMapsLaneTree_getLeafCount

Parameters
[out]leafCountNumber of leaf nodes in the lane tree.
[in]laneTreeLane tree object containing the previosly created tree.
Returns
DW_SUCCESS Successfully returned the number of leaf nodes. DW_INVALID_ARGUMENT leafCount is nullptr. DW_BAD_CAST Could not successfully cast handle to lane tree object.

◆ dwMapsLaneTree_initialize()

DW_API_PUBLIC dwStatus dwMapsLaneTree_initialize ( dwMapsLaneTreeHandle_t laneTreeHandle,
uint32_t  maxLaneCount,
dwConstMapHandle_t  map 
)

Creates a lane tree object that allows to create a tree of connected lanes.

Parameters
[out]laneTreeHandlelane tree handle to be initialized
[in]maxLaneCountallocate space for given maximum number of lanes.
[in]mapmap
Returns
DW_SUCCESS Map tracker handle is successfully initialized.
DW_INVALID_ARGUMENT laneTreeHandle is nullptr.

◆ dwMapsLaneTree_release()

DW_API_PUBLIC dwStatus dwMapsLaneTree_release ( dwMapsLaneTreeHandle_t  laneTreeHandle)

Release lane tree handle.

Parameters
[in,out]laneTreeHandlelane tree handle to be released
Returns
DW_SUCCESS Successfully released lane tree object and handle.
DW_BAD_CAST Could not successfully cast handle to lane tree object.