DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

src/dw/sensors/lidar/docs/usecase2.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
2 
3 @page lidar_usecase2 Decode Raw Data
4 
5 #### Decode lidar packet from raw data
6 
7 ```{.cpp}
8 dwSAL_initialize(&sal, sdk);
9 
10 dwSensorHandle_t lidarSensor = DW_NULL_HANDLE;
11 dwSensorParams params;
12 
13 params.parameters = "ip=192.168.3.43,port=2368,device=VELO_HDL64E,scan-frequency=10.0";
14 params.protocol = "lidar.socket";
15 
16 // use the followings if decode lidar packet from lidar recording
17 // params.parameters = "file=lidar_recording.bin";
18 // params.protocol = "lidar.virtual";
19 
20 dwSAL_createSensor(&lidarSensor, params, sal);
21 
22 // disable decoding before sensor starts
23 dwSensorLidar_disableDecoding(lidarSensor);
24 dwSensor_start(...);
25 while(loop) {
26  dwSensor_readRawData(...);
27  dwSensorLidar_processRawData(...);
28 
29  // CODE: use the lidar packets for other tasks
30 
31  dwSensor_returnRawData(...);
32 }
33 dwSensor_stop(...);
34 
35 dwSAL_releaseSensor(&lidarSensor);
36 
37 ```
38 
39 For more details see @ref dwx_record_sample .