23 #ifndef _LIBS_PCL_UTILS_STORAGE_ADAPTER_H_
24 #define _LIBS_PCL_UTILS_STORAGE_ADAPTER_H_
26 #include <pcl/point_cloud.h>
27 #include <pcl_utils/transforms.h>
28 #include <pcl_utils/utils.h>
33 template <
typename Po
intT>
34 class PointCloudStorageAdapter;
42 template <
typename Po
intT>
45 template <
typename Po
intT>
50 virtual void transform(
const std::string & target_frame,
51 const Time & target_time,
52 const std::string & fixed_frame,
58 virtual unsigned int width()
const = 0;
59 virtual unsigned int height()
const = 0;
66 template <
typename Po
intT>
93 return pcl_utils::cloudptr_from_refptr(
cloud);
102 return pcl_utils::cloudptr_from_refptr(
cloud);
122 virtual void transform(
const std::string & target_frame,
123 const Time & target_time,
124 const std::string & fixed_frame,
133 return typeid(
this).name();
142 return sizeof(PointT);
160 return cloud->height;
169 return cloud->points.size();
178 return &
cloud->points[0];
187 return cloud->header.frame_id;
196 template <
typename Po
intT>
205 template <
typename Po
intT>
211 throw Exception(
"PointCloud storage adapter is not of anticipated type");
216 template <
typename Po
intT>
223 template <
typename Po
intT>
227 pcl_utils::get_time(cloud, time);
230 template <
typename Po
intT>
236 pcl_utils::transform_pointcloud(target_frame, **cloud, tmp, transformer);
240 template <
typename Po
intT>
243 const Time & target_time,
244 const std::string & fixed_frame,
248 pcl_utils::transform_pointcloud(
249 target_frame, target_time, fixed_frame, **cloud, tmp, transformer);
Base class for exceptions in Fawkes.
RefPtr<> is a reference-counting shared smartpointer.
A class for handling time.
Adapter class for PCL point types.
virtual unsigned int height() const
Get height of point cloud.
virtual void get_time(fawkes::Time &time) const
Get last capture time.
virtual const char * get_typename()
Get typename of storage adapter.
PointCloudStorageAdapter(const PointCloudStorageAdapter< PointT > *p)
Copy constructor.
virtual std::string frame_id() const
Get frame ID of point cloud.
virtual size_t num_points() const
Get numer of points in point cloud.
virtual StorageAdapter * clone() const
Clone this storage adapter.
PointCloudStorageAdapter(RefPtr< pcl::PointCloud< PointT >> cloud)
Constructor.
virtual void * data_ptr() const
Get pointer on data.
pcl::PointCloud< PointT >::ConstPtr cloud_const_ptr()
Get PCL const shared pointer to cloud.
virtual size_t point_size() const
Get size of a point.
const RefPtr< pcl::PointCloud< PointT > > cloud
The point cloud.
pcl::PointCloud< PointT >::Ptr cloud_ptr()
Get PCL shared pointer to cloud.
virtual unsigned int width() const
Get width of point cloud.
virtual void transform(const std::string &target_frame, const tf::Transformer &transformer)
Transform the point cloud.
virtual void transform(const std::string &target_frame, const Time &target_time, const std::string &fixed_frame, const tf::Transformer &transformer)=0
Transform point cloud.
virtual size_t point_size() const =0
Get size of a point.
virtual unsigned int width() const =0
Get width of point cloud.
virtual void transform(const std::string &target_frame, const tf::Transformer &transformer)=0
Transform point cloud.
virtual unsigned int height() const =0
Get height of point cloud.
PointCloudStorageAdapter< PointT > * as_pointtype()
Transform to specific PointCloudStorageAdapter.
virtual size_t num_points() const =0
Get numer of points in point cloud.
virtual void get_time(fawkes::Time &time) const =0
Get last capture time.
virtual std::string frame_id() const =0
Get frame ID of point cloud.
virtual void * data_ptr() const =0
Get pointer on data.
virtual StorageAdapter * clone() const =0
Clone this storage adapter.
virtual const char * get_typename()=0
Get typename of storage adapter.
virtual ~StorageAdapter()
Virtual empty destructor.
bool is_pointtype() const
Check if storage adapter is for specified point type.
Fawkes library namespace.