DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

pointcloudprocessing/docs/usecase1.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page pointcloudprocessing_usecase1 Point Cloud Memory Management
4 
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
6 
7 This tutorial demonstrates how point cloud processing creates and destroys CPU/CUDA memory.
8 
9 Point cloud processing provides APIs to create either CPU or CUDA memory.
10 
11 For example, specify a CUDA memory type:
12 
13 ```{.cpp}
14 dwPointCloud pointcloud;
15 pointcloud.type = DW_MEMORY_TYPE_CUDA;
16 pointcloud.coordSystem = DW_POINTCLOUD_COORDINATE_SYSTEM_CARTESIAN;
17 ```
18 
19 Set .type = ::DW_MEMORY_TYPE_CPU if CPU memory is intended. Initialize `capacity` in `dwPointCloud` to indicate the maximum storage,
20 
21 ```{.cpp}
22 pointcloud.capacity = 20000;
23 ```
24 
25 Create CUDA memory holding up to 20000 cloud of points:
26 
27 ```{.cpp}
28 dwPointCloud_createBuffer(&pointcloud);
29 ```
30 
31 The created memory holds points. Format of a point is specified with `dwPointCloudFormat` enum. .size will be zero upon successful memory creation. As it indicates there is currently no active point in the memory. `dwPointCloud_createBuffer()` will set .organized to false. To understand the difference between .organized = true and .organized = false, see @ref pointcloudprocessing_usecase2
32 
33 To destroy the allocated CUDA memory:
34 
35 ```{.cpp}
36 dwPointCloud_destroyBuffer(&pointcloud);
37 ```
38 
39 @note Point cloud buffers are owned by the application, user can waive the memory copy from the module.
40 
41 For more details see @ref dwx_pointcloudprocessing_sample.