Point Cloud Library (PCL)
1.11.1-dev
|
46 #include <pcl/point_cloud.h>
47 #include <pcl/PointIndices.h>
49 #include <pcl/PolygonMesh.h>
63 const auto result = std::find_if(cloud.
fields.begin (), cloud.
fields.end (),
64 [&field_name](
const auto field) { return field.name == field_name; });
65 if (result == cloud.
fields.end ())
76 template <
typename Po
intT>
inline int
78 std::vector<pcl::PCLPointField> &fields);
85 template <
typename Po
intT>
inline int
87 const std::vector<pcl::PCLPointField> &fields);
93 template <
typename Po
intT>
inline std::vector<pcl::PCLPointField>
100 template <
typename Po
intT>
inline std::string
110 return std::accumulate(std::next (cloud.
fields.begin ()), cloud.
fields.end (), cloud.
fields[0].name,
111 [](
const auto& acc,
const auto& field) { return acc +
" " + field.name; });
150 std::vector<int> &field_sizes);
160 type = std::toupper (type, std::locale::classic ());
246 template <
typename Po
intT>
297 PCL_DEPRECATED(1, 12,
"use pcl::concatenate() instead, but beware of subtle difference in behavior (see documentation)")
300 const
pcl::PCLPointCloud2 &cloud2,
301 pcl::PCLPointCloud2 &cloud_out);
313 pcl::PCLPointCloud2 &cloud_out);
325 pcl::PCLPointCloud2 &cloud_out);
334 pcl::PCLPointCloud2 &cloud_out);
337 template <typename Point1T, typename Point2T> inline
bool
340 return (
typeid (Point1T) ==
typeid (Point2T));
350 template <
typename Po
intT,
typename IndicesVectorAllocator = std::allocator<
int>>
void
352 const IndicesAllocator< IndicesVectorAllocator> &indices,
362 template <
typename Po
intT>
void
364 const PointIndices &indices,
374 template <
typename Po
intT>
void
376 const std::vector<pcl::PointIndices> &indices,
384 template <
typename Po
intInT,
typename Po
intOutT>
void
395 template <
typename Po
intInT,
typename Po
intOutT,
typename IndicesVectorAllocator = std::allocator<
int>>
void
397 const IndicesAllocator<IndicesVectorAllocator> &indices,
407 template <
typename Po
intInT,
typename Po
intOutT>
void
409 const PointIndices &indices,
419 template <
typename Po
intInT,
typename Po
intOutT>
void
421 const std::vector<pcl::PointIndices> &indices,
443 template <
typename Po
intT>
void
446 int top,
int bottom,
int left,
int right,
460 template <
typename Po
intIn1T,
typename Po
intIn2T,
typename Po
intOutT>
void
504 template <std::
size_t N>
void
510 template <>
inline void
517 template <>
inline void
523 template <>
inline void
526 std::swap (bytes[0], bytes[3]);
527 std::swap (bytes[1], bytes[2]);
533 template <>
inline void
536 std::swap (bytes[0], bytes[7]);
537 std::swap (bytes[1], bytes[6]);
538 std::swap (bytes[2], bytes[5]);
539 std::swap (bytes[3], bytes[4]);
545 template <
typename T>
void
548 pcl::io::swapByte<sizeof(T)> (
reinterpret_cast<char*
> (&value));
553 #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.
Defines all the PCL and non-PCL macros used.
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)
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
void getFields(const pcl::PointCloud< PointT > &, std::vector< pcl::PCLPointField > &fields)
PointCloud represents the base class in PCL for storing collections of 3D points.
A point structure representing Euclidean xyz coordinates, and the RGB color.
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
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
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....
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.
IndicesAllocator<> Indices
Type used for indices in PCL.
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
std::vector< index_t, Allocator > IndicesAllocator
Type used for indices in PCL.
PCL_EXPORTS int interpolatePointIndex(int p, int length, InterpolationType type)
int getFieldIndex(const pcl::PointCloud< PointT > &, const std::string &field_name, std::vector< pcl::PCLPointField > &fields)
std::string getFieldsList(const pcl::PointCloud< PointT > &)
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