5 #include <pcl/point_types.h>
6 #include <pcl/point_cloud.h>
14 template <
typename Po
intType>
16 static_assert(std::is_same_v<pcl::shared_ptr<void>, std::shared_ptr<void>>,
"Old PCL version detected. Please update PCL to 1.11 or later.");
18 using Points = pcl::PointCloud<PointType>;
20 static size_t size(
const Points& points) {
return points.size(); }
27 static void set_point(
Points& points,
size_t i,
const Eigen::Vector4d& pt) { points.at(i).getVector4fMap() = pt.template cast<float>(); }
28 static void set_normal(
Points& points,
size_t i,
const Eigen::Vector4d& pt) { points.at(i).getNormalVector4fMap() = pt.template cast<float>(); }
29 static void set_cov(
Points& points,
size_t i,
const Eigen::Matrix4d&
cov) { points.at(i).getCovariance4fMap() =
cov.template cast<float>(); }
31 static Eigen::Vector4d
point(
const Points& points,
size_t i) {
return points.at(i).getVector4fMap().template cast<double>(); }
32 static Eigen::Vector4d
normal(
const Points& points,
size_t i) {
return points.at(i).getNormalVector4fMap().template cast<double>(); }
33 static Eigen::Matrix4d
cov(
const Points& points,
size_t i) {
return points.at(i).getCovariance4fMap().template cast<double>(); }
Definition: pcl_point.hpp:7
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
Point cloud.
Definition: point_cloud.hpp:15
static bool has_points(const Points &points)
Definition: pcl_point_traits.hpp:23
static Eigen::Vector4d normal(const Points &points, size_t i)
Definition: pcl_point_traits.hpp:32
static bool has_covs(const Points &points)
Definition: pcl_point_traits.hpp:25
static size_t size(const Points &points)
Definition: pcl_point_traits.hpp:20
static void resize(Points &points, size_t n)
Definition: pcl_point_traits.hpp:21
pcl::PointCloud< PointType > Points
Definition: pcl_point_traits.hpp:18
static Eigen::Vector4d point(const Points &points, size_t i)
Definition: pcl_point_traits.hpp:31
static void set_point(Points &points, size_t i, const Eigen::Vector4d &pt)
Definition: pcl_point_traits.hpp:27
static void set_cov(Points &points, size_t i, const Eigen::Matrix4d &cov)
Definition: pcl_point_traits.hpp:29
static void set_normal(Points &points, size_t i, const Eigen::Vector4d &pt)
Definition: pcl_point_traits.hpp:28
static Eigen::Matrix4d cov(const Points &points, size_t i)
Definition: pcl_point_traits.hpp:33
static bool has_normals(const Points &points)
Definition: pcl_point_traits.hpp:24
Definition: traits.hpp:13