22 #ifndef __LIBS_PCL_UTILS_UTILS_H_ 23 #define __LIBS_PCL_UTILS_UTILS_H_ 25 #include <pcl/point_cloud.h> 26 #include <pcl/console/print.h> 27 #include <core/utils/refptr.h> 28 #include <utils/time/time.h> 29 #include <config/config.h> 55 pcl::console::setVerbosityLevel(pcl::console::L_ALWAYS);
67 bool pcl_shutup =
false;
69 pcl_shutup = config->
get_bool(
"/pcl/shutup");
71 if (pcl_shutup) ::fawkes::pcl_utils::shutup();
81 template <
typename Po
intT>
85 #if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H) 86 cloud.header.stamp.sec = time.
get_sec();
87 cloud.header.stamp.nsec = time.
get_usec() * 1000;
89 # if PCL_VERSION_COMPARE(>=,1,7,0) 90 cloud.header.stamp = time.
in_usec();
106 template <
typename Po
intT>
110 set_time<PointT>(**cloud, time);
119 template <
typename Po
intT>
123 set_time<PointT>(*cloud, time);
134 template <
typename Po
intT>
138 #if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H) 139 time.
set_time(cloud->header.stamp.sec, cloud->header.stamp.nsec / 1000);
141 # if PCL_VERSION_COMPARE(>=,1,7,0) 142 time.
set_time(cloud->header.stamp / 1000000U, cloud->header.stamp % 1000000);
158 template <
typename Po
intT>
162 #if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H) 163 time.
set_time(cloud->header.stamp.sec, cloud->header.stamp.nsec / 1000);
165 # if PCL_VERSION_COMPARE(>=,1,7,0) 166 time.
set_time(cloud->header.stamp / 1000000U, cloud->header.stamp % 1000000);
182 template <
typename Po
intT>
186 #if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H) 187 time.
set_time(cloud.header.stamp.sec, cloud.header.stamp.nsec / 1000);
189 # if PCL_VERSION_COMPARE(>=,1,7,0) 190 time.
set_time(cloud.header.stamp / 1000000U, cloud.header.stamp % 1000000);
206 template <
typename Po
intT>
210 #if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H) 211 time.
set_time(cloud->header.stamp.sec, cloud->header.stamp.nsec / 1000);
213 # if PCL_VERSION_COMPARE(>=,1,7,0) 214 time.
set_time(cloud->header.stamp / 1000000U, cloud->header.stamp % 1000000);
230 template <
typename Po
intT>
234 #if defined(HAVE_ROS_PCL) || defined(ROSCPP_TYPES_H) 235 time.
set_time(cloud->header.stamp.sec, cloud->header.stamp.nsec / 1000);
237 # if PCL_VERSION_COMPARE(>=,1,7,0) 238 time.
set_time(cloud->header.stamp / 1000000U, cloud->header.stamp % 1000000);
252 template <
typename Po
intT1,
typename Po
intT2>
257 to->header.stamp = from->header.stamp;
265 template <
typename Po
intT1,
typename Po
intT2>
270 to->header.stamp = from->header.stamp;
277 template <
typename Po
intT1,
typename Po
intT2>
282 to->header.stamp = from->header.stamp;
300 template <
typename Po
intT>
309 template <
typename Po
intT>
uint64_t sec
seconds part of time
Fawkes library namespace.
virtual bool get_bool(const char *path)=0
Get value from configuration which is of type bool.
uint64_t timestamp
Access timestamp as number only.
A class for handling time.
Base class for exceptions in Fawkes.
Union to pack fawkes::Time into the pcl::PointCloud timestamp.
uint64_t usec
microseconds part of time
void operator()(T *t)
Delete operator that does nothing.
Helper struct to avoid deletion of PointClouds.
long get_sec() const
Get seconds.
long get_usec() const
Get microseconds.
RefPtr<> is a reference-counting shared smartpointer.
void set_time(const timeval *tv)
Sets the time.
long in_usec() const
Convert the stored time into micro-seconds.
struct fawkes::pcl_utils::PointCloudTimestamp::@4 time
Access timestamp as time.
Interface for configuration handling.