small_gicp
Classes | Functions
small_gicp::traits Namespace Reference

Classes

struct  Traits< FlatContainer< HasNormals, HasCovs > >
 
struct  Traits< GaussianVoxel >
 
struct  Traits< IncrementalVoxelMap< VoxelContents > >
 
struct  Traits< UnsafeKdTree< PointCloud, Projection > >
 
struct  Traits< KdTree< PointCloud, Projection > >
 
struct  Traits
 
struct  has_nearest_neighbor_search
 Check if T has nearest_neighbor_search method. More...
 
struct  Traits< pcl::PointCloud< PointType > >
 
struct  Traits< PointCloudProxy< PointT > >
 
struct  Traits< Eigen::MatrixXd >
 
struct  Traits< PointCloud >
 

Functions

template<typename VoxelContents >
std::vector< size_t > point_indices (const IncrementalVoxelMap< VoxelContents > &voxelmap)
 
template<typename VoxelContents >
std::vector< Eigen::Vector4d > voxel_points (const IncrementalVoxelMap< VoxelContents > &voxelmap)
 
template<typename VoxelContents >
std::vector< Eigen::Vector4d > voxel_normals (const IncrementalVoxelMap< VoxelContents > &voxelmap)
 
template<typename VoxelContents >
std::vector< Eigen::Matrix4d > voxel_covs (const IncrementalVoxelMap< VoxelContents > &voxelmap)
 
template<typename T >
size_t knn_search (const T &tree, const Eigen::Vector4d &point, size_t k, size_t *k_indices, double *k_sq_dists)
 Find k-nearest neighbors. More...
 
template<typename T , std::enable_if_t< has_nearest_neighbor_search< T >::value, bool > = true>
size_t nearest_neighbor_search (const T &tree, const Eigen::Vector4d &point, size_t *k_index, double *k_sq_dist)
 Find the nearest neighbor. If Traits<T>::nearest_neighbor_search is not defined, fallback to knn_search with k=1. More...
 
template<typename T >
size_t size (const T &points)
 Get the number of points. More...
 
template<typename T >
bool has_points (const T &points)
 Check if the point cloud has points. More...
 
template<typename T >
bool has_normals (const T &points)
 Check if the point cloud has normals. More...
 
template<typename T >
bool has_covs (const T &points)
 Check if the point cloud has covariances. More...
 
template<typename T >
auto point (const T &points, size_t i)
 Get i-th point. 4D vector is used to take advantage of SIMD intrinsics. The last element must be filled by one (x, y, z, 1). More...
 
template<typename T >
auto normal (const T &points, size_t i)
 Get i-th normal. 4D vector is used to take advantage of SIMD intrinsics. The last element must be filled by zero (nx, ny, nz, 0). More...
 
template<typename T >
auto cov (const T &points, size_t i)
 Get i-th covariance. Only the top-left 3x3 matrix is filled, and the bottom row and the right col must be filled by zero. More...
 
template<typename T >
void resize (T &points, size_t n)
 Resize the point cloud (this function should resize all attributes) More...
 
template<typename T >
void set_point (T &points, size_t i, const Eigen::Vector4d &pt)
 Set i-th point. (x, y, z, 1) More...
 
template<typename T >
void set_normal (T &points, size_t i, const Eigen::Vector4d &pt)
 Set i-th normal. (nx, nz, nz, 0) More...
 
template<typename T >
void set_cov (T &points, size_t i, const Eigen::Matrix4d &cov)
 Set i-th covariance. Only the top-left 3x3 matrix should be filled. More...
 

Function Documentation

◆ cov()

template<typename T >
auto small_gicp::traits::cov ( const T &  points,
size_t  i 
)

Get i-th covariance. Only the top-left 3x3 matrix is filled, and the bottom row and the right col must be filled by zero.

◆ has_covs()

template<typename T >
bool small_gicp::traits::has_covs ( const T &  points)

Check if the point cloud has covariances.

◆ has_normals()

template<typename T >
bool small_gicp::traits::has_normals ( const T &  points)

Check if the point cloud has normals.

◆ has_points()

template<typename T >
bool small_gicp::traits::has_points ( const T &  points)

Check if the point cloud has points.

◆ knn_search()

template<typename T >
size_t small_gicp::traits::knn_search ( const T &  tree,
const Eigen::Vector4d &  point,
size_t  k,
size_t *  k_indices,
double *  k_sq_dists 
)

Find k-nearest neighbors.

Parameters
treeNearest neighbor search (e.g., KdTree)
pointQuery point
kNumber of neighbors
k_indices[out] Indices of k-nearest neighbors
k_sq_dists[out] Squared distances to k-nearest neighbors
Returns
Number of found neighbors

◆ nearest_neighbor_search()

template<typename T , std::enable_if_t< has_nearest_neighbor_search< T >::value, bool > = true>
size_t small_gicp::traits::nearest_neighbor_search ( const T &  tree,
const Eigen::Vector4d &  point,
size_t *  k_index,
double *  k_sq_dist 
)

Find the nearest neighbor. If Traits<T>::nearest_neighbor_search is not defined, fallback to knn_search with k=1.

Parameters
treeNearest neighbor search (e.g., KdTree)
pointQuery point
k_index[out] Index of the nearest neighbor
k_sq_dist[out] Squared distance to the nearest neighbor
Returns
1 if a neighbor is found else 0

◆ normal()

template<typename T >
auto small_gicp::traits::normal ( const T &  points,
size_t  i 
)

Get i-th normal. 4D vector is used to take advantage of SIMD intrinsics. The last element must be filled by zero (nx, ny, nz, 0).

◆ point()

template<typename T >
auto small_gicp::traits::point ( const T &  points,
size_t  i 
)

Get i-th point. 4D vector is used to take advantage of SIMD intrinsics. The last element must be filled by one (x, y, z, 1).

◆ point_indices()

template<typename VoxelContents >
std::vector<size_t> small_gicp::traits::point_indices ( const IncrementalVoxelMap< VoxelContents > &  voxelmap)

◆ resize()

template<typename T >
void small_gicp::traits::resize ( T &  points,
size_t  n 
)

Resize the point cloud (this function should resize all attributes)

◆ set_cov()

template<typename T >
void small_gicp::traits::set_cov ( T &  points,
size_t  i,
const Eigen::Matrix4d &  cov 
)

Set i-th covariance. Only the top-left 3x3 matrix should be filled.

◆ set_normal()

template<typename T >
void small_gicp::traits::set_normal ( T &  points,
size_t  i,
const Eigen::Vector4d &  pt 
)

Set i-th normal. (nx, nz, nz, 0)

◆ set_point()

template<typename T >
void small_gicp::traits::set_point ( T &  points,
size_t  i,
const Eigen::Vector4d &  pt 
)

Set i-th point. (x, y, z, 1)

◆ size()

template<typename T >
size_t small_gicp::traits::size ( const T &  points)

Get the number of points.

◆ voxel_covs()

template<typename VoxelContents >
std::vector<Eigen::Matrix4d> small_gicp::traits::voxel_covs ( const IncrementalVoxelMap< VoxelContents > &  voxelmap)

◆ voxel_normals()

template<typename VoxelContents >
std::vector<Eigen::Vector4d> small_gicp::traits::voxel_normals ( const IncrementalVoxelMap< VoxelContents > &  voxelmap)

◆ voxel_points()

template<typename VoxelContents >
std::vector<Eigen::Vector4d> small_gicp::traits::voxel_points ( const IncrementalVoxelMap< VoxelContents > &  voxelmap)