DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Point Cloud Processing Interface

Detailed Description

Defines point cloud assembling module.

Defines point cloud processing datatypes and memory handling functions.

Defines lidar point cloud structure.

Data Structures

struct  dwLidarMotionCompensationInfo
 Declares motion compensation traits of the point cloud. More...
 
struct  dwLidarPointCloud
 Defines a LiDAR-specific point cloud data structure. More...
 
struct  dwLidarPointCloudMapping
 Struct indicating layer and aux channel mapping. More...
 
struct  dwPointCloud
 Defines point cloud data structure. More...
 
struct  dwPointCloudAssemblerParams
 Initialization parameters. More...
 
struct  dwPointCloudAuxChannel
 Struct holding information about aux channel. More...
 
struct  dwPointCloudLayer
 Struct holding information about a single point cloud layer. More...
 

Modules

 Point Cloud Accumulator
 Defines datatypes and functions to accumulate cloud of points.
 
 Point Cloud Filter
 Defines module to perform point cloud box filtering.
 
 Point Cloud ICP
 Defines Point Cloud ICP module to align point clouds using iterative closest point algorithms.
 
 Point Cloud Plane Extractor
 Defines module to extract one 3D plane nearby the sensor.
 
 Point Cloud Range Image Creator
 Defines module to produce range image via spherical projection of the point cloud.
 
 Point Cloud Stitcher
 Defines module to register/stitch multiple sets of point clouds.
 

Macros

#define DW_LIDAR_POINT_CLOUD_USER_DATA_SIZE   8
 Number of elements in user buffer. More...
 
#define DW_POINT_CLOUD_MAX_AUX_CHANNELS   16U
 
#define DW_POINT_CLOUD_MAX_LAYERS   16U
 

Typedefs

typedef struct dwPointCloudAssemblerObject const * dwPointCloudAssemblerConstHandle_t
 
typedef struct dwPointCloudAssemblerObject * dwPointCloudAssemblerHandle_t
 

Enumerations

enum  dwPointCloudFormat {
  DW_POINTCLOUD_FORMAT_XYZI = 0 ,
  DW_POINTCLOUD_FORMAT_RTHI = 1
}
 Defines point format. More...
 
enum  dwPointCloudReferenceFrame {
  DW_POINTCLOUD_REFERENCE_FRAME_SENSOR = 0 ,
  DW_POINTCLOUD_REFERENCE_FRAME_RIG = 1 ,
  DW_POINTCLOUD_REFERENCE_FRAME_CUSTOM = 2
}
 Defines point cloud coordinate reference frame. More...
 

Functions

DW_API_PUBLIC dwStatus dwLidarPointCloud_create (dwLidarPointCloud *lidarPointCloud, dwPointCloudFormat const format, dwMemoryType const memoryType, uint32_t const maxPointsPerReturn, dwLidarPointCloudMapping const *mapping)
 Create lidar specific point cloud. More...
 
DW_API_PUBLIC dwStatus dwLidarPointCloud_destroy (dwLidarPointCloud *lidarPointCloud)
 Destroy lidar specific point cloud. More...
 
DW_API_PUBLIC dwStatus dwPointCloud_create (dwPointCloud *pointCloud, dwPointCloudFormat const format, dwMemoryType const memoryType, uint32_t const maxPointsPerLayer, uint32_t const numRequestedLayers, uint32_t const *auxChannelsElemSize, uint32_t const numRequestedAuxChannels)
 Create point cloud with layers and aux channel information. More...
 
DW_API_PUBLIC dwStatus dwPointCloud_createBuffer (dwPointCloud *buffer)
 Allocates memory for point cloud data structure. More...
 
DW_API_PUBLIC dwStatus dwPointCloud_destroy (dwPointCloud *pointCloud)
 Destroy point cloud buffers. More...
 
