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);
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);
224 operator[] (std::
size_t idx) const override;
228 size () const override;
233 const
Eigen::Vector4f& origin,
234 const
Eigen::Quaternionf& orientation) const override;
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);
FileGrabber provides a container-style interface for grabbers which operate on fixed-size input.
Grabber interface for PCL 1.x device drivers.
boost::signals2::signal< T > * createSignal()
Base class for Image file grabber.
~ImageGrabberBase() noexcept override
Virtual destructor.
ImageGrabberBase(const std::string &depth_directory, const std::string &rgb_directory, float frames_per_second, bool repeat)
ImageGrabberBase(const std::vector< std::string > &depth_image_files, float frames_per_second, bool repeat)
Constructor taking a list of paths to PCD files, that are played in the order they appear in the list...
ImageGrabberBase(const std::string &directory, float frames_per_second, bool repeat, bool pclzf_mode)
Constructor taking a folder of depth+[rgb] images.
ImageGrabber(const std::string &dir, float frames_per_second=0, bool repeat=false, bool pclzf_mode=false)
std::size_t size() const override
size Returns the number of clouds currently loaded by the grabber
void publish(const pcl::PCLPointCloud2 &blob, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) const override
shared_ptr< ImageGrabber > Ptr
const pcl::PointCloud< PointT >::ConstPtr operator[](std::size_t idx) const override
operator[] Returns the idx-th cloud in the dataset, without bounds checking.
boost::signals2::signal< void(const typename pcl::PointCloud< PointT >::ConstPtr &)> * signal_
~ImageGrabber() noexcept override=default
Empty destructor.
shared_ptr< const ImageGrabber > ConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
Eigen::Quaternionf sensor_orientation_
Sensor acquisition pose (rotation).
Eigen::Vector4f sensor_origin_
Sensor acquisition pose (origin/translation).
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
Defines functions, macros and traits for allocating and using memory.
void fromPCLPointCloud2(const pcl::PCLPointCloud2 &msg, pcl::PointCloud< PointT > &cloud, const MsgFieldMap &field_map, const std::uint8_t *msg_data)
Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud<T> object using a field_map.
A point structure representing Euclidean xyz coordinates, and the RGB color.