22 #ifndef _LIBS_PCL_UTILS_UTILS_H_
23 #define _LIBS_PCL_UTILS_UTILS_H_
25 #include <config/config.h>
26 #include <core/utils/refptr.h>
27 #include <pcl/console/print.h>
28 #include <pcl/point_cloud.h>
29 #include <utils/time/time.h>
51 pcl::console::setVerbosityLevel(pcl::console::L_ALWAYS);
62 bool pcl_shutup =
false;
64 pcl_shutup = config->
get_bool(
"/pcl/shutup");
68 ::fawkes::pcl_utils::shutup();
77 template <
typename Po
intT>
81 #if PCL_VERSION_COMPARE(>=, 1, 7, 0)
82 cloud.header.stamp = time.
in_usec();
84 # if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H)
85 cloud.header.stamp.sec = time.
get_sec();
86 cloud.header.stamp.nsec = time.
get_usec() * 1000;
102 template <
typename Po
intT>
106 set_time<PointT>(**cloud, time);
115 template <
typename Po
intT>
119 set_time<PointT>(*cloud, time);
128 template <
typename Po
intT>
132 #if PCL_VERSION_COMPARE(>=, 1, 7, 0)
133 time.
set_time(cloud->header.stamp / 1000000U, cloud->header.stamp % 1000000);
135 # if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H)
136 time.
set_time(cloud->header.stamp.sec, cloud->header.stamp.nsec / 1000);
138 PointCloudTimestamp pclts;
140 time.
set_time(pclts.time.sec, pclts.time.usec);
151 template <
typename Po
intT>
155 #if PCL_VERSION_COMPARE(>=, 1, 7, 0)
156 time.
set_time(cloud->header.stamp / 1000000U, cloud->header.stamp % 1000000);
158 # if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H)
159 time.
set_time(cloud->header.stamp.sec, cloud->header.stamp.nsec / 1000);
161 PointCloudTimestamp pclts;
162 pclts.timestamp = cloud->header.stamp;
163 time.
set_time(pclts.time.sec, pclts.time.usec);
174 template <
typename Po
intT>
178 #if PCL_VERSION_COMPARE(>=, 1, 7, 0)
179 time.
set_time(cloud.header.stamp / 1000000U, cloud.header.stamp % 1000000);
181 # if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H)
182 time.
set_time(cloud.header.stamp.sec, cloud.header.stamp.nsec / 1000);
184 PointCloudTimestamp pclts;
185 pclts.timestamp = cloud.header.stamp;
186 time.
set_time(pclts.time.sec, pclts.time.usec);
197 template <
typename Po
intT>
201 #if PCL_VERSION_COMPARE(>=, 1, 7, 0)
202 time.
set_time(cloud->header.stamp / 1000000U, cloud->header.stamp % 1000000);
204 # if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H)
205 time.
set_time(cloud->header.stamp.sec, cloud->header.stamp.nsec / 1000);
207 PointCloudTimestamp pclts;
208 pclts.timestamp = cloud->header.stamp;
209 time.
set_time(pclts.time.sec, pclts.time.usec);
220 template <
typename Po
intT>
224 #if PCL_VERSION_COMPARE(>=, 1, 7, 0)
225 time.
set_time(cloud->header.stamp / 1000000U, cloud->header.stamp % 1000000);
227 # if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H)
228 time.
set_time(cloud->header.stamp.sec, cloud->header.stamp.nsec / 1000);
230 PointCloudTimestamp pclts;
231 pclts.timestamp = cloud->header.stamp;
232 time.
set_time(pclts.time.sec, pclts.time.usec);
241 template <
typename Po
intT1,
typename Po
intT2>
246 to->header.stamp = from->header.stamp;
253 template <
typename Po
intT1,
typename Po
intT2>
258 to->header.stamp = from->header.stamp;
265 template <
typename Po
intT1,
typename Po
intT2>
269 to->header.stamp = from->header.stamp;
279 struct PointCloudNonDeleter
284 template <
typename T>
291 template <
typename Po
intT>
298 template <
typename Po
intT>