Point Cloud Library (PCL)
1.10.0
|
46 #include <pcl/pcl_base.h>
47 #include <pcl/PointIndices.h>
48 #include <pcl/conversions.h>
49 #include <pcl/exceptions.h>
50 #include <pcl/PolygonMesh.h>
64 const auto result = std::find_if(cloud.
fields.begin (), cloud.
fields.end (),
65 [&field_name](
const auto field) { return field.name == field_name; });
66 if (result == cloud.
fields.end ())
77 template <
typename Po
intT>
78 [[deprecated(
"use getFieldIndex<PointT> (field_name, fields) instead")]]
81 std::vector<pcl::PCLPointField> &fields);
89 template <
typename Po
intT>
inline int
91 std::vector<pcl::PCLPointField> &fields);
98 template <
typename Po
intT>
inline int
100 const std::vector<pcl::PCLPointField> &fields);
107 template <
typename Po
intT>
108 [[deprecated(
"use getFields<PointT> () with return value instead")]]
117 template <
typename Po
intT>
118 [[deprecated(
"use getFields<PointT> () with return value instead")]]
120 getFields (std::vector<pcl::PCLPointField> &fields);
126 template <
typename Po
intT>
inline std::vector<pcl::PCLPointField>
133 template <
typename Po
intT>
inline std::string
143 return std::accumulate(std::next (cloud.
fields.begin ()), cloud.
fields.end (), cloud.
fields[0].name,
144 [](
const auto& acc,
const auto& field) { return acc +
" " + field.name; });
183 std::vector<int> &field_sizes);
193 type = std::toupper (type, std::locale::classic ());
279 template <
typename Po
intT>
330 [[deprecated(
"use pcl::concatenate() instead, but beware of subtle difference in behavior (see documentation)")]]
345 const std::vector<int> &indices,
357 const std::vector<
int, Eigen::aligned_allocator<int> > &indices,
370 template <
typename Po
int1T,
typename Po
int2T>
inline bool
373 return (
typeid (Point1T) ==
typeid (Point2T));
383 template <
typename Po
intT,
typename IndicesVectorAllocator = std::allocator<
int>>
void
385 const std::vector<int, IndicesVectorAllocator> &indices,
395 template <
typename Po
intT>
void
397 const PointIndices &indices,
407 template <
typename Po
intT>
void
409 const std::vector<pcl::PointIndices> &indices,
417 template <
typename Po
intInT,
typename Po
intOutT>
void
428 template <
typename Po
intInT,
typename Po
intOutT,
typename IndicesVectorAllocator = std::allocator<
int>>
void
430 const std::vector<int, IndicesVectorAllocator> &indices,
440 template <
typename Po
intInT,
typename Po
intOutT>
void
442 const PointIndices &indices,
452 template <
typename Po
intInT,
typename Po
intOutT>
void
454 const std::vector<pcl::PointIndices> &indices,
476 template <
typename Po
intT>
void
479 int top,
int bottom,
int left,
int right,
493 template <
typename Po
intIn1T,
typename Po
intIn2T,
typename Po
intOutT>
void
537 template <std::
size_t N>
void
543 template <>
inline void
550 template <>
inline void
556 template <>
inline void
559 std::swap (bytes[0], bytes[3]);
560 std::swap (bytes[1], bytes[2]);
566 template <>
inline void
569 std::swap (bytes[0], bytes[7]);
570 std::swap (bytes[1], bytes[6]);
571 std::swap (bytes[2], bytes[5]);
572 std::swap (bytes[3], bytes[4]);
578 template <
typename T>
void
581 pcl::io::swapByte<sizeof(T)> (
reinterpret_cast<char*
> (&value));
586 #include <pcl/common/impl/io.hpp>
PCL_EXPORTS bool getPointCloudAsEigen(const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out)
Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format.
void concatenateFields(const pcl::PointCloud< PointIn1T > &cloud1_in, const pcl::PointCloud< PointIn2T > &cloud2_in, pcl::PointCloud< PointOutT > &cloud_out)
Concatenate two datasets representing different fields.
This file defines compatibility wrappers for low level I/O functions.
PCL_EXPORTS bool concatenatePointCloud(const pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2, pcl::PCLPointCloud2 &cloud_out)
Concatenate two pcl::PCLPointCloud2.
float distance(const PointT &p1, const PointT &p2)
void getFields(const pcl::PointCloud< PointT > &cloud, std::vector< pcl::PCLPointField > &fields)
Get the list of available fields (i.e., dimension/channel)
bool isSamePointType()
Check if two given point types are the same or not.
void swapByte< 4 >(char *bytes)
specialization of swapByte for dimension 4
void swapByte< 2 >(char *bytes)
specialization of swapByte for dimension 2
PCL_EXPORTS void copyPointCloud(const pcl::PCLPointCloud2 &cloud_in, const std::vector< int > &indices, pcl::PCLPointCloud2 &cloud_out)
Extract the indices of a given point cloud as a new point cloud.
PointCloud represents the base class in PCL for storing collections of 3D points.
A point structure representing Euclidean xyz coordinates, and the RGB color.
int getFieldIndex(const pcl::PCLPointCloud2 &cloud, const std::string &field_name)
Get the index of a specified field (i.e., dimension/channel)
static bool concatenate(pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2)
Inplace concatenate two pcl::PCLPointCloud2.
void swapByte< 1 >(char *bytes)
specialization of swapByte for dimension 1
std::vector<::pcl::PCLPointField > fields
PCL_EXPORTS void getFieldsSizes(const std::vector< pcl::PCLPointField > &fields, std::vector< int > &field_sizes)
Obtain a vector with the sizes of all valid fields (e.g., not "_")
int getFieldSize(const int datatype)
Obtains the size of a specific field data type in bytes.
PCL_EXPORTS bool getEigenAsPointCloud(Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out)
Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message.
static bool concatenate(pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2)
PCL_EXPORTS bool concatenate(const pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2, pcl::PointCloud< PointT > &cloud_out)
Concatenate two pcl::PointCloud<PointT>
void swapByte< 8 >(char *bytes)
specialization of swapByte for dimension 8
PCL_EXPORTS int interpolatePointIndex(int p, int length, InterpolationType type)
std::string getFieldsList(const pcl::PointCloud< PointT > &cloud)
Get the list of all fields available in a given cloud.
static bool concatenate(pcl::PolygonMesh &mesh1, const pcl::PolygonMesh &mesh2)
Inplace concatenate two pcl::PolygonMesh.
int getFieldType(const int size, char type)
Obtains the type of the PCLPointField from a specific size and type.
void swapByte(char *bytes)
swap bytes order of a char array of length N