DW_API_PUBLIC dwStatus dwPointCloud_destroyBuffer (dwPointCloud *buffer)
 Destroys allocated memory for point cloud data structure. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_addLidarPacket (dwLidarDecodedPacket const *const packet, dwPointCloudAssemblerHandle_t const obj)
 Push lidar packet to point cloud assembler. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_bindLidarPointCloud (dwLidarPointCloud *const pointCloud, dwPointCloudAssemblerHandle_t const obj)
 Bind output lidar specific point cloud. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_bindOutput (dwPointCloud *const pointCloud, dwPointCloudAssemblerHandle_t const obj)
 Bind output point cloud. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_getCUDAStream (cudaStream_t *const stream, dwPointCloudAssemblerConstHandle_t const obj)
 Get CUDA stream of point cloud assembler. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_getDefaultParams (dwPointCloudAssemblerParams *const params, dwLidarProperties const *const lidarProperties)
 Get default initialization parameters for specified lidar device. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_initialize (dwPointCloudAssemblerHandle_t *const obj, dwPointCloudAssemblerParams const *const params, dwLidarProperties const *const lidarProperties, dwContextHandle_t const ctx)
 Initialize point cloud assembler module. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_isReady (bool *const isReady, dwPointCloudAssemblerConstHandle_t const obj)
 Indicate that lidar frame has been accumulated. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_process (dwPointCloudAssemblerHandle_t const obj)
 Perform processing of accumulated data. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_release (dwPointCloudAssemblerHandle_t const obj)
 Release point cloud assembler. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_reset (dwPointCloudAssemblerHandle_t const obj)
 Reset point cloud assembler. More...
 
DW_API_PUBLIC dwStatus dwPointCloudAssembler_setCUDAStream (cudaStream_t const stream, dwPointCloudAssemblerHandle_t const obj)
 Set CUDA stream of point cloud assembler. More...
 

Data Structure Documentation

◆ dwLidarMotionCompensationInfo

struct dwLidarMotionCompensationInfo
Data Fields
bool compensated True if this pointcloud has been motion compensated.
dwTime_t compensationTimestamp Motion compensation reference timestamp.

◆ dwLidarPointCloud

struct dwLidarPointCloud
Data Fields
dwPointCloudReferenceFrame coordinateFrame Coordinate reference frame for the data in this pointcloud.
dwLidarPointCloudMapping mapping Mapping of returns and aux channels.
dwLidarMotionCompensationInfo motionCompensation Motion compensation information.
dwPointCloud pointCloud Wrapped point cloud.
uint32_t userData[DW_LIDAR_POINT_CLOUD_USER_DATA_SIZE] User defined data.

◆ dwLidarPointCloudMapping

struct dwLidarPointCloudMapping
Data Fields
dwLidarAuxDataType auxType[DW_POINT_CLOUD_MAX_AUX_CHANNELS] Map aux channel from SAL to aux channel of a point cloud.
dwLidarReturnType layerType[DW_POINT_CLOUD_MAX_LAYERS] Map a return type to a layer, i.e.

put into layer i a return type from SAL indicated by layerType[i]

uint32_t numAuxChannels
uint32_t numLayers Number of layers.

◆ dwPointCloud

struct dwPointCloud
Data Fields
dwPointCloudAuxChannel auxChannels[DW_POINT_CLOUD_MAX_AUX_CHANNELS]
uint32_t capacity numLayers * maxPointsPerLayer
dwPointCloudFormat format Format of a buffer.
dwTime_t hostEndTimestamp Point cloud end timestamp.
dwTime_t hostStartTimestamp Point cloud start timestamp.
dwPointCloudLayer layers[DW_POINT_CLOUD_MAX_LAYERS]
uint32_t maxPointsPerLayer Maximum number of points in layer (use even number of points to benefit from aligned memory access per layer if each point is 16 bytes long)
uint32_t numAuxChannels Number of aux channels in a point cloud.
uint32_t numLayers Number of layers in a point cloud.
bool organized Flag indicating the data is ordered on the 3D grid.
void * points Pointer to memory buffer of all points. Not compact, but contiguous with invalid points in between layers.
uint32_t size Number of points in the cloud including all layers.
dwTime_t timestamp Time when the point cloud capturing is finished.
dwMemoryType type Defines type of a memory GPU or CPU.

