23 #ifndef __LIBS_PCL_UTILS_STORAGE_ADAPTER_H_ 24 #define __LIBS_PCL_UTILS_STORAGE_ADAPTER_H_ 26 #include <pcl_utils/utils.h> 27 #include <pcl_utils/transforms.h> 28 #include <pcl/point_cloud.h> 37 template <
typename Po
intT>
45 template <
typename Po
intT>
48 template <
typename Po
intT>
51 virtual void transform(
const std::string &target_frame,
54 virtual void transform(
const std::string &target_frame,
55 const Time &target_time,
56 const std::string &fixed_frame,
62 virtual unsigned int width()
const = 0;
63 virtual unsigned int height()
const = 0;
66 virtual std::string
frame_id()
const = 0;
70 template <
typename Po
intT>
93 {
return pcl_utils::cloudptr_from_refptr(cloud); }
99 {
return pcl_utils::cloudptr_from_refptr(cloud); }
103 virtual void transform(
const std::string &target_frame,
106 virtual void transform(
const std::string &target_frame,
107 const Time &target_time,
108 const std::string &fixed_frame,
113 virtual unsigned int width()
const {
return cloud->width; }
114 virtual unsigned int height()
const {
return cloud->height; }
115 virtual size_t num_points()
const {
return cloud->points.size(); }
116 virtual void *
data_ptr()
const {
return &cloud->points[0]; }
117 virtual std::string
frame_id()
const {
return cloud->header.frame_id; }
121 template <
typename Po
intT>
131 template <
typename Po
intT>
138 throw Exception(
"PointCloud storage adapter is not of anticipated type");
144 template <
typename Po
intT>
152 template <
typename Po
intT>
156 pcl_utils::get_time(cloud, time);
160 template <
typename Po
intT>
166 pcl_utils::transform_pointcloud(target_frame, **cloud, tmp, transformer);
170 template <
typename Po
intT>
173 const Time &target_time,
174 const std::string &fixed_frame,
178 pcl_utils::transform_pointcloud(target_frame, target_time, fixed_frame,
179 **cloud, tmp, transformer);
const RefPtr< pcl::PointCloud< PointT > > cloud
The point cloud.
virtual void get_time(fawkes::Time &time) const
Get last capture time.
Fawkes library namespace.
virtual unsigned int width() const =0
Get width of point cloud.
virtual unsigned int height() const
Get height of point cloud.
virtual StorageAdapter * clone() const =0
Clone this storage adapter.
A class for handling time.
virtual size_t num_points() const
Get numer of points in point cloud.
virtual size_t point_size() const =0
Get size of a point.
virtual unsigned int height() const =0
Get height of point cloud.
Adapter class for PCL point types.
virtual size_t point_size() const
Get size of a point.
bool is_pointtype() const
Check if storage adapter is for specified point type.
virtual std::string frame_id() const =0
Get frame ID of point cloud.
virtual std::string frame_id() const
Get frame ID of point cloud.
PointCloudStorageAdapter< PointT > * as_pointtype()
Transform to specific PointCloudStorageAdapter.
virtual unsigned int width() const
Get width of point cloud.
virtual void * data_ptr() const =0
Get pointer on data.
virtual void transform(const std::string &target_frame, const tf::Transformer &transformer)
Transform point cloud.
PointCloudStorageAdapter(RefPtr< pcl::PointCloud< PointT > > cloud)
Constructor.
Base class for exceptions in Fawkes.
virtual StorageAdapter * clone() const
Clone this storage adapter.
PointCloudStorageAdapter(const PointCloudStorageAdapter< PointT > *p)
Copy constructor.
pcl::PointCloud< PointT >::Ptr cloud_ptr()
Get PCL shared pointer to cloud.
virtual void get_time(fawkes::Time &time) const =0
Get last capture time.
virtual const char * get_typename()
Get typename of storage adapter.
RefPtr<> is a reference-counting shared smartpointer.
virtual const char * get_typename()=0
Get typename of storage adapter.
virtual ~StorageAdapter()
Virtual empty destructor.
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 num_points() const =0
Get numer of points in point cloud.
virtual void transform(const std::string &target_frame, const tf::Transformer &transformer)=0
Transform point cloud.