DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Local Map Layout

Detailed Description

Create local map layouts.

Local map layouts facilitate computation of relative poses of road segments using relative segment-to-segment transformations associated with road segment connections.

See also
dwMapsLocalLayout_build

Data Structures

struct  dwMapsLocalLayoutSegmentPose
 Provides information about road segment pose relative to layout component root. More...
 

Functions

DW_API_PUBLIC dwStatus dwMaps_transformFeaturesToLocalLinesViaRelative (dwMapsPolyline3fBuffer *featureLineSegments, dwMapsPointBuffer *featurePoints, const dwMapsFeatureBuffer *dwFeatures, const dwMatrix3f rotationLayoutRootToLocal, const dwVector3f translationLayoutRootToLocal, const dwMapsLocalBounds *localBounds, dwConstMapsLocalLayoutHandle_t localLayoutHandle, uint32_t componentId)
 Get featureLineSegments and featurePoints from the list of specified dwFeatures, transformed into the camera coordinate system. More...
 
DW_API_PUBLIC dwStatus dwMaps_transformLaneDividersToLocalLines (dwMapsLaneDividerLineBuffer *lineSegments, const dwMapsLaneDividerBuffer *laneDividers, const dwMapsGeoPoint *localOrigin, const dwMatrix3d *localToENURotation33, const dwMapsLocalBounds *localBounds, const dwVector3f *directionFilterVector, float32_t directionFilterAngleRadian, bool ignoreLaneDirection, dwConstMapsLocalLayoutHandle_t localLayoutHandle, uint32_t componentId)
 Get line segments from the list of specified dividers, transformed into a local cartesian coordinate system defined by position 'localOrigin', rotation matrix 'localToENURotation33', optionally filtered by orientation and bounds in local coordinate. More...
 
DW_API_PUBLIC dwStatus dwMaps_transformLaneDividersToLocalLinesViaRelative (dwMapsLaneDividerLineBuffer *lineSegments, const dwMapsLaneDividerBuffer *laneDividers, const dwMatrix3f rotationLayoutRootToLocal, const dwVector3f translationLayoutRootToLocal, const dwMapsLocalBounds *localBounds, const dwVector3f *directionFilterVector, float32_t directionFilterAngleRadian, bool ignoreLaneDirection, dwConstMapsLocalLayoutHandle_t localLayoutHandle, uint32_t componentId)
 Get line segments from the list of specified dividers, transformed into the camera coordinate system. More...
 
DW_API_PUBLIC dwStatus dwMaps_transformRoadFeaturesToLocalLines (dwMapsPolyline3fBuffer *localPolylines, dwMapsPointBuffer *localPoints, const dwMapsFeatureBuffer *features, const dwMapsGeoPoint *localOrigin, const dwMatrix3d *localToENURotation33, const dwMapsLocalBounds *localBounds, dwConstMapsLocalLayoutHandle_t localLayoutHandle, uint32_t componentId)
 Get polylines and points from the list of specified features, transformed into a local cartesian coordinate system defined by position 'localOrigin', rotation matrix 'localToENURotation33', optionally filtered by bounds in local coordinate. More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_addRoadSegmentPointers (const dwMapsRoadSegment **segmentPointers, uint32_t count, dwMapsLocalLayoutHandle_t localLayoutHandle)
 Add road segment pointers to the layout. More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_addRoadSegments (const dwMapsRoadSegment *segments, uint32_t count, dwMapsLocalLayoutHandle_t localLayoutHandle)
 Add road segments to the layout. More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_build (const dwMapsGeoPoint *layoutOrigin, dwMapsLocalLayoutHandle_t localLayoutHandle)
 Computes relative transforms between segments previously added to the layout: More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_getComponentCount (uint32_t *componentCount, dwConstMapsLocalLayoutHandle_t localLayoutHandle)
 Returns the number of connected components discovered while building the layout. More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_getComponentRoot (const dwMapsRoadSegment **segment, uint32_t componentId, dwConstMapsLocalLayoutHandle_t localLayoutHandle)
 Returns the root segment of the specified connected component. More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_getSegmentPose (dwMapsLocalLayoutSegmentPose *pose, const dwMapsRoadSegmentId *segmentId, dwConstMapsLocalLayoutHandle_t localLayoutHandle)
 Provides information about road segment pose relative to layout component root. More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_initialize (dwMapsLocalLayoutHandle_t *localLayoutHandle, uint32_t maxRoadSegments, uint32_t maxComponents)
 Creates a local map layout object, which provides locally-accurate relative poses of road segments. More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_release (dwMapsLocalLayoutHandle_t localLayoutHandle)
 Destroys a local layout object. More...
 