◆ dwPointCloudAssemblerParams

struct dwPointCloudAssemblerParams
Data Fields
bool enableCuda If set to true, assembling to GPU memory.
dwLidarPointCloudMapping mapping Layers and aux channels mapping.

◆ dwPointCloudAuxChannel

struct dwPointCloudAuxChannel
Data Fields
uint32_t channelIdx Channel index the aux data refers to.
void * data Pointer to the start of the data for this channel.

Number of elements is the size of the point cloud. To access channel[C] for point I, one would do pc.auxChannels[C].data[I]

uint32_t elementSize Size in bytes of an element in the aux buffer.
uint32_t size Number of elements in a channel.

◆ dwPointCloudLayer

struct dwPointCloudLayer
Data Fields
uint32_t layerIdx Index of a layer within a point cloud.
const void * points Pointer to the start of the data for this layer.
uint32_t size Number of points in a layer (.
Note
: points are not compactified, that means there are at most maxPointsPerLayer entries whereby some of them are (0,0,0,0) indicating an invalid point)

Macro Definition Documentation

◆ DW_LIDAR_POINT_CLOUD_USER_DATA_SIZE

#define DW_LIDAR_POINT_CLOUD_USER_DATA_SIZE   8

Number of elements in user buffer.

Definition at line 92 of file LidarPointCloud.h.

◆ DW_POINT_CLOUD_MAX_AUX_CHANNELS

#define DW_POINT_CLOUD_MAX_AUX_CHANNELS   16U

Definition at line 93 of file PointCloud.h.

◆ DW_POINT_CLOUD_MAX_LAYERS

#define DW_POINT_CLOUD_MAX_LAYERS   16U

Definition at line 92 of file PointCloud.h.

Typedef Documentation

◆ dwPointCloudAssemblerConstHandle_t

typedef struct dwPointCloudAssemblerObject const* dwPointCloudAssemblerConstHandle_t

Definition at line 56 of file PointCloudAssembler.h.

◆ dwPointCloudAssemblerHandle_t

typedef struct dwPointCloudAssemblerObject* dwPointCloudAssemblerHandle_t

Definition at line 55 of file PointCloudAssembler.h.

Enumeration Type Documentation

◆ dwPointCloudFormat

Defines point format.

Enumerator
DW_POINTCLOUD_FORMAT_XYZI 

Cartesian 3D coordinate + intensity.

DW_POINTCLOUD_FORMAT_RTHI 

Polar 3D coordinate + intensity.

Definition at line 60 of file PointCloud.h.

◆ dwPointCloudReferenceFrame

Defines point cloud coordinate reference frame.

Enumerator
DW_POINTCLOUD_REFERENCE_FRAME_SENSOR 

Coordinate frame with the sensor at the origin.

DW_POINTCLOUD_REFERENCE_FRAME_RIG 

Coordinate frame with the ego vehicle at the origin.

DW_POINTCLOUD_REFERENCE_FRAME_CUSTOM 

Custom coordinate reference frame.

Definition at line 58 of file LidarPointCloud.h.

Function Documentation

◆ dwLidarPointCloud_create()

DW_API_PUBLIC dwStatus dwLidarPointCloud_create ( dwLidarPointCloud lidarPointCloud,
dwPointCloudFormat const  format,
dwMemoryType const  memoryType,
uint32_t const  maxPointsPerReturn,
dwLidarPointCloudMapping const *  mapping 
)

Create lidar specific point cloud.

Parameters
[out]lidarPointCloudPoint cloud to be created
[in]formatPoint cloud format XYZI or RTHI
[in]memoryTypePoint cloud memory type, CUDA, CPU or PINNED
[in]maxPointsPerReturnMaximum number of points in single lidar return
[in]mappingReturn and aux data mapping
Returns
DW_SUCCESS
DW_INVALID_ARGUMENT If provided pointer to point cloud is null

