42 #ifndef __PCL_IO_IMAGE_GRABBER__ 43 #define __PCL_IO_IMAGE_GRABBER__ 45 #include "pcl/pcl_config.h" 46 #include <pcl/io/grabber.h> 47 #include <pcl/io/file_grabber.h> 48 #include <pcl/common/time_trigger.h> 51 #include <pcl/conversions.h> 67 ImageGrabberBase (
const std::string& directory,
float frames_per_second,
bool repeat,
bool pclzf_mode);
69 ImageGrabberBase (
const std::string& depth_directory,
const std::string& rgb_directory,
float frames_per_second,
bool repeat);
75 ImageGrabberBase (
const std::vector<std::string>& depth_image_files,
float frames_per_second,
bool repeat);
126 getFramesPerSecond ()
const;
134 atLastFrame ()
const;
138 getCurrentDepthFileName ()
const;
143 getPrevDepthFileName ()
const;
147 getDepthFileNameAtIndex (
size_t idx)
const;
151 getTimestampAtIndex (
size_t idx, pcl::uint64_t ×tamp)
const;
157 setRGBImageFiles (
const std::vector<std::string>& rgb_image_files);
166 setCameraIntrinsics (
const double focal_length_x,
167 const double focal_length_y,
168 const double principal_point_x,
169 const double principal_point_y);
178 getCameraIntrinsics (
double &focal_length_x,
179 double &focal_length_y,
180 double &principal_point_x,
181 double &principal_point_y)
const;
186 setDepthImageUnits (
float units);
191 setNumberOfThreads (
unsigned int nr_threads = 0);
201 getCloudAt (
size_t idx,
pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation)
const;
206 publish (
const pcl::PCLPointCloud2& blob,
const Eigen::Vector4f& origin,
const Eigen::Quaternionf& orientation)
const = 0;
210 struct ImageGrabberImpl;
211 ImageGrabberImpl* impl_;
220 float frames_per_second = 0,
222 bool pclzf_mode =
false);
225 const std::string& rgb_dir,
226 float frames_per_second = 0,
227 bool repeat =
false);
229 ImageGrabber (
const std::vector<std::string>& depth_image_files,
230 float frames_per_second = 0,
231 bool repeat =
false);
237 const boost::shared_ptr< const pcl::PointCloud<PointT> >
238 operator[] (
size_t idx)
const;
247 const Eigen::Vector4f& origin,
248 const Eigen::Quaternionf& orientation)
const;
249 boost::signals2::signal<void (const boost::shared_ptr<const pcl::PointCloud<PointT> >&)>* signal_;
253 template<
typename Po
intT>
255 float frames_per_second,
260 signal_ = createSignal<void (const boost::shared_ptr<const pcl::PointCloud<PointT> >&)>();
264 template<
typename Po
intT>
266 const std::string& rgb_dir,
267 float frames_per_second,
271 signal_ = createSignal<void (const boost::shared_ptr<const pcl::PointCloud<PointT> >&)>();
275 template<
typename Po
intT>
277 float frames_per_second,
281 signal_ = createSignal<void (const boost::shared_ptr<const pcl::PointCloud<PointT> >&)>();
285 template<
typename Po
intT>
const boost::shared_ptr< const pcl::PointCloud<PointT> >
289 Eigen::Vector4f origin;
290 Eigen::Quaternionf orientation;
300 template <
typename Po
intT>
size_t 307 template<
typename Po
intT>
void void fromPCLPointCloud2(const pcl::PCLPointCloud2 &msg, pcl::PointCloud< PointT > &cloud, const MsgFieldMap &field_map)
Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud<T> object using a field_map...
Base class for Image file grabber.
size_t size() const
size Returns the number of clouds currently loaded by the grabber
bool getCloudAt(size_t idx, pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const
Gets the cloud in ROS form at location idx.
virtual void publish(const pcl::PCLPointCloud2 &blob, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) const
Grabber interface for PCL 1.x device drivers.
boost::shared_ptr< PointCloud< PointT > > Ptr
Eigen::Vector4f sensor_origin_
Sensor acquisition pose (origin/translation).
size_t numFrames() const
Convenience function to see how many frames this consists of.
virtual ~ImageGrabber()
Empty destructor.
FileGrabber provides a container-style interface for grabbers which operate on fixed-size input...
Eigen::Quaternionf sensor_orientation_
Sensor acquisition pose (rotation).
const boost::shared_ptr< const pcl::PointCloud< PointT > > operator[](size_t idx) const
operator[] Returns the idx-th cloud in the dataset, without bounds checking.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
boost::signals2::signal< void(const boost::shared_ptr< const pcl::PointCloud< PointT > > &)> * signal_
ImageGrabber(const std::string &dir, float frames_per_second=0, bool repeat=false, bool pclzf_mode=false)
ImageGrabberBase(const ImageGrabberBase &src)
Copy constructor.