43 #include <pcl/conversions.h>
45 #include <pcl/pcl_config.h>
46 #include <pcl/common/time_trigger.h>
47 #include <pcl/io/grabber.h>
48 #include <pcl/io/file_grabber.h>
68 ImageGrabberBase (
const std::string& directory,
float frames_per_second,
bool repeat,
bool pclzf_mode);
70 ImageGrabberBase (
const std::string& depth_directory,
const std::string& rgb_directory,
float frames_per_second,
bool repeat);
76 ImageGrabberBase (
const std::vector<std::string>& depth_image_files,
float frames_per_second,
bool repeat);
97 isRunning ()
const override;
101 getName ()
const override;
109 getFramesPerSecond ()
const override;
117 atLastFrame ()
const;
121 getCurrentDepthFileName ()
const;
126 getPrevDepthFileName ()
const;
130 getDepthFileNameAtIndex (std::size_t idx)
const;
134 getTimestampAtIndex (std::size_t idx, std::uint64_t ×tamp)
const;
140 setRGBImageFiles (
const std::vector<std::string>& rgb_image_files);
149 setCameraIntrinsics (
const double focal_length_x,
150 const double focal_length_y,
151 const double principal_point_x,
152 const double principal_point_y);
161 getCameraIntrinsics (
double &focal_length_x,
162 double &focal_length_y,
163 double &principal_point_x,
164 double &principal_point_y)
const;
169 setDepthImageUnits (
float units);
174 setNumberOfThreads (
unsigned int nr_threads = 0);
184 getCloudAt (std::size_t idx,
pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation)
const;
189 publish (
const pcl::PCLPointCloud2& blob,
const Eigen::Vector4f& origin,
const Eigen::Quaternionf& orientation)
const = 0;
193 struct ImageGrabberImpl;
194 ImageGrabberImpl* impl_;
202 using Ptr = shared_ptr<ImageGrabber>;
206 float frames_per_second = 0,
208 bool pclzf_mode =
false);
211 const std::string& rgb_dir,
212 float frames_per_second = 0,
213 bool repeat =
false);
215 ImageGrabber (
const std::vector<std::string>& depth_image_files,
216 float frames_per_second = 0,
217 bool repeat =
false);
228 size ()
const override;
233 const Eigen::Vector4f& origin,
234 const Eigen::Quaternionf& orientation)
const override;
239 template<
typename Po
intT>
241 float frames_per_second,
250 template<
typename Po
intT>
252 const std::string& rgb_dir,
253 float frames_per_second,
261 template<
typename Po
intT>
263 float frames_per_second,
265 :
ImageGrabberBase (depth_image_files, frames_per_second, repeat), signal_ ()
275 Eigen::Vector4f origin;
276 Eigen::Quaternionf orientation;
277 getCloudAt (idx, blob, origin, orientation);
286 template <
typename Po
intT> std::size_t
289 return (numFrames ());
293 template<
typename Po
intT>
void
301 signal_->operator () (cloud);