◆ dwLidarPointCloud_destroy()

DW_API_PUBLIC dwStatus dwLidarPointCloud_destroy ( dwLidarPointCloud lidarPointCloud)

Destroy lidar specific point cloud.

Parameters
[in]lidarPointCloudA pointer to point cloud
Note
The call releases all the memory associated with point cloud.
Returns
DW_SUCCESS
DW_INVALID_HANDLE

◆ dwPointCloud_create()

DW_API_PUBLIC dwStatus dwPointCloud_create ( dwPointCloud pointCloud,
dwPointCloudFormat const  format,
dwMemoryType const  memoryType,
uint32_t const  maxPointsPerLayer,
uint32_t const  numRequestedLayers,
uint32_t const *  auxChannelsElemSize,
uint32_t const  numRequestedAuxChannels 
)

Create point cloud with layers and aux channel information.

Parameters
[out]pointCloudPoint cloud to be created
[in]formatPoint cloud format XYZI or RTHI
[in]memoryTypePoint cloud memory type, CUDA, CPU or PINNED
[in]maxPointsPerLayerMaximum number of points in single layer
[in]numRequestedLayersNumber of layer in a point cloud
[in]auxChannelsElemSizeAn array of auxiliary channel elements sizes
[in]numRequestedAuxChannelsNumber of requested aux channels
Returns
DW_SUCCESS
DW_INVALID_ARGUMENT If provided pointer to point cloud is null

◆ dwPointCloud_createBuffer()

DW_API_PUBLIC dwStatus dwPointCloud_createBuffer ( dwPointCloud buffer)

Allocates memory for point cloud data structure.

Parameters
[out]bufferPointer to dwPointCloud
Returns
DW_SUCCESS
DW_INVALID_ARGUMENT
Note
User must specify the followings for the argument buffer:
  1. The member variable capacity to indicate the memory allocation size
  2. The member variable type to indicate the memory type, either host memory or device memory
Upon successful return, this API will set size to zero to indicate it contains no element in the memory By default this API will set organized to false
This API does not add any information on point cloud layers and auxiliary channels. Upon successful return numLayers and numAuxChannelsare both set to zero.

◆ dwPointCloud_destroy()

DW_API_PUBLIC dwStatus dwPointCloud_destroy ( dwPointCloud pointCloud)

Destroy point cloud buffers.

Parameters
[in]pointCloudA pointer to point cloud
Note
The call releases all the memory associated with point cloud.
Returns
DW_SUCCESS
DW_INVALID_HANDLE

◆ dwPointCloud_destroyBuffer()

DW_API_PUBLIC dwStatus dwPointCloud_destroyBuffer ( dwPointCloud buffer)

Destroys allocated memory for point cloud data structure.

Parameters
[out]bufferPointer to dwPointCloud
Returns
DW_SUCCESS
DW_INVALID_ARGUMENT

◆ dwPointCloudAssembler_addLidarPacket()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_addLidarPacket ( dwLidarDecodedPacket const *const  packet,
dwPointCloudAssemblerHandle_t const  obj 
)

Push lidar packet to point cloud assembler.

Parameters
[in]packetPointer to decoded lidar packet
[in]objModule handle
Returns
DW_SUCCESS - if successfully added packet
DW_INVALID_ARGUMENT - the values included in decoded lidar packet do not match the ones in the lidar properties

◆ dwPointCloudAssembler_bindLidarPointCloud()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_bindLidarPointCloud ( dwLidarPointCloud *const  pointCloud,
dwPointCloudAssemblerHandle_t const  obj 
)

Bind output lidar specific point cloud.

Parameters
[out]pointCloudLidar point cloud
[in]objModule handle
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_INVALID_ARGUMENT - if trying to bind GPU point cloud when cuda is not is not enabled at initialization
DW_SUCCESS

