DriveWorks SDK Reference
5.16.65 Release
For Test and Development only

Lidar.h
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
47#ifndef DW_SENSORS_LIDAR_LIDAR_H_
48#define DW_SENSORS_LIDAR_LIDAR_H_
49
50#include <dw/core/base/Types.h>
51
52#include <dw/sensors/Sensors.h>
53#include <stdalign.h>
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
66typedef enum {
83
87typedef enum {
111
115typedef enum {
118
121
124
127
133
135
137#define DW_SENSORS_LIDAR_MAX_RETURNS 10
138
140typedef struct dwLidarPointXYZI
141{
142 alignas(16) float32_t x;
147
149typedef struct dwLidarPointRTHI
150{
151 alignas(16) float32_t theta;
156
157#define DW_SENSORS_LIDAR_MAX_ROWS 256
160typedef struct dwLidarProperties
161{
162 char8_t deviceString[256];
167 uint32_t packetsPerSpin;
171 uint32_t pointsPerSpin;
172 uint32_t pointStride;
177 uint32_t numberOfRows;
192
195
198
202
205{
208 uint32_t maxPoints;
209 uint32_t numPoints;
219
226
228typedef struct _dwLidarDecodedSSI dwLidarDecodedSSI;
229
233{
239 uint32_t maxPoints;
240
242 uint32_t nPoints;
243
253
256
260 uint8_t numReturns;
266
276dwStatus dwSensorLidar_getAuxElementSize(uint32_t* const sizeBytes, dwLidarAuxDataType const auxType);
277
290
303
314
334 dwSensorHandle_t const sensor);
335
349
365dwStatus dwSensorLidar_processRawData(dwLidarDecodedPacket const** const data, uint8_t const* const rawData, size_t const size,
366 dwSensorHandle_t const sensor);
367
380
392dwStatus dwSensorLidar_sendMessage(uint32_t const cmd, uint8_t const* const data,
393 size_t const size, dwSensorHandle_t const sensor);
394
395#ifdef __cplusplus
396}
397#endif
398
400#endif // DW_SENSORS_LIDAR_LIDAR_H_
dwStatus
Status definition.
Definition: ErrorDefs.h:44
NVIDIA DriveWorks API: Sensors
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: BasicTypes.h:59
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: BasicTypes.h:65
#define DW_API_PUBLIC
Definition: Exports.h:56
dwTime_t hostTimestamp
Definition: Lidar.h:234
float32_t azimuthOffsetRad
Definition: Lidar.h:258
float32_t theta
Definition: Lidar.h:151
uint32_t packetsPerSecond
Definition: Lidar.h:166
dwTime_t sensorTimestamp
Definition: Lidar.h:235
float32_t minHorizontalAngleRad
Definition: Lidar.h:244
size_t lidarSSISizeInBytes
LidarSSI size in bytes, so user know the memory to be allocated for dwLidarDecodedPacket....
Definition: Lidar.h:200
dwLidarDecodedSSI const * lidarSSI
lidar supplement status info such as misc and health info
Definition: Lidar.h:264
uint32_t maxPoints
Definition: Lidar.h:208
dwLidarPointRTHI const * pointsRTHI
Pointer to the array of points in polar coordinates.
Definition: Lidar.h:252
float32_t x
Definition: Lidar.h:142
float32_t elevationOffsetRad
Definition: Lidar.h:257
float32_t y
Definition: Lidar.h:143
dwLidarPointXYZI const * pointsXYZI
Pointer to the array of points in cartesian coordinates.
Definition: Lidar.h:255
float32_t intensity
Definition: Lidar.h:145
uint32_t pointStride
Definition: Lidar.h:172
dwLidarPointRTHI const * pointsRTHI
Definition: Lidar.h:211
uint32_t pointsPerPacket
Definition: Lidar.h:170
float32_t intensity
Definition: Lidar.h:154
uint32_t maxPoints
Maximum number of points in the pointsRTHI and pointsXYZI arrays in the packet.
Definition: Lidar.h:239
char8_t deviceString[256]
Definition: Lidar.h:162
float32_t verticalAngles[DW_SENSORS_LIDAR_MAX_ROWS]
Lidar right-handed polar coord system, vertical angles in spin frame, in rads, length of array with v...
Definition: Lidar.h:186
float32_t radius
Definition: Lidar.h:153
uint32_t pointsPerSpin
Definition: Lidar.h:171
float32_t verticalFOVEnd
Definition: Lidar.h:180
uint8_t numReturns
Definition: Lidar.h:260
dwLidarDecodedReturn returnData[DW_SENSORS_LIDAR_MAX_RETURNS]
Definition: Lidar.h:261
uint32_t packetsPerSpin
Definition: Lidar.h:167
float32_t horizontalAngles[DW_SENSORS_LIDAR_MAX_ROWS]
Lidar right-handed polar coord system, intrinsic horizontal angle offsets in spin frame,...
Definition: Lidar.h:191
uint32_t numPoints
Definition: Lidar.h:209
dwLidarReturnType availableReturns
Bitmask of return types the lidar is configured to.
Definition: Lidar.h:194
float32_t phi
Definition: Lidar.h:152
uint32_t pointsPerSecond
Definition: Lidar.h:169
float32_t maxHorizontalAngleRad
Definition: Lidar.h:245
void const * auxData[DW_LIDAR_AUX_DATA_TYPE_COUNT]
Array of pointers to auxiliary data Supported aux data types are listed in lidar properties.
Definition: Lidar.h:218
float32_t horizontalFOVStart
Definition: Lidar.h:174
float32_t spinFrequency
Definition: Lidar.h:164
uint32_t auxDataSize[DW_LIDAR_AUX_DATA_TYPE_COUNT]
Data element size for each type of aux data.
Definition: Lidar.h:224
float32_t maxVerticalAngleRad
Definition: Lidar.h:247
dwTime_t duration
Definition: Lidar.h:236
dwLidarReturnType type
Definition: Lidar.h:206
uint32_t nPoints
Current number of valid points in the pointsRTHI and pointsXYZI arrays in the packet.
Definition: Lidar.h:242
uint32_t numberOfRows
Definition: Lidar.h:177
float32_t z
Definition: Lidar.h:144
float32_t verticalFOVStart
Definition: Lidar.h:179
float32_t minVerticalAngleRad
Definition: Lidar.h:246
float32_t horizontalFOVEnd
Definition: Lidar.h:175
uint64_t validAuxInfos
Bitmask of valid aux info fields based on enum dwLidarAuxDataType.
Definition: Lidar.h:197
DW_API_PUBLIC dwStatus dwSensorLidar_enableDecoding(dwSensorHandle_t const sensor)
Enables the decoding of the Lidar packets, which incurs an additional CPU load.
DW_API_PUBLIC dwStatus dwSensorLidar_isDecodingEnabled(bool *const enable, dwSensorHandle_t const sensor)
Retrieves the state of packet decoding.
struct _dwLidarDecodedSSI dwLidarDecodedSSI
Not available as of current release. Will be added in future release.
Definition: Lidar.h:228
DW_API_PUBLIC dwStatus dwSensorLidar_returnPacket(dwLidarDecodedPacket const *const data, dwSensorHandle_t const sensor)
Returns the data read to the internal pool.
DW_API_PUBLIC dwStatus dwSensorLidar_getProperties(dwLidarProperties *const lidarProperties, dwSensorHandle_t const sensor)
Gets information about the Lidar sensor.
#define DW_SENSORS_LIDAR_MAX_RETURNS
Maximum number of distinct lidar returns a point cloud can contain.
Definition: Lidar.h:137
dwLidarAuxDataType
An enum for every data element we could possibly return.
Definition: Lidar.h:87
#define DW_SENSORS_LIDAR_MAX_ROWS
Definition: Lidar.h:157
DW_API_PUBLIC dwStatus dwSensorLidar_getAuxElementSize(uint32_t *const sizeBytes, dwLidarAuxDataType const auxType)
Returns size of auxiliary data element in bytes.
DW_API_PUBLIC dwStatus dwSensorLidar_sendMessage(uint32_t const cmd, uint8_t const *const data, size_t const size, dwSensorHandle_t const sensor)
Sends a message to Lidar sensor.
dwLidarInvalidityFlag
An enum for specifying invalidity flags.
Definition: Lidar.h:115
DW_API_PUBLIC dwStatus dwSensorLidar_processRawData(dwLidarDecodedPacket const **const data, uint8_t const *const rawData, size_t const size, dwSensorHandle_t const sensor)
Decodes RAW data previously read and returns a pointer to it.
DW_API_PUBLIC dwStatus dwSensorLidar_disableDecoding(dwSensorHandle_t const sensor)
Disable the decoding of the Lidar packets, which frees additional CPU load.
DW_API_PUBLIC dwStatus dwSensorLidar_readPacket(dwLidarDecodedPacket const **const data, dwTime_t const timeoutUs, dwSensorHandle_t const sensor)
Reads one scan packet.
dwLidarReturnType
Enum to indicate a single return type.
Definition: Lidar.h:66
@ DW_LIDAR_AUX_DATA_TYPE_LINEID
LINEID type.
Definition: Lidar.h:97
@ DW_LIDAR_AUX_DATA_TYPE_BLOCKAGEFLAG
BLOCKAGEFLAG type.
Definition: Lidar.h:100
@ DW_LIDAR_AUX_DATA_TYPE_EXISTENCEPROB
EXISTENCEPROB type.
Definition: Lidar.h:92
@ DW_LIDAR_AUX_DATA_TYPE_COUNT
COUNT type.
Definition: Lidar.h:108
@ DW_LIDAR_AUX_DATA_TYPE_ELEVATION
ELEVATION type.
Definition: Lidar.h:103
@ DW_LIDAR_AUX_DATA_TYPE_DATAQUALITY
DATAQUALITY type.
Definition: Lidar.h:98
@ DW_LIDAR_AUX_DATA_TYPE_SENSORID
SENSORID type.
Definition: Lidar.h:101
@ DW_LIDAR_AUX_DATA_TYPE_DISTANCE
DISTANCE type.
Definition: Lidar.h:104
@ DW_LIDAR_AUX_DATA_TYPE_CROSSTALKPROB
CROSSTALKPROB type.
Definition: Lidar.h:93
@ DW_LIDAR_AUX_DATA_TYPE_SNR
SNR type.
Definition: Lidar.h:88
@ DW_LIDAR_AUX_DATA_TYPE_DETECTORID
DETECTORID type.
Definition: Lidar.h:96
@ DW_LIDAR_AUX_DATA_TYPE_V_MPS
V_MPS type.
Definition: Lidar.h:91
@ DW_LIDAR_AUX_DATA_TYPE_VALIDITY
VALIDITY type.
Definition: Lidar.h:106
@ DW_LIDAR_AUX_DATA_TYPE_AZIMUTH
AZIMUTH type.
Definition: Lidar.h:102
@ DW_LIDAR_AUX_DATA_TYPE_SCANCHECKPOINT
SCANCHECKPOINT type.
Definition: Lidar.h:99
@ DW_LIDAR_AUX_DATA_TYPE_ZONEID
ZONEID type.
Definition: Lidar.h:95
@ DW_LIDAR_AUX_DATA_TYPE_PULSEWIDTH_PS
PULSEWIDTH_PS type.
Definition: Lidar.h:89
@ DW_LIDAR_AUX_DATA_TYPE_TIME
TIME type.
Definition: Lidar.h:90
@ DW_LIDAR_AUX_DATA_TYPE_FORCE32
Definition: Lidar.h:109
@ DW_LIDAR_AUX_DATA_TYPE_ROI
ROI type.
Definition: Lidar.h:105
@ DW_LIDAR_AUX_DATA_TYPE_NOISELEVEL
NOISELEVEL type.
Definition: Lidar.h:94
@ DW_LIDAR_AUX_DATA_TYPE_INVALIDITYFLAG
INVALIDITYFLAG type.
Definition: Lidar.h:107
@ DW_LIDAR_INVALIDITY_VEND
Vendor-specific validity flags.
Definition: Lidar.h:123
@ DW_LIDAR_INVALIDITY_INVALID
Point is not valid if any of flags are set.
Definition: Lidar.h:129
@ DW_LIDAR_INVALIDITY_DW
DriveWorks-specific validity flags.
Definition: Lidar.h:120
@ DW_LIDAR_INVALIDITY_NONE
No flags are set.
Definition: Lidar.h:117
@ DW_LIDAR_INVALIDITY_BLOCKAGE
Blockage validity flags.
Definition: Lidar.h:126
@ DW_LIDAR_RETURN_TYPE_5
Definition: Lidar.h:80
@ DW_LIDAR_RETURN_TYPE_FIRST
Definition: Lidar.h:69
@ DW_LIDAR_RETURN_TYPE_6
Definition: Lidar.h:81
@ DW_LIDAR_RETURN_TYPE_1
Definition: Lidar.h:76
@ DW_LIDAR_RETURN_TYPE_ANY
Definition: Lidar.h:67
@ DW_LIDAR_RETURN_TYPE_STRONGEST
Definition: Lidar.h:71
@ DW_LIDAR_RETURN_TYPE_4
Definition: Lidar.h:79
@ DW_LIDAR_RETURN_TYPE_LAST
Definition: Lidar.h:70
@ DW_LIDAR_RETURN_TYPE_2
Definition: Lidar.h:77
@ DW_LIDAR_RETURN_TYPE_ABS_STRONGEST
Definition: Lidar.h:72
@ DW_LIDAR_RETURN_TYPE_3
Definition: Lidar.h:78
Defines the structure for a decoded lidar packet.
Definition: Lidar.h:233
Defines the return structure for an extended decoded lidar packet.
Definition: Lidar.h:205
Holds a Lidar point cloud RTHI and the associated intensity.
Definition: Lidar.h:150
Holds a Lidar point cloud XYZ and the associated intensity.
Definition: Lidar.h:141
Defines the properties of the lidar.
Definition: Lidar.h:161
struct dwSensorObject * dwSensorHandle_t
Handle representing a sensor.
Definition: Sensors.h:88