Provides functions to align a pair of pointclouds using ICP.
The module provides multiple implementation of point-to-plane ICP.
|
| typedef dwBool(* | dwICPConvergenceCheck) (const dwTransformation *prevSrc2Tgt, const dwTransformation *newSrc2Tgt, void *userData) |
| | Callback function to be executed by ICP module allowing user to overwrite default convergence criteria method. More...
|
| |
| typedef struct dwICPHandle * | dwICPHandle_t |
| |
|
| DW_API_PUBLIC dwStatus | dwICP_getCUDAStream (cudaStream_t *stream, dwICPHandle_t icpObj) |
| | Fetches the ICP module's cuda in a pointer. More...
|
| |
| DW_API_PUBLIC dwStatus | dwICP_getLastResultStats (dwICPResultStats *resultStats, dwICPHandle_t icpObj) |
| | Get stats about latest ICP run. More...
|
| |
| DW_API_PUBLIC dwStatus | dwICP_initialize (dwICPHandle_t *icpObj, const dwICPParams *params, dwContextHandle_t ctx) |
| | Initializes the ICP module. More...
|
| |
| DW_API_PUBLIC dwStatus | dwICP_optimize (dwTransformation *outSrc2Tgt, const dwICPIterationParams *iParams, dwICPHandle_t icpObj) |
| | Perform ICP between 2 pointclouds. More...
|
| |
| DW_API_PUBLIC dwStatus | dwICP_release (dwICPHandle_t *icpObj) |
| | Releases an ICP module. More...
|
| |
| DW_API_PUBLIC dwStatus | dwICP_reset (dwICPHandle_t icpObj) |
| | Resets the ICP module, clears any data or containers to just-initialized state. More...
|
| |
| DW_API_PUBLIC dwStatus | dwICP_setConvergenceCriteriaCallback (dwICPConvergenceCheck callback, void *userData, dwICPHandle_t icpObj) |
| | Set callback to be executed to test convergence. More...
|
| |
| 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. More...
|
| |
| DW_API_PUBLIC dwStatus | dwICP_setCUDAStream (cudaStream_t stream, dwICPHandle_t icpObj) |
| | Resets the ICP module's cuda stream to new stream. More...
|
| |
| DW_API_PUBLIC dwStatus | dwICP_setMaxIterations (uint16_t maxIterations, dwICPHandle_t icpObj) |
| | Set maximum number of iterations which need to be executed. More...
|
| |
◆ dwICPIterationParams
| struct dwICPIterationParams |
| Data Fields |
|
const dwTransformation * |
initialSource2Target |
This column major transform will be applied to the source points before ICP is performed. Final returned transformation will not be pre-multiplied with this
|
|
uint64_t |
nSourcePts |
Sizes of the above arrays, need to be smaller than maxPoints passed via dwICPParams to dwICP_initialize. |
|
uint64_t |
nTargetPts |
|
|
const dwLidarPointXYZI * |
sourcePts |
Arrays of points, sourcePts need to be transformed by the resulting dwTransformation to align to TargetPts. |
|
const dwLidarPointXYZI * |
targetPts |
|
◆ dwICPParams
| Data Fields |
|
dwICPType |
icpType |
Type of the ICP implementation to be used. |
|
uint32_t |
maxPoints |
Maximum number of points that will be pushed to the ICP optimization. Depending on the implementation this number might be limited (see description of the corresponding method)
|
|
cudaStream_t |
stream |
CudaStream, all the ICP works happens in this stream, can be 0 for default stream. |
◆ dwICPResultStats
| Data Fields |
|
uint32_t |
actualNumIterations |
How many iterations were actually performed. |
|
float32_t |
inlierFraction |
Fraction of points which are inliers to the final ICP pose. |
|
float32_t |
rmsCost |
RMS (weighted) cost after last ICP iteration. |
◆ dwICPConvergenceCheck
| typedef dwBool(* dwICPConvergenceCheck) (const dwTransformation *prevSrc2Tgt, const dwTransformation *newSrc2Tgt, void *userData) |
Callback function to be executed by ICP module allowing user to overwrite default convergence criteria method.
The method will receive original and new transformations as computed by the ICP module
Definition at line 95 of file icp.h.
◆ dwICPHandle_t
Definition at line 62 of file icp.h.
◆ dwICPType
| Enumerator |
|---|
| DW_ICP_TYPE_LIDAR_POINT_CLOUD | ICP implementation optimized for unstructured lidar based point clouds.
A certain corelation of the input points to their index in dwICPIterationParams::[source|target]Pts is expected for good results.
- Note
- This implementation supports not more than 2^15 points for source and target. If a point cloud is pushed with higher number of points, it will generate a DW_INVALID_ARGUMENT error.
|
Definition at line 64 of file icp.h.
◆ dwICP_getCUDAStream()
Fetches the ICP module's cuda in a pointer.
- Parameters
-
| [out] | stream | Return cuda stream currently used |
| [in] | icpObj | The initialized ICP Module to get cuda stream from. |
- Returns
- DW_BAD_CAST - if the provided ICP handle is invalid.
. DW_INVALID_ARGUMENT - if provided parameters are invalid
DW_SUCCESS
◆ dwICP_getLastResultStats()
Get stats about latest ICP run.
- Parameters
-
| [out] | resultStats | Struct with stats about latest ICP run |
| [in] | icpObj | The initialized ICP Module. |
- Returns
- DW_BAD_CAST - if the provided ICP handle is invalid.
DW_INVALID_ARGUMENT - if provided parameters are null or invalid
DW_SUCCESS
◆ dwICP_initialize()
Initializes the ICP module.
Initialization will perform any required memory allocations on GPU and CPU.
- Parameters
-
| [out] | icpObj | A pointer to the ICP handle for the created module. |
| [in] | params | Parameters for initilizations. |
| [in] | ctx | Specifies the handler to the context under which the ICP module is created. |
- Returns
- DW_BAD_CAST - if the provided context handle is invalid.
DW_INVALID_ARGUMENT - if provided parameters are invalid
DW_SUCCESS
◆ dwICP_optimize()
Perform ICP between 2 pointclouds.
The method will return a transformation which aligns source points to target points.
- Parameters
-
| [out] | outSrc2Tgt | Given trtransformation will be overwritten with the ICP result. |
| [in] | iParams | Pointer to iteration parameters. |
| [in] | icpObj | The initialized ICP Module. |
- Returns
- DW_BAD_CAST - if the provided context or ICP handle is invalid.
DW_INVALID_ARGUMENT - if provided parameters are invalid
DW_SUCCESS
- Note
- Result returned in
outSrc2Tgt will be premultiplied with the initial transformation passed in iParams. Final equation to align source to target is then targetPt = outSrc2Tgt * sourcePt
◆ dwICP_release()
Releases an ICP module.
- Parameters
-
| [in] | icpObj | The initialized ICP Module. |
- Returns
- DW_BAD_CAST - if the provided ICP handle is invalid.
DW_INVALID_ARGUMENT - if provided parameters are invalid
DW_SUCCESS
◆ dwICP_reset()
Resets the ICP module, clears any data or containers to just-initialized state.
- Parameters
-
| [in] | icpObj | The initialized ICP Module to reset. |
- Returns
- DW_BAD_CAST - if the provided ICP handle is invalid.
DW_SUCCESS
◆ dwICP_setConvergenceCriteriaCallback()
Set callback to be executed to test convergence.
If nullptr, the default test will be used.
- Parameters
-
| [in] | callback | Method to execute to test for convergence |
| [in] | userData | User data to be passed to the convergence callback |
| [in] | icpObj | The initialized ICP Module. |
- Returns
- DW_BAD_CAST - if the provided ICP handle is invalid.
DW_SUCCESS
◆ dwICP_setConvergenceTolerance()
Set tolerances used by the default ICP convergence criteria method.
- Parameters
-
| [in] | angleTol | Change in radians between two consecutive iteration steps |
| [in] | distanceTol | Change in units between two consecutive iteration steps |
| [in] | icpObj | The initialized ICP Module. |
- Returns
- DW_BAD_CAST - if the provided ICP handle is invalid.
DW_SUCCESS
- Note
- both tolerances has to be fulfilled, to declare convergence (i.e. it is a binary AND).
◆ dwICP_setCUDAStream()
Resets the ICP module's cuda stream to new stream.
- Parameters
-
| [in] | stream | Cuda stream to be used by ICP implementation. |
| [in] | icpObj | The initialized ICP module to set stream for. |
- Returns
- DW_BAD_CAST - if the provided ICP handle is invalid.
. DW_INVALID_ARGUMENT - if provided parameters are invalid
DW_SUCCESS
◆ dwICP_setMaxIterations()
Set maximum number of iterations which need to be executed.
Note that ICP might converge earlier, due to the tolerances set in dwICP_setConvergenceTolerance().
- Parameters
-
| [in] | maxIterations | Maximal number of iterations to execute. |
| [in] | icpObj | The initialized ICP Module. |
- Returns
- DW_BAD_CAST - if the provided ICP handle is invalid.
DW_SUCCESS