◆ dwPointCloudAssembler_bindOutput()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_bindOutput ( dwPointCloud *const  pointCloud,
dwPointCloudAssemblerHandle_t const  obj 
)

Bind output point cloud.

Parameters
[out]pointCloudLidar point cloud
[in]objModule handle
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_INVALID_ARGUMENT - if trying to bind GPU point cloud when cuda is not is not enabled at initialization
DW_SUCCESS
Note
Output points are either XYZI or RTHI points depending on the format of bound point cloud.

◆ dwPointCloudAssembler_getCUDAStream()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_getCUDAStream ( cudaStream_t *const  stream,
dwPointCloudAssemblerConstHandle_t const  obj 
)

Get CUDA stream of point cloud assembler.

Parameters
[out]streamPointer to CUDA stream handle
[in]objModule handle
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_CALL_NOT_ALLOWED - point cloud assembler is initialized to process host memory
DW_SUCCESS

◆ dwPointCloudAssembler_getDefaultParams()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_getDefaultParams ( dwPointCloudAssemblerParams *const  params,
dwLidarProperties const *const  lidarProperties 
)

Get default initialization parameters for specified lidar device.

Parameters
[out]paramsInitialization parameters
[in]lidarPropertiesLidar properties
Returns
DW_INVALID_ARGUMENT - if one of the given pointers is NULL
DW_SUCCESS

◆ dwPointCloudAssembler_initialize()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_initialize ( dwPointCloudAssemblerHandle_t *const  obj,
dwPointCloudAssemblerParams const *const  params,
dwLidarProperties const *const  lidarProperties,
dwContextHandle_t const  ctx 
)

Initialize point cloud assembler module.

Parameters
[out]objPointer to point cloud assembler handle
[in]paramsInitialization parameters
[in]lidarPropertiesInput lidar properties
[in]ctxHandle to the context
Returns
DW_INVALID_ARGUMENT - if one of the given pointers is NULL
DW_SUCCESS

◆ dwPointCloudAssembler_isReady()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_isReady ( bool *const  isReady,
dwPointCloudAssemblerConstHandle_t const  obj 
)

Indicate that lidar frame has been accumulated.

Parameters
[out]isReadyIf true frame has been accumulated
[in]objModule handle
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_INVALID_ARGUMENT - if provided pointer to a packet is nullptr
DW_SUCCESS

◆ dwPointCloudAssembler_process()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_process ( dwPointCloudAssemblerHandle_t const  obj)

Perform processing of accumulated data.

Parameters
[in]objModule handle
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_NOT_READY - if accumulation is not complete, i.e. dwPointCloudAssembler_isReady returns false DW_CALL_NOT_ALLOWED - if output is not bound DW_SUCCESS
Note
The function return the most recent full spin in output point cloud.

Example:

Arrived packets | First process call | Second process call 0,1,2*,3,4* | {2,3} | DW_NOT_READY 0,1,2*,3,4*,5 | {2,3} | DW_NOT_READY 0,1,2*,3,4*,5,6* | {4,5} | DW_NOT_READY

where numbers denote packet ids and (*) denotes if the packet has zero crossing flag set to true.

◆ dwPointCloudAssembler_release()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_release ( dwPointCloudAssemblerHandle_t const  obj)

Release point cloud assembler.

Parameters
[in]objModule handle
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwPointCloudAssembler_reset()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_reset ( dwPointCloudAssemblerHandle_t const  obj)

Reset point cloud assembler.

Parameters
[in]objModule handle
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwPointCloudAssembler_setCUDAStream()

DW_API_PUBLIC dwStatus dwPointCloudAssembler_setCUDAStream ( cudaStream_t const  stream,
dwPointCloudAssemblerHandle_t const  obj 
)

Set CUDA stream of point cloud assembler.

Parameters
[in]streamHandle to CUDA stream
[in]objModule handle
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_CALL_NOT_ALLOWED - point cloud assembler is initialized to process host memory
DW_SUCCESS