Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::ImageGrabber< PointT > Class Template Reference

#include <pcl/io/image_grabber.h>

+ Inheritance diagram for pcl::ImageGrabber< PointT >:
+ Collaboration diagram for pcl::ImageGrabber< PointT >:

Public Types

using Ptr = shared_ptr< ImageGrabber >
 
using ConstPtr = shared_ptr< const ImageGrabber >
 

Public Member Functions

 ImageGrabber (const std::string &dir, float frames_per_second=0, bool repeat=false, bool pclzf_mode=false)
 
 ImageGrabber (const std::string &depth_dir, const std::string &rgb_dir, float frames_per_second=0, bool repeat=false)
 
 ImageGrabber (const std::vector< std::string > &depth_image_files, float frames_per_second=0, bool repeat=false)
 
 ~ImageGrabber () noexcept override=default
 Empty destructor. More...
 
const pcl::PointCloud< PointT >::ConstPtr operator[] (std::size_t idx) const override
 operator[] Returns the idx-th cloud in the dataset, without bounds checking. More...
 
std::size_t size () const override
 size Returns the number of clouds currently loaded by the grabber More...
 
- Public Member Functions inherited from pcl::ImageGrabberBase
 ImageGrabberBase (const std::string &directory, float frames_per_second, bool repeat, bool pclzf_mode)
 Constructor taking a folder of depth+[rgb] images. More...
 
 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. More...
 
 ~ImageGrabberBase () noexcept override
 Virtual destructor. More...
 
void start () override
 Starts playing the list of PCD files if frames_per_second is > 0. More...
 
void stop () override
 Stops playing the list of PCD files if frames_per_second is > 0. More...
 
virtual void trigger ()
 Triggers a callback with new data. More...
 
bool isRunning () const override
 whether the grabber is started (publishing) or not. More...
 
std::string getName () const override
 
virtual void rewind ()
 Rewinds to the first PCD file in the list. More...
 
float getFramesPerSecond () const override
 Returns the frames_per_second. More...
 
bool isRepeatOn () const
 Returns whether the repeat flag is on. More...
 
bool atLastFrame () const
 Returns if the last frame is reached. More...
 
std::string getCurrentDepthFileName () const
 Returns the filename of the current indexed file. More...
 
std::string getPrevDepthFileName () const
 Returns the filename of the previous indexed file SDM: adding this back in, but is this useful, or confusing? More...
 
std::string getDepthFileNameAtIndex (std::size_t idx) const
 Get the depth filename at a particular index. More...
 
bool getTimestampAtIndex (std::size_t idx, std::uint64_t &timestamp) const
 Query only the timestamp of an index, if it exists. More...
 
void setRGBImageFiles (const std::vector< std::string > &rgb_image_files)
 Manually set RGB image files. More...
 
virtual void setCameraIntrinsics (const double focal_length_x, const double focal_length_y, const double principal_point_x, const double principal_point_y)
 Define custom focal length and center pixel. More...
 
virtual void getCameraIntrinsics (double &focal_length_x, double &focal_length_y, double &principal_point_x, double &principal_point_y) const
 Get the current focal length and center pixel. More...
 
void setDepthImageUnits (float units)
 Define the units the depth data is stored in. More...
 
void setNumberOfThreads (unsigned int nr_threads=0)
 Set the number of threads, if we wish to use OpenMP for quicker cloud population. More...
 
- Public Member Functions inherited from pcl::Grabber
 Grabber ()=default
 Default ctor. More...
 
 Grabber (const Grabber &)=delete
 No copy ctor since Grabber can't be copied. More...
 
Grabberoperator= (const Grabber &)=delete
 No copy assign operator since Grabber can't be copied. More...
 
 Grabber (Grabber &&)=default
 Move ctor. More...
 
Grabberoperator= (Grabber &&)=default
 Move assign operator. More...
 
virtual ~Grabber () noexcept=default
 virtual destructor. More...
 
template<typename T >
boost::signals2::connection registerCallback (const std::function< T > &callback)
 registers a callback function/method to a signal with the corresponding signature More...
 
template<typename T >
bool providesCallback () const noexcept
 indicates whether a signal with given parameter-type exists or not More...
 
bool toggle ()
 For devices that are streaming, stopped streams are started and running stream are stopped. More...
 
- Public Member Functions inherited from pcl::FileGrabber< PointT >
virtual ~FileGrabber ()=default
 Empty destructor. More...
 
virtual const pcl::PointCloud< PointT >::ConstPtr at (std::size_t idx) const
 at Returns the idx-th cloud in the dataset, with bounds checking More...
 

