DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Lidar Sensor

Detailed Description

Defines the Lidar sensor methods.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwLidarDecodedPacket
 
struct  dwLidarPointRTHI
 
struct  dwLidarPointXYZI
 Holds a Lidar point cloud XYZ and the associated intensity. More...
 
struct  dwLidarProperties
 

Functions

DW_API_PUBLIC dwStatus dwSensorLidar_disableDecoding (dwSensorHandle_t sensor)
 Disable the decoding of the Lidar packets, which frees additional CPU load. More...
 
DW_API_PUBLIC dwStatus dwSensorLidar_enableDecoding (dwSensorHandle_t sensor)
 Enables the decoding of the Lidar packets, which incurs an additional CPU load. More...
 
DW_API_PUBLIC dwStatus dwSensorLidar_getProperties (dwLidarProperties *lidarProperties, dwSensorHandle_t sensor)
 Gets information about the Lidar sensor. More...
 
DW_API_PUBLIC dwStatus dwSensorLidar_isDecodingEnabled (bool *enable, dwSensorHandle_t sensor)
 Retrieves the state of packet decoding. More...
 
DW_API_PUBLIC dwStatus dwSensorLidar_processRawData (const dwLidarDecodedPacket **data, const uint8_t *rawData, size_t size, dwSensorHandle_t sensor)
 Decodes RAW data previously read and returns a pointer to it. More...
 
DW_API_PUBLIC dwStatus dwSensorLidar_readPacket (const dwLidarDecodedPacket **data, dwTime_t timeout_us, dwSensorHandle_t sensor)
 Reads one scan packet. More...
 
DW_API_PUBLIC dwStatus dwSensorLidar_returnPacket (const dwLidarDecodedPacket *scan, dwSensorHandle_t sensor)
 Returns the data read to the internal pool. More...
 

Data Structure Documentation

◆ dwLidarDecodedPacket

struct dwLidarDecodedPacket
Data Fields
dwTime_t duration

Time difference between the first measurement and the last.

dwTime_t hostTimestamp

Timestamp measured on the host.

uint32_t maxPoints

Maximum number of points in the packet.

uint32_t nPoints

Current number of valid points in the packet.

const dwLidarPointRTHI * pointsRTHI

Pointer to the array of points in polar coordinates

const dwLidarPointXYZI * pointsXYZI

Pointer to the array of points in cartesian coordinates

bool scanComplete

Flag to identify if the scan is complete.

dwTime_t sensorTimestamp

Timestamp of the first point in the point cloud packet.

◆ dwLidarPointRTHI

struct dwLidarPointRTHI
Data Fields
float32_t intensity

Reflection intensity in the 0 to 1 range.

float32_t phi

Lidar right-handed polar coord system, vertical, in rads.

float32_t radius

Lidar right-handed polar coord system, distance, in m.

float32_t theta

Lidar right-handed polar coord system, planar, in rads.

◆ dwLidarPointXYZI

struct dwLidarPointXYZI
Data Fields
float32_t intensity

Reflection intensity in the 0 to 1 range.

float32_t x

Lidar right-handed coord system, planar, in meters.

float32_t y

Lidar right-handed coord system, planar, in meters.

float32_t z

Lidar right-handed coord system, vertical, in meters.

◆ dwLidarProperties

struct dwLidarProperties
Data Fields
char8_t deviceString[256]

ASCII string identifying the device.

uint32_t packetsPerSecond

Number of packets per second the sensor produces.

uint32_t packetsPerSpin

Number of packets per sensor full spin.

uint32_t pointsPerPacket

Maximum number of points in a packet.

uint32_t pointsPerSecond

Number of points per second the sensor provides.

uint32_t pointsPerSpin

Maximum number of points on a full sensor spin.

uint32_t pointStride

Number of 'float32' elements per point.

float32_t spinFrequency

Current spin frequency.

Function Documentation

◆ dwSensorLidar_disableDecoding()

DW_API_PUBLIC dwStatus dwSensorLidar_disableDecoding ( dwSensorHandle_t  sensor)

Disable the decoding of the Lidar packets, which frees additional CPU load.

Method fails if the sensor has been started and is capturing data. Stop the sensor first. The default state is to have decoding on. If on, dwSensor_readRawData returns DW_CALL_NOT_ALLOWED.

Parameters
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE, DW_CALL_NOT_ALLOWED, DW_SUCCESS

◆ dwSensorLidar_enableDecoding()

DW_API_PUBLIC dwStatus dwSensorLidar_enableDecoding ( dwSensorHandle_t  sensor)

Enables the decoding of the Lidar packets, which incurs an additional CPU load.

Method fails if the sensor has been started and is capturing data. Stop the sensor first. The default state is to have decoding on. If on, dwSensor_readRawData returns DW_CALL_NOT_ALLOWED.

Parameters
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE, DW_CALL_NOT_ALLOWED, DW_SUCCESS

◆ dwSensorLidar_getProperties()

DW_API_PUBLIC dwStatus dwSensorLidar_getProperties ( dwLidarProperties lidarProperties,
dwSensorHandle_t  sensor 
)

Gets information about the Lidar sensor.

Parameters
[out]lidarPropertiesA pointer to the struct containing the properties of the Lidar.
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwSensorLidar_isDecodingEnabled()

DW_API_PUBLIC dwStatus dwSensorLidar_isDecodingEnabled ( bool *  enable,
dwSensorHandle_t  sensor 
)

Retrieves the state of packet decoding.

Parameters
[out]enableContains the result of the query, which is true when decoding. False if RAW data.
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE, DW_CALL_NOT_ALLOWED, DW_SUCCESS

◆ dwSensorLidar_processRawData()

DW_API_PUBLIC dwStatus dwSensorLidar_processRawData ( const dwLidarDecodedPacket **  data,
const uint8_t *  rawData,
size_t  size,
dwSensorHandle_t  sensor 
)

Decodes RAW data previously read and returns a pointer to it.

This happens on the CPU thread where the function is called, incurring on additional load on that thread. The data is valid until the application calls dwSensor_returnRawData.

Parameters
[out]dataA pointer to the memory pool owned by the sensor.
[in]rawDataA pointer for the non-decoded Lidar packet, returned by 'dwSensor_readRawData()'.
[in]sizeSpecifies the size in bytes of the raw data.
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_AVAILABLE, DW_TIME_OUT, DW_SUCCESS

◆ dwSensorLidar_readPacket()

DW_API_PUBLIC dwStatus dwSensorLidar_readPacket ( const dwLidarDecodedPacket **  data,
dwTime_t  timeout_us,
dwSensorHandle_t  sensor 
)

Reads one scan packet.

The pointer returned is to the internal data pool. DW guarantees that the data remains constant until returned by the application. The data must be explicitly returned by the application.

Parameters
[out]dataA pointer to a pointer that can data read from the sensor. The struct contains the numbers of points read, which depends on the sensor used.
[in]timeout_usSpecifies the timeout in microseconds. Special values: DW_TIMEOUT_INFINITE - to wait infinitly. Zero - means polling of internal queue.
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_AVAILABLE, DW_TIME_OUT, DW_SUCCESS

◆ dwSensorLidar_returnPacket()

DW_API_PUBLIC dwStatus dwSensorLidar_returnPacket ( const dwLidarDecodedPacket scan,
dwSensorHandle_t  sensor 
)

Returns the data read to the internal pool.

At this point the pointer is still be valid, but data is change based on newer readings of the sensor.

Parameters
[in]scanA pointer to the scan data previously read from the Lidar to be returned to the pool.
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_AVAILABLE, DW_TIME_OUT, DW_SUCCESS