DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

sensors/lidar/docs/usecase1.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page lidar_usecase1 Get Decoded Data
4 
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
6 
7 #### Get decoded lidar packet from live lidar sensor
8 
9 ```{.cpp}
10 dwSAL_initialize(&sal, sdk);
11 
12 dwSensorHandle_t lidarSensor = DW_NULL_HANDLE;
13 dwSensorParams params;
14 params.parameters = "ip=192.168.3.43,port=2368,device=VELO_HDL64E,scan-frequency=10.0";
15 params.protocol = "lidar.socket";
16 dwSAL_createSensor(&lidarSensor, params, sal);
17 
18 dwSensor_start(...);
19 
20 // query lidar properties
21 dwLidarProperties lidarProperties;
22 dwSensorLidar_getProperties(&lidarProperties, lidarSensor);
23 
24 while(loop) {
25  dwSensorLidar_readPacket(...);
26 
27  // CODE: use the lidar packets for other tasks
28 
29  dwSensorLidar_returnPacket(...);
30 }
31 dwSensor_stop(...);
32 
33 dwSAL_releaseSensor(&lidarSensor);
34 
35 ```
36 
37 #### Get decoded lidar packet from lidar recordings
38 
39 ```{.cpp}
40 dwSAL_initialize(&sal, sdk);
41 
42 dwSensorHandle_t lidarSensor = DW_NULL_HANDLE;
43 dwSensorParams params;
44 params.parameters = "file=lidar_recording.bin";
45 params.protocol = "lidar.virtual";
46 dwSAL_createSensor(&lidarSensor, params, sal);
47 
48 dwSensor_start(...);
49 
50 // query lidar properties
51 dwLidarProperties lidarProperties;
52 dwSensorLidar_getProperties(&lidarProperties, lidarSensor);
53 
54 while(loop) {
55  dwSensorLidar_readPacket(...);
56 
57  // CODE: use the lidar packets for other tasks
58 
59  dwSensorLidar_returnPacket(...);
60 }
61 dwSensor_stop(...);
62 
63 dwSAL_releaseSensor(&lidarSensor);
64 
65 ```
66 
67 For more details see @ref dwx_lidar_replay_sample