DW_API_PUBLIC dwStatus dwMapsLocalLayout_reset (dwMapsLocalLayoutHandle_t localLayoutHandle)
 Clear out previously added road segments. More...
 

Data Structure Documentation

◆ dwMapsLocalLayoutSegmentPose

struct dwMapsLocalLayoutSegmentPose
Data Fields
uint32_t componentId
const dwMapsRoadSegment * componentRoot
uint32_t hopsFromRoot
dwTransformation3f segmentToRoot

Function Documentation

◆ dwMaps_transformFeaturesToLocalLinesViaRelative()

DW_API_PUBLIC dwStatus dwMaps_transformFeaturesToLocalLinesViaRelative ( dwMapsPolyline3fBuffer featureLineSegments,
dwMapsPointBuffer featurePoints,
const dwMapsFeatureBuffer dwFeatures,
const dwMatrix3f  rotationLayoutRootToLocal,
const dwVector3f  translationLayoutRootToLocal,
const dwMapsLocalBounds localBounds,
dwConstMapsLocalLayoutHandle_t  localLayoutHandle,
uint32_t  componentId 
)

Get featureLineSegments and featurePoints from the list of specified dwFeatures, transformed into the camera coordinate system.

Parameters
[in,out]featureLineSegmentsUser provided feature line buffer.
[in,out]featurePointsUser provided feature point buffer.
[in]dwFeaturesThe list of features to process.
[in]rotationLayoutRootToLocalRotation from the root to the local coordinate system.
[in]translationLayoutRootToLocalTranslation from the root to the local coordinate system.
[in]localBoundsOptional bounds in the local coordinate system. No filtering is applied when it is nullptr.
[in]localLayoutHandleThe local layout object that provides relative transforms between the road segments.
[in]componentIdA lane divider is included only if its parent road segment belongs to the specified local layout component.
Returns
DW_SUCCESS Success.
DW_FAILURE All failures of dwMaps_transformFeaturesToLocalLinesViaRelative
DW_INVALID_ARGUMENT localLayoutHandle, featureLineSegments, featurePoints or dwFeatures is null.

◆ dwMaps_transformLaneDividersToLocalLines()

DW_API_PUBLIC dwStatus dwMaps_transformLaneDividersToLocalLines ( dwMapsLaneDividerLineBuffer lineSegments,
const dwMapsLaneDividerBuffer laneDividers,
const dwMapsGeoPoint localOrigin,
const dwMatrix3d localToENURotation33,
const dwMapsLocalBounds localBounds,
const dwVector3f directionFilterVector,
float32_t  directionFilterAngleRadian,
bool  ignoreLaneDirection,
dwConstMapsLocalLayoutHandle_t  localLayoutHandle,
uint32_t  componentId 
)

Get line segments from the list of specified dividers, transformed into a local cartesian coordinate system defined by position 'localOrigin', rotation matrix 'localToENURotation33', optionally filtered by orientation and bounds in local coordinate.

Parameters
[in,out]lineSegmentsUser provided line segment buffer.
[in]laneDividersThe list of lane dividers to process.
[in]localOriginWGS84 coordinate point, origin of the local coordinate system.
[in]localToENURotation333x3 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'. No rotation is applied if localToENURotation33 is nullptr, meaning x-axis points east.
[in]localBoundsOptional bounds in the local coordinate system. No filtering is applied when it is nullptr.
[in]directionFilterVectorOptional vector in local space coordinates that defines a direction to compare the line segments against.
[in]directionFilterAngleRadianA line segment is included if the angle between directionFilterVector and the line segment is smaller than given angle.
[in]ignoreLaneDirectionIf true, the angle check is applied on both sides of the line segment. Otherwise, the angle check on the line segment happens in driving direction of the corresponding lane only. Also, only lane dividers that correspond to drivable lanes are returned if ignoreLaneDirection is false.
[in]localLayoutHandleThe local layout object that provides relative transforms between the road segments.
[in]componentIdA lane divider is included only if its parent road segment belongs to the specified local layout component.
Returns
DW_SUCCESS Success.
DW_FAILURE All failures of dwMapsLocalLayout_getComponentRoot
DW_INVALID_ARGUMENT localLayoutHandle, lineSegments or laneDividers is null.
DW_FAILURE all failures of dwMapsLocalLayout_getComponentRoot

◆ dwMaps_transformLaneDividersToLocalLinesViaRelative()

