6 #include <Eigen/Geometry>
23 size_t size()
const {
return 1; }
31 template <
typename Po
intCloud>
32 void add(
const Setting& setting,
const Eigen::Vector4d& transformed_pt,
const PointCloud& points,
size_t i,
const Eigen::Isometry3d& T) {
40 this->
mean += transformed_pt;
41 this->
cov += T.matrix() *
traits::cov(points, i) * T.matrix().transpose();
75 *k_sq_dist = (voxel.
mean - pt).squaredNorm();
79 static size_t knn_search(
const GaussianVoxel& voxel,
const Eigen::Vector4d& pt,
size_t k,
size_t* k_index,
double* k_sq_dist) {
83 template <
typename Result>
85 result.push(0, (voxel.
mean - pt).squaredNorm());
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_sear...
Definition: traits.hpp:44
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 mus...
Definition: traits.hpp:52
Definition: flat_container.hpp:12
Definition: gaussian_voxelmap.hpp:17
Gaussian voxel that computes and stores voxel mean and covariance.
Definition: gaussian_voxelmap.hpp:15
Eigen::Matrix4d cov
Covariance.
Definition: gaussian_voxelmap.hpp:59
Eigen::Vector4d mean
Mean.
Definition: gaussian_voxelmap.hpp:58
void finalize()
Finalize the voxel mean and covariance.
Definition: gaussian_voxelmap.hpp:45
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 voxel.
Definition: gaussian_voxelmap.hpp:32
GaussianVoxel()
Constructor.
Definition: gaussian_voxelmap.hpp:20
size_t size() const
Number of points in the voxel (Always 1 for GaussianVoxel).
Definition: gaussian_voxelmap.hpp:23
bool finalized
If true, mean and cov are finalized, otherwise they represent the sum of input points.
Definition: gaussian_voxelmap.hpp:56
size_t num_points
Number of input points.
Definition: gaussian_voxelmap.hpp:57
Incremental voxelmap. This class supports incremental point cloud insertion and LRU-based voxel delet...
Definition: incremental_voxelmap.hpp:38
Point cloud.
Definition: point_cloud.hpp:15
static size_t nearest_neighbor_search(const GaussianVoxel &voxel, const Eigen::Vector4d &pt, size_t *k_index, double *k_sq_dist)
Definition: gaussian_voxelmap.hpp:73
static const Eigen::Vector4d & point(const GaussianVoxel &voxel, size_t i)
Definition: gaussian_voxelmap.hpp:70
static bool has_covs(const GaussianVoxel &voxel)
Definition: gaussian_voxelmap.hpp:68
static void knn_search(const GaussianVoxel &voxel, const Eigen::Vector4d &pt, Result &result)
Definition: gaussian_voxelmap.hpp:84
static size_t knn_search(const GaussianVoxel &voxel, const Eigen::Vector4d &pt, size_t k, size_t *k_index, double *k_sq_dist)
Definition: gaussian_voxelmap.hpp:79
static const Eigen::Matrix4d & cov(const GaussianVoxel &voxel, size_t i)
Definition: gaussian_voxelmap.hpp:71
static size_t size(const GaussianVoxel &voxel)
Definition: gaussian_voxelmap.hpp:66
static bool has_points(const GaussianVoxel &voxel)
Definition: gaussian_voxelmap.hpp:67
Definition: traits.hpp:13