Refactor to allow debug messages from node and nodelet

This commit is contained in:
Paul Bovbel
2015-01-15 12:03:52 -05:00
committed by Paul Bovbel
parent d604c43332
commit eafe961c0c
8 changed files with 209 additions and 253 deletions
@@ -38,8 +38,8 @@
* Author: Paul Bovbel
*/
#ifndef POINTCLOUD_TO_LASERSCAN_ROS
#define POINTCLOUD_TO_LASERSCAN_ROS
#ifndef POINTCLOUD_TO_LASERSCAN_POINTCLOUD_TO_LASERSCAN_NODELET
#define POINTCLOUD_TO_LASERSCAN_POINTCLOUD_TO_LASERSCAN_NODELET
#include <ros/ros.h>
#include <boost/thread/mutex.hpp>
@@ -50,49 +50,45 @@
#include <pcl/ros/conversions.h>
#include <tf/transform_listener.h>
#include <nodelet/nodelet.h>
namespace pointcloud_to_laserscan
{
typedef pcl::PointXYZ Point;
typedef pcl::PointCloud<Point> PointCloud;
{
typedef pcl::PointXYZ Point;
typedef pcl::PointCloud<Point> PointCloud;
/**
* Class to process incoming pointclouds into laserscans. Some initial code was pulled from the defunct turtlebot
* pointcloud_to_laserscan implementation.
*/
class PointCloudToLaserScanBase
{
public:
class PointCloudToLaserScanNodelet : public nodelet::Nodelet
{
PointCloudToLaserScanBase(ros::NodeHandle& nh, ros::NodeHandle& private_nh);
~PointCloudToLaserScanBase();
public:
PointCloudToLaserScanNodelet() { };
private:
private:
virtual void onInit();
void cloudCb(const PointCloud::ConstPtr& cloud);
void cloudCb(const PointCloud::ConstPtr &cloud_msg);
void connectCb();
void disconnectCb();
ros::NodeHandle nh_;
ros::NodeHandle private_nh_;
ros::NodeHandle nh_, private_nh_;
ros::Publisher pub_;
ros::Subscriber sub_;
tf::TransformListener tf_;
boost::mutex connect_mutex_;
// ROS Parameters
unsigned int input_queue_size_;
std::string target_frame_;
double min_height_, max_height_, angle_min_, angle_max_, angle_increment_, scan_time_, range_min_, range_max_;
bool use_inf_;
};
};
} // pointcloud_to_laserscan
} // pointcloud_to_laserscan
#endif
#endif // POINTCLOUD_TO_LASERSCAN_POINTCLOUD_TO_LASERSCAN_NODELET