Fawkes API  Fawkes Development Version
PointCloudAdapter Class Reference

Point cloud adapter class. More...

#include <>>

Classes

class  PointFieldInfo
 Information about the data fields. More...
 

Public Types

typedef std::vector< PointFieldInfoV_PointFieldInfo
 Vector of PointFieldInfo. More...
 

Public Member Functions

 PointCloudAdapter (fawkes::PointCloudManager *pcl_manager, fawkes::Logger *logger)
 Constructor. More...
 
 ~PointCloudAdapter ()
 Destructor. More...
 
void get_info (const std::string &id, unsigned int &width, unsigned int &height, std::string &frame_id, bool &is_dense, V_PointFieldInfo &pfi)
 Get info about point cloud. More...
 
void get_data (const std::string &id, std::string &frame_id, unsigned int &width, unsigned int &height, fawkes::Time &time, void **data_ptr, size_t &point_size, size_t &num_points)
 Get current data of point cloud. More...
 
void get_data_and_info (const std::string &id, std::string &frame_id, bool &is_dense, unsigned int &width, unsigned int &height, fawkes::Time &time, V_PointFieldInfo &pfi, void **data_ptr, size_t &point_size, size_t &num_points)
 Get data and info of point cloud. More...
 
void close (const std::string &id)
 Close an adapter. More...
 

Detailed Description

Point cloud adapter class.

Currently, the standalone PCL comes with sensor_msgs and std_msgs data types which are incompatible with the ones that come with ROS. Hence, to use both in the same plugin, we need to confine the two different type instances into their own modules. While the rest of the ros-pcl plugins uses ROS-specific data types, this very class interacts with and only with the standalone PCL and the PointCloudManager. Interaction to the ROS parts is done by passing internal data types so that exchange can happen without common sensor_msgs or std_msgs data types.

Author
Tim Niemueller

Definition at line 38 of file pcl_adapter.h.

Member Typedef Documentation

◆ V_PointFieldInfo

Vector of PointFieldInfo.

Definition at line 62 of file pcl_adapter.h.

Constructor & Destructor Documentation

◆ PointCloudAdapter()

PointCloudAdapter::PointCloudAdapter ( fawkes::PointCloudManager pcl_manager,
fawkes::Logger logger 
)

Constructor.

Parameters
pcl_managerPCL manager
loggerlogger

Definition at line 72 of file pcl_adapter.cpp.

◆ ~PointCloudAdapter()

PointCloudAdapter::~PointCloudAdapter ( )

Destructor.

Definition at line 80 of file pcl_adapter.cpp.

Member Function Documentation

◆ close()

void PointCloudAdapter::close ( const std::string &  id)

Close an adapter.

Parameters
idID of point cloud to close

Definition at line 226 of file pcl_adapter.cpp.

Referenced by RosPointCloudThread::loop().

◆ get_data()

void PointCloudAdapter::get_data ( const std::string &  id,
std::string &  frame_id,
unsigned int &  width,
unsigned int &  height,
fawkes::Time time,
void **  data_ptr,
size_t &  point_size,
size_t &  num_points 
)

Get current data of point cloud.

Parameters
idID of point cloud to get info from
frame_idupon return contains the frame ID of the point cloud
widthupon return contains width of point cloud
heightupon return contains width of point cloud
timecapture time
data_ptrupon return contains pointer to point cloud data
point_sizeupon return contains size of a single point
num_pointsupon return contains number of points

Definition at line 180 of file pcl_adapter.cpp.

References fawkes::pcl_utils::StorageAdapter::data_ptr(), fawkes::pcl_utils::StorageAdapter::frame_id(), fawkes::PointCloudManager::get_storage_adapter(), fawkes::pcl_utils::StorageAdapter::get_time(), fawkes::pcl_utils::StorageAdapter::height(), fawkes::pcl_utils::StorageAdapter::num_points(), fawkes::pcl_utils::StorageAdapter::point_size(), and fawkes::pcl_utils::StorageAdapter::width().

Referenced by get_data_and_info(), RosPointCloudThread::loop(), and MongoLogPointCloudThread::loop().

◆ get_data_and_info()

void PointCloudAdapter::get_data_and_info ( const std::string &  id,
std::string &  frame_id,
bool &  is_dense,
unsigned int &  width,
unsigned int &  height,
fawkes::Time time,
V_PointFieldInfo pfi,
void **  data_ptr,
size_t &  point_size,
size_t &  num_points 
)

Get data and info of point cloud.

Parameters
idID of point cloud to get info from
frame_idupon return contains frame ID of the point cloud
is_denseupon return contains true if point cloud is dense and false otherwise
widthupon return contains width of point cloud
heightupon return contains width of point cloud
timecapture time for which to get the data and info
pfiupon return contains data type information
data_ptrupon return contains pointer to point cloud data
point_sizeupon return contains size of a single point
num_pointsupon return contains number of points

Definition at line 212 of file pcl_adapter.cpp.

References get_data(), and get_info().

Referenced by PointCloudDBStoreThread::loop().

◆ get_info()

void PointCloudAdapter::get_info ( const std::string &  id,
unsigned int &  width,
unsigned int &  height,
std::string &  frame_id,
bool &  is_dense,
V_PointFieldInfo pfi 
)

Get info about point cloud.

Parameters
idID of point cloud to get info from
widthupon return contains width of point cloud
heightupon return contains width of point cloud
frame_idupon return contains frame ID of the point cloud
is_denseupon return contains true if point cloud is dense and false otherwise
pfiupon return contains data type information

Definition at line 139 of file pcl_adapter.cpp.

References fawkes::PointCloudManager::exists_pointcloud(), fawkes::PointCloudManager::get_pointcloud(), and fawkes::PointCloudManager::get_storage_adapter().

Referenced by get_data_and_info(), MongoLogPointCloudThread::init(), and RosPointCloudThread::loop().


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