DriveWorks SDK Reference

| 0.6.67 Release

icp.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
31 #ifndef DW_ICP_HPP__
32 #define DW_ICP_HPP__
33 
34 #include <dw/core/Types.h>
35 #include <dw/sensors/lidar/Lidar.h>
36 #include <math.h>
37 #include "cuda_runtime.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 
62 typedef struct dwICPHandle *dwICPHandle_t;
63 
64 typedef enum dwICPType{
73 
74 } dwICPType;
75 
79 typedef struct dwICPParams {
80 
83  uint32_t maxPoints;
84 
86  dwICPType icpType;
87 
89  cudaStream_t stream;
90 
92 
95 typedef dwBool (*dwICPConvergenceCheck)(const dwTransformation* prevSrc2Tgt, const dwTransformation* newSrc2Tgt, void* userData);
96 
103 typedef struct dwICPIterationParams {
104 
108 
110  uint64_t nSourcePts;
111  uint64_t nTargetPts;
112 
115  const dwTransformation* initialSource2Target;
117 
123 typedef struct dwICPResultStats {
131 
144 dwStatus dwICP_initialize(dwICPHandle_t *icpObj, const dwICPParams *params, dwContextHandle_t ctx);
145 
162 dwStatus dwICP_optimize(dwTransformation *outSrc2Tgt, const dwICPIterationParams *iParams, dwICPHandle_t icpObj);
163 
173 dwStatus dwICP_reset(dwICPHandle_t icpObj);
174 
186 dwStatus dwICP_setConvergenceCriteriaCallback(dwICPConvergenceCheck callback, void* userData, dwICPHandle_t icpObj);
187 
201 dwStatus dwICP_setConvergenceTolerance(float32_t angleTol, float32_t distanceTol, dwICPHandle_t icpObj);
202 
214 dwStatus dwICP_setMaxIterations(uint16_t maxIterations, dwICPHandle_t icpObj);
215 
227 dwStatus dwICP_getLastResultStats(dwICPResultStats* resultStats, dwICPHandle_t icpObj);
228 
240 dwStatus dwICP_setCUDAStream(cudaStream_t stream, dwICPHandle_t icpObj);
241 
253 dwStatus dwICP_getCUDAStream(cudaStream_t* stream, dwICPHandle_t icpObj);
254 
265 dwStatus dwICP_release(dwICPHandle_t *icpObj);
266 
267 #ifdef __cplusplus
268 }
269 #endif
270 
271 #endif // DW_ICP_HPP
272 
273 
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:77
NVIDIA DriveWorks API: Lidar
dwICPType icpType
Type of the ICP implementation to be used.
Definition: icp.h:86
DW_API_PUBLIC dwStatus dwICP_optimize(dwTransformation *outSrc2Tgt, const dwICPIterationParams *iParams, dwICPHandle_t icpObj)
Perform ICP between 2 pointclouds.
Paramter for running ICP between two frames.
Definition: icp.h:103
uint64_t nTargetPts
Definition: icp.h:111
Some result stats about the most recent ICP run.
Definition: icp.h:123
uint32_t maxPoints
Maximum number of points that will be pushed to the ICP optimization.
Definition: icp.h:83
DW_API_PUBLIC dwStatus dwICP_getCUDAStream(cudaStream_t *stream, dwICPHandle_t icpObj)
Fetches the ICP module&#39;s cuda in a pointer.
cudaStream_t stream
CudaStream, all the ICP works happens in this stream, can be 0 for default stream.
Definition: icp.h:89
dwBool(* dwICPConvergenceCheck)(const dwTransformation *prevSrc2Tgt, const dwTransformation *newSrc2Tgt, void *userData)
Callback function to be executed by ICP module allowing user to overwrite default convergence criteri...
Definition: icp.h:95
const dwLidarPointXYZI * targetPts
Definition: icp.h:107
Holds a Lidar point cloud XYZ and the associated intensity.
Definition: Lidar.h:57
DW_API_PUBLIC dwStatus dwICP_initialize(dwICPHandle_t *icpObj, const dwICPParams *params, dwContextHandle_t ctx)
Initializes the ICP module.
DW_API_PUBLIC dwStatus dwICP_setMaxIterations(uint16_t maxIterations, dwICPHandle_t icpObj)
Set maximum number of iterations which need to be executed.
uint64_t nSourcePts
Sizes of the above arrays, need to be smaller than maxPoints passed via dwICPParams to dwICP_initiali...
Definition: icp.h:110
dwStatus
Status definition.
Definition: Status.h:167
Parameters that control the initialization for ICP module.
Definition: icp.h:79
DW_API_PUBLIC dwStatus dwICP_setConvergenceCriteriaCallback(dwICPConvergenceCheck callback, void *userData, dwICPHandle_t icpObj)
Set callback to be executed to test convergence.
const dwLidarPointXYZI * sourcePts
Arrays of points, sourcePts need to be transformed by the resulting dwTransformation to align to Targ...
Definition: icp.h:106
DW_API_PUBLIC dwStatus dwICP_release(dwICPHandle_t *icpObj)
Releases an ICP module.
const dwTransformation * initialSource2Target
This column major transform will be applied to the source points before ICP is performed.
Definition: icp.h:115
uint8_t dwBool
Definition: Types.h:79
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:78
dwICPType
Definition: icp.h:64
struct dwICPHandle * dwICPHandle_t
Definition: icp.h:62
DW_API_PUBLIC dwStatus dwICP_getLastResultStats(dwICPResultStats *resultStats, dwICPHandle_t icpObj)
Get stats about latest ICP run.
float32_t rmsCost
RMS (weighted) cost after last ICP iteration.
Definition: icp.h:127
#define DW_API_PUBLIC
Definition: Exports.h:76
ICP implementation optimized for unstructured lidar based point clouds.
Definition: icp.h:72
DW_API_PUBLIC dwStatus dwICP_setConvergenceTolerance(float32_t angleTol, float32_t distanceTol, dwICPHandle_t icpObj)
Set tolerances used by the default ICP convergence criteria method.
float32_t inlierFraction
Fraction of points which are inliers to the final ICP pose.
Definition: icp.h:129
DW_API_PUBLIC dwStatus dwICP_setCUDAStream(cudaStream_t stream, dwICPHandle_t icpObj)
Resets the ICP module&#39;s cuda stream to new stream.
uint32_t actualNumIterations
How many iterations were actually performed.
Definition: icp.h:125
DW_API_PUBLIC dwStatus dwICP_reset(dwICPHandle_t icpObj)
Resets the ICP module, clears any data or containers to just-initialized state.