DW_API_PUBLIC dwStatus dwMaps_transformLaneDividersToLocalLinesViaRelative ( dwMapsLaneDividerLineBuffer lineSegments,
const dwMapsLaneDividerBuffer laneDividers,
const dwMatrix3f  rotationLayoutRootToLocal,
const dwVector3f  translationLayoutRootToLocal,
const dwMapsLocalBounds localBounds,
const dwVector3f directionFilterVector,
float32_t  directionFilterAngleRadian,
bool  ignoreLaneDirection,
dwConstMapsLocalLayoutHandle_t  localLayoutHandle,
uint32_t  componentId 
)

Get line segments from the list of specified dividers, transformed into the camera coordinate system.

Parameters
[in,out]lineSegmentsUser provided line segment buffer.
[in]laneDividersThe list of lane dividers to process.
[in]rotationLayoutRootToLocalRotation from the root to the local coordinate system
[in]translationLayoutRootToLocalTranslation from the root to the local coordinate system
[in]localBoundsOptional bounds in the local coordinate system. No filtering is applied when it is nullptr.
[in]directionFilterVectorOptional vector in local space coordinates that defines a direction to compare the line segments against.
[in]directionFilterAngleRadianA line segment is included if the angle between directionFilterVector and the line segment is smaller than given angle.
[in]ignoreLaneDirectionIf true, the angle check is applied on both sides of the line segment. Otherwise, the angle check on the line segment happens in driving direction of the corresponding lane only. Also, only lane dividers that correspond to drivable lanes are returned if ignoreLaneDirection is false.
[in]localLayoutHandleThe local layout object that provides relative transforms between the road segments.
[in]componentIdA lane divider is included only if its parent road segment belongs to the specified local layout component.
Returns
DW_SUCCESS Success.
DW_FAILURE All failures of dwMaps_transformLaneDividersToLocalLinesViaRelative
DW_INVALID_ARGUMENT localLayoutHandle, lineSegments or laneDividers is null.

◆ dwMaps_transformRoadFeaturesToLocalLines()

DW_API_PUBLIC dwStatus dwMaps_transformRoadFeaturesToLocalLines ( dwMapsPolyline3fBuffer localPolylines,
dwMapsPointBuffer localPoints,
const dwMapsFeatureBuffer features,
const dwMapsGeoPoint localOrigin,
const dwMatrix3d localToENURotation33,
const dwMapsLocalBounds localBounds,
dwConstMapsLocalLayoutHandle_t  localLayoutHandle,
uint32_t  componentId 
)

Get polylines and points from the list of specified features, transformed into a local cartesian coordinate system defined by position 'localOrigin', rotation matrix 'localToENURotation33', optionally filtered by bounds in local coordinate.

Parameters
[in,out]localPolylinesUser provided polyline buffer.
[in,out]localPointsUser provided points buffer.
[in]featuresThe list of features to process.
[in]localOriginWGS84 coordinate point, origin of the local coordinate system.
[in]localToENURotation333x3 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'. No rotation is applied if localToENURotation33 is nullptr, meaning x-axis points east.
[in]localBoundsOptional bounds in the local coordinate system. No filtering is applied when it is nullptr.
[in]localLayoutHandleThe local layout object that provides relative transforms between the road segments.
[in]componentIdA feature is included only if its parent road segment belongs to the specified local layout component.
Returns
DW_SUCCESS Success.
DW_FAILURE All failures of dwMapsLocalLayout_getComponentRoot DW_INVALID_ARGUMENT localLayoutHandle, localPolylines, localPoints, or laneDividers is null. DW_FAILURE all failures of dwMapsLocalLayout_getComponentRoot

◆ dwMapsLocalLayout_addRoadSegmentPointers()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_addRoadSegmentPointers ( const dwMapsRoadSegment **  segmentPointers,
uint32_t  count,
dwMapsLocalLayoutHandle_t  localLayoutHandle 
)

Add road segment pointers to the layout.

Must call dwMapsLocalLayout_build() before pose information may be retrieved. f

Parameters
[in]segmentPointersBuffer containing road segment pointers.
[in]countNumber of road segment pointers.
[in]localLayoutHandleLocal layout handle to destroy.
Returns
DW_SUCCESS Success.
DW_BUFFER_FULL Insufficient space reserved to store road segments. Increase maxRoadSegments. DW_INVALID_ARGUMENT localLayoutHandle or segments is null.

◆ dwMapsLocalLayout_addRoadSegments()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_addRoadSegments ( const dwMapsRoadSegment segments,
uint32_t  count,
dwMapsLocalLayoutHandle_t  localLayoutHandle 
)

Add road segments to the layout.

Must call dwMapsLocalLayout_build() before pose information may be retrieved. f