Protected Member Functions

void publish (const pcl::PCLPointCloud2 &blob, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) const override
 
- Protected Member Functions inherited from pcl::ImageGrabberBase
std::size_t numFrames () const
 Convenience function to see how many frames this consists of. More...
 
bool getCloudAt (std::size_t idx, pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const
 Gets the cloud in ROS form at location idx. More...
 
- Protected Member Functions inherited from pcl::Grabber
virtual void signalsChanged ()
 
template<typename T >
boost::signals2::signal< T > * find_signal () const noexcept
 
template<typename T >
int num_slots () const noexcept
 
template<typename T >
void disconnect_all_slots ()
 
template<typename T >
void block_signal ()
 
template<typename T >
void unblock_signal ()
 
void block_signals ()
 
void unblock_signals ()
 
template<typename T >
boost::signals2::signal< T > * createSignal ()
 

Protected Attributes

boost::signals2::signal< void(const typename pcl::PointCloud< PointT >::ConstPtr &)> * signal_
 
- Protected Attributes inherited from pcl::Grabber
std::map< std::string, std::unique_ptr< boost::signals2::signal_base > > signals_
 
std::map< std::string, std::vector< boost::signals2::connection > > connections_
 
std::map< std::string, std::vector< boost::signals2::shared_connection_block > > shared_connections_
 

Detailed Description

template<typename PointT>
class pcl::ImageGrabber< PointT >

Definition at line 199 of file image_grabber.h.

Member Typedef Documentation

◆ ConstPtr

template<typename PointT >
using pcl::ImageGrabber< PointT >::ConstPtr = shared_ptr<const ImageGrabber>

Definition at line 203 of file image_grabber.h.

◆ Ptr

template<typename PointT >
using pcl::ImageGrabber< PointT >::Ptr = shared_ptr<ImageGrabber>

Definition at line 202 of file image_grabber.h.

Constructor & Destructor Documentation

◆ ImageGrabber() [1/3]

template<typename PointT >
pcl::ImageGrabber< PointT >::ImageGrabber ( const std::string &  dir,
float  frames_per_second = 0,
bool  repeat = false,
bool  pclzf_mode = false 
)

Definition at line 240 of file image_grabber.h.

◆ ImageGrabber() [2/3]

template<typename PointT >
pcl::ImageGrabber< PointT >::ImageGrabber ( const std::string &  depth_dir,
const std::string &  rgb_dir,
float  frames_per_second = 0,
bool  repeat = false 
)

◆ ImageGrabber() [3/3]

template<typename PointT >
pcl::ImageGrabber< PointT >::ImageGrabber ( const std::vector< std::string > &  depth_image_files,
float  frames_per_second = 0,
bool  repeat = false 
)

◆ ~ImageGrabber()

template<typename PointT >
pcl::ImageGrabber< PointT >::~ImageGrabber ( )
overridedefaultnoexcept

Empty destructor.

Member Function Documentation

◆ operator[]()

template<typename PointT >
const pcl::PointCloud< PointT >::ConstPtr pcl::ImageGrabber< PointT >::operator[] ( std::size_t  idx) const
overridevirtual

operator[] Returns the idx-th cloud in the dataset, without bounds checking.

Note that in the future, this could easily be modified to do caching

Parameters
[in]idxThe frame to load

Implements pcl::FileGrabber< PointT >.

Definition at line 272 of file image_grabber.h.

References pcl::fromPCLPointCloud2(), pcl::PointCloud< PointT >::sensor_orientation_, and pcl::PointCloud< PointT >::sensor_origin_.

◆ publish()

template<typename PointT >
void pcl::ImageGrabber< PointT >::publish ( const pcl::PCLPointCloud2 blob,
const Eigen::Vector4f &  origin,
const Eigen::Quaternionf &  orientation 
) const
overrideprotectedvirtual

◆ size()

template<typename PointT >
std::size_t pcl::ImageGrabber< PointT >::size ( ) const
overridevirtual

size Returns the number of clouds currently loaded by the grabber

Implements pcl::FileGrabber< PointT >.

Definition at line 287 of file image_grabber.h.

Member Data Documentation

◆ signal_

template<typename PointT >
boost::signals2::signal<void (const typename pcl::PointCloud<PointT>::ConstPtr&)>* pcl::ImageGrabber< PointT >::signal_
protected

Definition at line 235 of file image_grabber.h.

Referenced by pcl::ImageGrabber< PointT >::ImageGrabber().


The documentation for this class was generated from the following file: