Point Cloud Library (PCL) 1.15.0
Loading...
Searching...
No Matches
pcl::PCDGrabberBase Class Referenceabstract

Base class for PCD file grabber. More...

#include <pcl/io/pcd_grabber.h>

Inheritance diagram for pcl::PCDGrabberBase:
Collaboration diagram for pcl::PCDGrabberBase:

Public Member Functions

 PCDGrabberBase (const std::string &pcd_file, float frames_per_second, bool repeat)
 Constructor taking just one PCD file or one TAR file containing multiple PCD files.
 PCDGrabberBase (const std::vector< std::string > &pcd_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.
 ~PCDGrabberBase () noexcept override
 Virtual destructor.
void start () override
 Starts playing the list of PCD files if frames_per_second is > 0.
void stop () override
 Stops playing the list of PCD files if frames_per_second is > 0.
virtual void trigger ()
 Triggers a callback with new data.
bool isRunning () const override
 Indicates whether the grabber is streaming or not.
std::string getName () const override
virtual void rewind ()
 Rewinds to the first PCD file in the list.
float getFramesPerSecond () const override
 Returns the frames_per_second.
bool isRepeatOn () const
 Returns whether the repeat flag is on.
bool getCloudAt (std::size_t idx, pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const
 Get cloud (in ROS form) at a particular location.
std::size_t numFrames () const
 Returns the size.
Public Member Functions inherited from pcl::Grabber
 Grabber ()=default
 Default ctor.
 Grabber (const Grabber &)=delete
 No copy ctor since Grabber can't be copied.
Grabberoperator= (const Grabber &)=delete
 No copy assign operator since Grabber can't be copied.
 Grabber (Grabber &&)=default
 Move ctor.
Grabberoperator= (Grabber &&)=default
 Move assign operator.
virtual ~Grabber () noexcept=default
 virtual destructor.
template<typename T>
boost::signals2::connection registerCallback (const std::function< T > &callback)
 registers a callback function/method to a signal with the corresponding signature
template<typename T>
bool providesCallback () const noexcept
 indicates whether a signal with given parameter-type exists or not
bool toggle ()
 For devices that are streaming, stopped streams are started and running stream are stopped.

Additional Inherited Members

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 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

Base class for PCD file grabber.

Definition at line 63 of file pcd_grabber.h.

Constructor & Destructor Documentation

◆ PCDGrabberBase() [1/2]

pcl::PCDGrabberBase::PCDGrabberBase ( const std::string & pcd_file,
float frames_per_second,
bool repeat )

Constructor taking just one PCD file or one TAR file containing multiple PCD files.

Parameters
[in]pcd_filepath to the PCD file
[in]frames_per_secondframes per second. If 0, start() functions like a trigger, publishing the next PCD in the list.
[in]repeatwhether to play PCD file in an endless loop or not.

Referenced by pcl::PCDGrabber< PointT >::PCDGrabber(), and pcl::PCDGrabber< PointT >::PCDGrabber().

◆ PCDGrabberBase() [2/2]

pcl::PCDGrabberBase::PCDGrabberBase ( const std::vector< std::string > & pcd_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.

Parameters
[in]pcd_filesvector of paths to PCD files.
[in]frames_per_secondframes per second. If 0, start() functions like a trigger, publishing the next PCD in the list.
[in]repeatwhether to play PCD file in an endless loop or not.

◆ ~PCDGrabberBase()

pcl::PCDGrabberBase::~PCDGrabberBase ( )
overridenoexcept

Virtual destructor.

Member Function Documentation

◆ getCloudAt()

bool pcl::PCDGrabberBase::getCloudAt ( std::size_t idx,
pcl::PCLPointCloud2 & blob,
Eigen::Vector4f & origin,
Eigen::Quaternionf & orientation ) const

Get cloud (in ROS form) at a particular location.

References getCloudAt().

Referenced by getCloudAt(), and pcl::PCDGrabber< PointT >::operator[]().

◆ getFramesPerSecond()

float pcl::PCDGrabberBase::getFramesPerSecond ( ) const
overridevirtual

Returns the frames_per_second.

0 if grabber is trigger-based

Implements pcl::Grabber.

References getFramesPerSecond().

Referenced by getFramesPerSecond().

◆ getName()

std::string pcl::PCDGrabberBase::getName ( ) const
overridevirtual
Returns
The name of the grabber

Implements pcl::Grabber.

References getName().

Referenced by getName().

◆ isRepeatOn()

bool pcl::PCDGrabberBase::isRepeatOn ( ) const

Returns whether the repeat flag is on.

References isRepeatOn().

Referenced by isRepeatOn().

◆ isRunning()

bool pcl::PCDGrabberBase::isRunning ( ) const
overridevirtual

Indicates whether the grabber is streaming or not.

Returns
true if grabber is started and hasn't run out of PCD files.

Implements pcl::Grabber.

References isRunning().

Referenced by isRunning().

◆ numFrames()

std::size_t pcl::PCDGrabberBase::numFrames ( ) const

Returns the size.

References numFrames().

Referenced by numFrames(), and pcl::PCDGrabber< PointT >::size().

◆ rewind()

virtual void pcl::PCDGrabberBase::rewind ( )
virtual

Rewinds to the first PCD file in the list.

References rewind().

Referenced by rewind().

◆ start()

void pcl::PCDGrabberBase::start ( )
overridevirtual

Starts playing the list of PCD files if frames_per_second is > 0.

Otherwise it works as a trigger: publishes only the next PCD file in the list.

Implements pcl::Grabber.

References start().

Referenced by start().

◆ stop()

void pcl::PCDGrabberBase::stop ( )
overridevirtual

Stops playing the list of PCD files if frames_per_second is > 0.

Otherwise the method has no effect.

Implements pcl::Grabber.

References stop().

Referenced by stop(), and pcl::PCDGrabber< PointT >::~PCDGrabber().

◆ trigger()

virtual void pcl::PCDGrabberBase::trigger ( )
virtual

Triggers a callback with new data.

References trigger().

Referenced by trigger().


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