6 #include <boost/predef/other/endian.h>
9 #include <pcl/PCLHeader.h>
10 #include <pcl/PCLPointField.h>
23 std::vector<::pcl::PCLPointField>
fields;
25 static_assert(BOOST_ENDIAN_BIG_BYTE || BOOST_ENDIAN_LITTLE_BYTE,
"unable to determine system endianness");
26 std::uint8_t is_bigendian = BOOST_ENDIAN_BIG_BYTE;
30 std::vector<std::uint8_t>
data;
32 std::uint8_t is_dense = 0;
35 using Ptr = shared_ptr< ::pcl::PCLPointCloud2>;
36 using ConstPtr = shared_ptr<const ::pcl::PCLPointCloud2>;
94 template<
typename T>
inline
96 const auto position = point_index * point_step + field_offset;
97 if (data.size () >= (position +
sizeof(T)))
98 return reinterpret_cast<const T&
>(data[position]);
100 throw std::out_of_range(
"PCLPointCloud2::at");
108 template<
typename T>
inline
110 const auto position = point_index * point_step + field_offset;
111 if (data.size () >= (position +
sizeof(T)))
112 return reinterpret_cast<T&
>(data[position]);
114 throw std::out_of_range(
"PCLPointCloud2::at");
121 inline std::ostream&
operator<<(std::ostream& s, const ::pcl::PCLPointCloud2 &v)
123 s <<
"header: " << std::endl;
126 s <<
" " << v.height << std::endl;
128 s <<
" " << v.width << std::endl;
129 s <<
"fields[]" << std::endl;
130 for (std::size_t i = 0; i < v.fields.size (); ++i)
132 s <<
" fields[" << i <<
"]: ";
134 s <<
" " << v.fields[i] << std::endl;
136 s <<
"is_bigendian: ";
137 s <<
" " << v.is_bigendian << std::endl;
139 s <<
" " << v.point_step << std::endl;
141 s <<
" " << v.row_step << std::endl;
142 s <<
"data[]" << std::endl;
143 for (std::size_t i = 0; i < v.data.size (); ++i)
145 s <<
" data[" << i <<
"]: ";
146 s <<
" " <<
static_cast<int>(v.data[i]) << std::endl;
149 s <<
" " << v.is_dense << std::endl;
bool concatenate(const pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2, pcl::PointCloud< PointT > &cloud_out)
Concatenate two pcl::PointCloud<PointT>
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.
std::ostream & operator<<(std::ostream &os, const BivariatePolynomialT< real > &p)
PCLPointCloud2::Ptr PCLPointCloud2Ptr
PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr
Defines all the PCL and non-PCL macros used.
const T & at(const pcl::uindex_t &point_index, const pcl::uindex_t &field_offset) const
Get value at specified offset.
std::vector<::pcl::PCLPointField > fields
shared_ptr< ::pcl::PCLPointCloud2 > Ptr
static bool concatenate(const PCLPointCloud2 &cloud1, const PCLPointCloud2 &cloud2, PCLPointCloud2 &cloud_out)
Concatenate two pcl::PCLPointCloud2.
static bool concatenate(pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2)
Inplace concatenate two pcl::PCLPointCloud2.
T & at(const pcl::uindex_t &point_index, const pcl::uindex_t &field_offset)
Get value at specified offset.
std::vector< std::uint8_t > data
shared_ptr< const ::pcl::PCLPointCloud2 > ConstPtr
Defines basic non-point types used by PCL.