small_gicp
Classes | Public Member Functions | Public Attributes | List of all members
small_gicp::FlatContainer< HasNormals, HasCovs > Struct Template Reference

Point container with a flat vector. More...

#include <flat_container.hpp>

Classes

struct  Empty
 
struct  Setting
 FlatContainer setting. More...
 

Public Member Functions

 FlatContainer ()
 Constructor. More...
 
size_t size () const
 Number of points. More...
 
template<typename PointCloud >
void add (const Setting &setting, const Eigen::Vector4d &transformed_pt, const PointCloud &points, size_t i, const Eigen::Isometry3d &T)
 Add a point to the container. If there is a point that is too close to the input point, or there are too many points in the cell, the input point will not be ignored. More...
 
void finalize ()
 Finalize the container (Nothing to do for FlatContainer). More...
 
size_t nearest_neighbor_search (const Eigen::Vector4d &pt, size_t *k_index, double *k_sq_dist) const
 Find the nearest neighbor. More...
 
size_t knn_search (const Eigen::Vector4d &pt, int k, size_t *k_indices, double *k_sq_dists) const
 Find k nearest neighbors. More...
 
template<typename Result >
void knn_search (const Eigen::Vector4d &pt, Result &result) const
 Find k nearest neighbors. More...
 

Public Attributes

std::vector< Eigen::Vector4d > points
 Points. More...
 
std::conditional_t< HasNormals, std::vector< Eigen::Vector4d >, Emptynormals
 Normals (Empty if HasNormals is false) More...
 
std::conditional_t< HasCovs, std::vector< Eigen::Matrix4d >, Emptycovs
 Covariances (Empty if HasCovs is false) More...
 

Detailed Description

template<bool HasNormals = false, bool HasCovs = false>
struct small_gicp::FlatContainer< HasNormals, HasCovs >

Point container with a flat vector.

Note
IncrementalVoxelMap combined with FlastContainer is mostly the same as linear iVox. Bai et al., "Faster-LIO: Lightweight Tightly Coupled Lidar-Inertial Odometry Using Parallel Sparse Incremental Voxels", IEEE RA-L, 2022
This container stores only up to max_num_points_in_cell points and avoids insertings points that are too close to existing points (min_sq_dist_in_cell).
Template Parameters
HasNormalsIf true, store normals.
HasCovsIf true, store covariances.

Constructor & Destructor Documentation

◆ FlatContainer()

template<bool HasNormals = false, bool HasCovs = false>
small_gicp::FlatContainer< HasNormals, HasCovs >::FlatContainer ( )
inline

Constructor.

Member Function Documentation

◆ add()

template<bool HasNormals = false, bool HasCovs = false>
template<typename PointCloud >
void small_gicp::FlatContainer< HasNormals, HasCovs >::add ( const Setting setting,
const Eigen::Vector4d &  transformed_pt,
const PointCloud points,
size_t  i,
const Eigen::Isometry3d &  T 
)
inline

Add a point to the container. If there is a point that is too close to the input point, or there are too many points in the cell, the input point will not be ignored.

Parameters
settingSetting
transformed_ptTransformed point (== T * points[i])
pointsPoint cloud
iIndex of the point
TTransformation matrix

◆ finalize()

template<bool HasNormals = false, bool HasCovs = false>
void small_gicp::FlatContainer< HasNormals, HasCovs >::finalize ( )
inline

Finalize the container (Nothing to do for FlatContainer).

◆ knn_search() [1/2]

template<bool HasNormals = false, bool HasCovs = false>
size_t small_gicp::FlatContainer< HasNormals, HasCovs >::knn_search ( const Eigen::Vector4d &  pt,
int  k,
size_t *  k_indices,
double *  k_sq_dists 
) const
inline

Find k nearest neighbors.

Parameters
ptQuery point
kNumber of neighbors
k_indexIndices of nearest neighbors
k_sq_distSquared distances to nearest neighbors (sorted in ascending order)
Returns
Number of found points

◆ knn_search() [2/2]

template<bool HasNormals = false, bool HasCovs = false>
template<typename Result >
void small_gicp::FlatContainer< HasNormals, HasCovs >::knn_search ( const Eigen::Vector4d &  pt,
Result &  result 
) const
inline

Find k nearest neighbors.

Parameters
ptQuery point
kNumber of neighbors
k_indexIndices of nearest neighbors
k_sq_distSquared distances to nearest neighbors (sorted in ascending order)
Returns
Number of found points

◆ nearest_neighbor_search()

template<bool HasNormals = false, bool HasCovs = false>
size_t small_gicp::FlatContainer< HasNormals, HasCovs >::nearest_neighbor_search ( const Eigen::Vector4d &  pt,
size_t *  k_index,
double *  k_sq_dist 
) const
inline

Find the nearest neighbor.

Parameters
ptQuery point
k_indexIndex of the nearest neighbor
k_sq_distSquared distance to the nearest neighbor
Returns
Number of found points (0 or 1)

◆ size()

template<bool HasNormals = false, bool HasCovs = false>
size_t small_gicp::FlatContainer< HasNormals, HasCovs >::size ( ) const
inline

Number of points.

Member Data Documentation

◆ covs

template<bool HasNormals = false, bool HasCovs = false>
std::conditional_t<HasCovs, std::vector<Eigen::Matrix4d>, Empty> small_gicp::FlatContainer< HasNormals, HasCovs >::covs

Covariances (Empty if HasCovs is false)

◆ normals

template<bool HasNormals = false, bool HasCovs = false>
std::conditional_t<HasNormals, std::vector<Eigen::Vector4d>, Empty> small_gicp::FlatContainer< HasNormals, HasCovs >::normals

Normals (Empty if HasNormals is false)

◆ points

template<bool HasNormals = false, bool HasCovs = false>
std::vector<Eigen::Vector4d> small_gicp::FlatContainer< HasNormals, HasCovs >::points

Points.


The documentation for this struct was generated from the following file: