You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: common/include/pcl/conversions.h
+83-13Lines changed: 83 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@
53
53
54
54
#include<algorithm>
55
55
#include<iterator>
56
+
#include<numeric>// for accumulate
56
57
57
58
namespacepcl
58
59
{
@@ -256,12 +257,52 @@ namespace pcl
256
257
fromPCLPointCloud2 (msg, cloud, field_map);
257
258
}
258
259
260
+
namespacedetail {
261
+
/** \brief Used together with `pcl::for_each_type`, copies all point fields from `cloud_data` (respecting each field offset) to `msg_data` (tightly packed).
field_sizes_.push_back (sizeof(typename pcl::traits::datatype<PointT, U>::type)); // If field is an array, then this is the size of all array elements
292
+
}
293
+
294
+
std::vector<pcl::PCLPointField>& fields_;
295
+
std::vector<std::size_t>& field_sizes_;
296
+
};
297
+
} // namespace detail
298
+
259
299
/** \brief Convert a pcl::PointCloud<T> object to a PCLPointCloud2 binary data blob.
260
300
* \param[in] cloud the input pcl::PointCloud<T>
261
301
* \param[out] msg the resultant PCLPointCloud2 binary blob
302
+
* \param[in] padding Many point types have padding to ensure alignment and SIMD compatibility. Setting this to true will copy the padding to the `PCLPointCloud2` (the default in older PCL versions). Setting this to false will make the data blob in `PCLPointCloud2` smaller, while still keeping all information (useful e.g. when sending msg over network or storing it). The amount of padding depends on the point type, and can in some cases be up to 50 percent.
0 commit comments