Parameters
[in]segmentsBuffer containing road segments.
[in]countNumber of road segments.
[in]localLayoutHandleLocal layout handle to destroy.
Returns
DW_SUCCESS Success.
DW_BUFFER_FULL Insufficient space reserved to store road segments. Increase maxRoadSegments. DW_INVALID_ARGUMENT localLayoutHandle or segments is null.

◆ dwMapsLocalLayout_build()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_build ( const dwMapsGeoPoint layoutOrigin,
dwMapsLocalLayoutHandle_t  localLayoutHandle 
)

Computes relative transforms between segments previously added to the layout:

  1. Find road segment closest to layoutOrigin (according to WGS-84 coordinates of road segment's origin). This segment will be the root of a connected component in the layout.
  2. Traverse graph of road segments, starting from the root. Compute relative transform of each discovered segment to the component root. Only segments previously added to this local layout object are considered during the traversal.
  3. If any undiscovered segments are left, create a new connected component and go to step 1.
Parameters
[in]layoutOriginGeographic position around which layout will be performed.
[in]localLayoutHandleLocal layout handle.
Returns
DW_SUCCESS Success.
DW_BUFFER_FULL Insufficient space reserved to store connected components. Increase maxComponents. DW_INVALID_ARGUMENT localLayoutHandle or layoutOrigin is null.

◆ dwMapsLocalLayout_getComponentCount()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_getComponentCount ( uint32_t *  componentCount,
dwConstMapsLocalLayoutHandle_t  localLayoutHandle 
)

Returns the number of connected components discovered while building the layout.

Parameters
[out]componentCountThe number of connected components discovered while building local layout.
[in]localLayoutHandleLocal layout handle.
Returns
DW_SUCCESS Success.
DW_INVALID_ARGUMENT localLayoutHandle or componentCount is null.

◆ dwMapsLocalLayout_getComponentRoot()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_getComponentRoot ( const dwMapsRoadSegment **  segment,
uint32_t  componentId,
dwConstMapsLocalLayoutHandle_t  localLayoutHandle 
)

Returns the root segment of the specified connected component.

Parameters
[out]segmentRoot segment of the component.
[in]componentIdId of the connected component (0 < componentId < numComponents).
[in]localLayoutHandleLocal layout handle.
Returns
DW_SUCCESS Success.
DW_OUT_OF_BOUNDS componentId is greater than the number of connected components.
DW_INVALID_ARGUMENT localLayoutHandle or segment is null.

◆ dwMapsLocalLayout_getSegmentPose()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_getSegmentPose ( dwMapsLocalLayoutSegmentPose pose,
const dwMapsRoadSegmentId segmentId,
dwConstMapsLocalLayoutHandle_t  localLayoutHandle 
)

Provides information about road segment pose relative to layout component root.

Parameters
[out]poseRelative pose information for the specified road segment.
[in]segmentIdRoad segment id.
[in]localLayoutHandleLocal layout handle.
Returns
DW_SUCCESS Success.
DW_NOT_AVAILABLE The specified segment is not a part of this layout.
DW_INVALID_ARGUMENT localLayoutHandle or pose or segmentId is null.
DW_INVALID_HANDLE The specified segment is not a part of this layout.

◆ dwMapsLocalLayout_initialize()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_initialize ( dwMapsLocalLayoutHandle_t localLayoutHandle,
uint32_t  maxRoadSegments,
uint32_t  maxComponents 
)

Creates a local map layout object, which provides locally-accurate relative poses of road segments.

Parameters
[out]localLayoutHandleHandle of the created local layout.
[in]maxRoadSegmentsThe maximum number of road segments this layout may contain.
[in]maxComponentsThe maximum number of connected components this layout may contain.
Returns
DW_SUCCESS Success.
DW_INVALID_ARGUMENT localLayoutHandle is null.

◆ dwMapsLocalLayout_release()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_release ( dwMapsLocalLayoutHandle_t  localLayoutHandle)

Destroys a local layout object.

Parameters
[in]localLayoutHandleLocal layout handle to destroy.
Returns
DW_SUCCESS Success.
DW_INVALID_ARGUMENT localLayoutHandle is null.

◆ dwMapsLocalLayout_reset()

DW_API_PUBLIC dwStatus dwMapsLocalLayout_reset ( dwMapsLocalLayoutHandle_t  localLayoutHandle)

Clear out previously added road segments.

Parameters
[in]localLayoutHandleLocal layout handle to destroy.
Returns
DW_SUCCESS Success.
DW_INVALID_ARGUMENT localLayoutHandle is null.