Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
toposens_pointcloud::Logging Class Reference

Demonstrates basic TF and PCL integrations for TsScan data. More...

#include <logging.h>

Public Member Functions

 Logging (ros::NodeHandle nh, ros::NodeHandle private_nh)
 
void save (const ros::TimerEvent &event)
 
 ~Logging ()
 

Static Public Member Functions

static void logPointcloud ()
 

Private Member Functions

void _accumulate (const XYZINCloud::ConstPtr &msg)
 

Private Attributes

ros::Subscriber cloud_sub_
 
std::string pcd_path_
 
XYZINCloud::Ptr store_
 
boost::mutex store_mutex_
 
ros::Timer timer_
 

Detailed Description

Demonstrates basic TF and PCL integrations for TsScan data.

Subscribes to a topic publishing TsPoints and maintains an cummulative pointcloud structure of all points.

Maintains a persistent PointCloud structure holding the cumulative of all scans received during a run. This cumulative data is saved periodically as a PCD file in the package folder for subsequent use with other PCL tools (like pcl_octree_viewer).

Definition at line 34 of file logging.h.

Constructor & Destructor Documentation

◆ Logging()

toposens_pointcloud::Logging::Logging ( ros::NodeHandle  nh,
ros::NodeHandle  private_nh 
)

Subscribes to a #kCloudTopic and prepares a PointCloud structure for persistent storage.

Parameters
nhPublic nodehandle for pub-sub ops on ROS topics.
private_nhPrivate nodehandle for accessing launch parameters.
pcd_save_ratedefines save interval of cumulative pointcloud.

If no file is specified as a launch argument, the default path "/home/$USER/.ros/toposens.pcd" is used to store the PCD.

Definition at line 5 of file logging.cpp.

◆ ~Logging()

toposens_pointcloud::Logging::~Logging ( )

Destructor frees memory from heap

Definition at line 29 of file logging.cpp.

Member Function Documentation

◆ _accumulate()

void toposens_pointcloud::Logging::_accumulate ( const XYZINCloud::ConstPtr &  msg)
private

Waits for pointcloud updates to become available and accumulates them in a perisistent pointcloud structure.

Waits for a pointcloud updates to become available and accumulates them in a persistent pointcloud structure.

Parameters
msgPointer to an incoming TsScan message.

Definition at line 54 of file logging.cpp.

◆ logPointcloud()

static void toposens_pointcloud::Logging::logPointcloud ( )
inlinestatic

Self-contained Logging class handler that can be threaded.

Parameters
pcd_save_ratedefines save interval of cumulative pointcloud.

Definition at line 63 of file logging.h.

◆ save()

void toposens_pointcloud::Logging::save ( const ros::TimerEvent event)

Saves all pointcloud data contained in #store as a PCD file whose path is specified by #pcd_path.

Filename is provided as a launch argument. File is saved as a .pcd.

Parameters
eventTimerEvent, currently ignored.

Definition at line 31 of file logging.cpp.

Member Data Documentation

◆ cloud_sub_

ros::Subscriber toposens_pointcloud::Logging::cloud_sub_
private

Handler for subscribing to TsPoints.

Definition at line 96 of file logging.h.

◆ pcd_path_

std::string toposens_pointcloud::Logging::pcd_path_
private

Path of file in which pointcloud is stored by save().

Definition at line 94 of file logging.h.

◆ store_

XYZINCloud::Ptr toposens_pointcloud::Logging::store_
private

Collection of all pointclouds from a single run.

Definition at line 93 of file logging.h.

◆ store_mutex_

boost::mutex toposens_pointcloud::Logging::store_mutex_
private

Mutex for locking pointcloud.

Definition at line 99 of file logging.h.

◆ timer_

ros::Timer toposens_pointcloud::Logging::timer_
private

Timer for pointcloud saving interval.

Definition at line 97 of file logging.h.


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


toposens_pointcloud
Author(s): Adi Singh, Sebastian Dengler, Christopher Lang, Inshal Uddin
autogenerated on Mon Feb 28 2022 23:57:49