DriveWorks SDK Reference
5.8.83 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-2022 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 {
108
112typedef enum {
115
117 DW_LIDAR_INVALIDITY_DW = 1 << 0,
118
121
124
126
128#define DW_SENSORS_LIDAR_MAX_RETURNS 10
129
131typedef struct dwLidarPointXYZI
132{
133 alignas(16) float32_t x;
138
140typedef struct dwLidarPointRTHI
141{
142 alignas(16) float32_t theta;
147
148#define DW_SENSORS_LIDAR_MAX_ROWS 256
151typedef struct dwLidarProperties
152{
153 char8_t deviceString[256];
158 uint32_t packetsPerSpin;
162 uint32_t pointsPerSpin;
163 uint32_t pointStride;
168 uint32_t numberOfRows;
183
186
190
193{
196 uint32_t maxPoints;
197 uint32_t numPoints;
208
210
214{
222 uint32_t maxPoints;
223
227 uint32_t nPoints;
228
240
245
249 uint8_t numReturns;
252
262dwStatus dwSensorLidar_getAuxElementSize(uint32_t* const sizeBytes, dwLidarAuxDataType const auxType);
263
276
289
301
319 dwSensorHandle_t const sensor);
320
334
350dwStatus dwSensorLidar_processRawData(dwLidarDecodedPacket const** const data, uint8_t const* const rawData, size_t const size,
351 dwSensorHandle_t const sensor);
352
364
365/*
366* Sends a message to Lidar sensor.
367*
368* @param[in] cmd Command identifier associated to the given message data.
369* @param[in] data A pointer to the message data.
370* @param[in] size Size in bytes of the \p data.
371* @param[in] sensor Specifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
372*
373* @return DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_SUPPORTED, DW_FAILURE, DW_SUCCESS
374*
375*/
377dwStatus dwSensorLidar_sendMessage(uint32_t const cmd, uint8_t const* const data,
378 size_t const size, dwSensorHandle_t const sensor);
379
380#ifdef __cplusplus
381}
382#endif
383
385#endif // DW_SENSORS_LIDAR_LIDAR_H_
NVIDIA DriveWorks API: Sensors
NVIDIA DriveWorks API: Core Types
#define DW_API_PUBLIC
Definition: Exports.h:54
dwStatus
Status definition.
Definition: Status.h:171
float float32_t
Specifies POD types.
Definition: Types.h:70
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
dwTime_t hostTimestamp
Definition: Lidar.h:215
float32_t azimuthOffsetRad
Definition: Lidar.h:247
float32_t theta
Definition: Lidar.h:142
uint32_t packetsPerSecond
Definition: Lidar.h:157
dwTime_t sensorTimestamp
Definition: Lidar.h:216
float32_t minHorizontalAngleRad
Definition: Lidar.h:229
uint32_t maxPoints
Definition: Lidar.h:196
dwLidarPointRTHI const * pointsRTHI
Pointer to the array of points in polar coordinates.
Definition: Lidar.h:239
float32_t x
Definition: Lidar.h:133
float32_t elevationOffsetRad
Definition: Lidar.h:246
float32_t y
Definition: Lidar.h:134
dwLidarPointXYZI const * pointsXYZI
Pointer to the array of points in cartesian coordinates.
Definition: Lidar.h:244
float32_t intensity
Definition: Lidar.h:136
uint32_t pointStride
Definition: Lidar.h:163
dwLidarPointRTHI const * pointsRTHI
Definition: Lidar.h:199
uint32_t pointsPerPacket
Definition: Lidar.h:161
float32_t intensity
Definition: Lidar.h:145
uint32_t maxPoints
Maximum number of points in the pointsRTHI and pointsXYZI arrays in the packet.
Definition: Lidar.h:222
char8_t deviceString[256]
Definition: Lidar.h:153
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:177
float32_t radius
Definition: Lidar.h:144
uint32_t pointsPerSpin
Definition: Lidar.h:162
float32_t verticalFOVEnd
Definition: Lidar.h:171
uint8_t numReturns
Definition: Lidar.h:249
dwLidarDecodedReturn returnData[DW_SENSORS_LIDAR_MAX_RETURNS]
Definition: Lidar.h:250
uint32_t packetsPerSpin
Definition: Lidar.h:158
float32_t horizontalAngles[DW_SENSORS_LIDAR_MAX_ROWS]
Lidar right-handed polar coord system, intrinsic horizontal angle offsets in spin frame,...
Definition: Lidar.h:182
uint32_t numPoints
Definition: Lidar.h:197
dwLidarReturnType availableReturns
Bitmask of return types the lidar is configured to.
Definition: Lidar.h:185
float32_t phi
Definition: Lidar.h:143
uint32_t pointsPerSecond
Definition: Lidar.h:160
float32_t maxHorizontalAngleRad
Definition: Lidar.h:230
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:207
float32_t horizontalFOVStart
Definition: Lidar.h:165
float32_t spinFrequency
Definition: Lidar.h:155
float32_t maxVerticalAngleRad
Definition: Lidar.h:232
dwTime_t duration
Definition: Lidar.h:217
dwLidarReturnType type
Definition: Lidar.h:194
uint32_t nPoints
Current number of valid points in the pointsRTHI and pointsXYZI arrays in the packet.
Definition: Lidar.h:227
uint32_t numberOfRows
Definition: Lidar.h:168
float32_t z
Definition: Lidar.h:135
float32_t verticalFOVStart
Definition: Lidar.h:170
float32_t minVerticalAngleRad
Definition: Lidar.h:231
float32_t horizontalFOVEnd
Definition: Lidar.h:166
uint64_t validAuxInfos
Bitmask of valid aux info fields based on enum dwLidarAuxDataType.
Definition: Lidar.h:188
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.
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:128
dwLidarAuxDataType
An enum for every data element we could possibly return.
Definition: Lidar.h:87
#define DW_SENSORS_LIDAR_MAX_ROWS
Definition: Lidar.h:148
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)
dwLidarInvalidityFlag
An enum for specifying invalidity flags.
Definition: Lidar.h:112
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
Definition: Lidar.h:98
@ DW_LIDAR_AUX_DATA_TYPE_BLOCKAGEFLAG
Definition: Lidar.h:101
@ DW_LIDAR_AUX_DATA_TYPE_EXISTENCEPROB
Definition: Lidar.h:93
@ DW_LIDAR_AUX_DATA_TYPE_COUNT
Definition: Lidar.h:105
@ DW_LIDAR_AUX_DATA_TYPE_DATAQUALITY
Definition: Lidar.h:99
@ DW_LIDAR_AUX_DATA_TYPE_SENSORID
Definition: Lidar.h:102
@ DW_LIDAR_AUX_DATA_TYPE_CROSSTALKPROB
Definition: Lidar.h:94
@ DW_LIDAR_AUX_DATA_TYPE_SNR
Definition: Lidar.h:88
@ DW_LIDAR_AUX_DATA_TYPE_DETECTORID
Definition: Lidar.h:97
@ DW_LIDAR_AUX_DATA_TYPE_V_MPS
Definition: Lidar.h:92
@ DW_LIDAR_AUX_DATA_TYPE_VALIDITY
Definition: Lidar.h:103
@ DW_LIDAR_AUX_DATA_TYPE_SCANCHECKPOINT
Definition: Lidar.h:100
@ DW_LIDAR_AUX_DATA_TYPE_ZONEID
Definition: Lidar.h:96
@ DW_LIDAR_AUX_DATA_TYPE_SIGNALWIDTH
Definition: Lidar.h:89
@ DW_LIDAR_AUX_DATA_TYPE_SIGNALHEIGHT
Definition: Lidar.h:90
@ DW_LIDAR_AUX_DATA_TYPE_TIME
Definition: Lidar.h:91
@ DW_LIDAR_AUX_DATA_TYPE_FORCE32
Definition: Lidar.h:106
@ DW_LIDAR_AUX_DATA_TYPE_NOISELEVEL
Definition: Lidar.h:95
@ DW_LIDAR_AUX_DATA_TYPE_INVALIDITYFLAG
Definition: Lidar.h:104
@ DW_LIDAR_INVALIDITY_VEND
Definition: Lidar.h:120
@ DW_LIDAR_INVALIDITY_INVALID
Definition: Lidar.h:123
@ DW_LIDAR_INVALIDITY_DW
Definition: Lidar.h:117
@ DW_LIDAR_INVALIDITY_NONE
Definition: Lidar.h:114
@ 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:214
Defines the return structure for an extended decoded lidar packet.
Definition: Lidar.h:193
Holds a Lidar point cloud RTHI and the associated intensity.
Definition: Lidar.h:141
Holds a Lidar point cloud XYZ and the associated intensity.
Definition: Lidar.h:132
Defines the properties of the lidar.
Definition: Lidar.h:152
struct dwSensorObject * dwSensorHandle_t
Handle representing a sensor.
Definition: Sensors.h:86