Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RosPointCloudAdapter Class Reference

Standalone PCL to ROS adapter class. More...

#include "pcl_adapter.h"

Classes

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

Public Types

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

Public Member Functions

 RosPointCloudAdapter (fawkes::PointCloudManager *pcl_manager, fawkes::Logger *logger)
 Constructor. More...
 
 ~RosPointCloudAdapter ()
 Destructor. More...
 
void get_info (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, 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 close (const std::string &id)
 Close an adapter. More...
 

Detailed Description

Standalone PCL to ROS 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 37 of file pcl_adapter.h.

Member Typedef Documentation

Vector of PointFieldInfo.

Definition at line 61 of file pcl_adapter.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
pcl_managerPCL manager
loggerlogger

Definition at line 69 of file pcl_adapter.cpp.

RosPointCloudAdapter::~RosPointCloudAdapter ( )

Destructor.

Definition at line 77 of file pcl_adapter.cpp.

Member Function Documentation

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

Close an adapter.

Parameters
idID of point cloud to close

Definition at line 185 of file pcl_adapter.cpp.

Referenced by RosPointCloudThread::loop().

void RosPointCloudAdapter::get_data ( const std::string &  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
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 163 of file pcl_adapter.cpp.

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

Referenced by RosPointCloudThread::loop().

void RosPointCloudAdapter::get_info ( 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 128 of file pcl_adapter.cpp.

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

Referenced by RosPointCloudThread::init().


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