Fix regressions

This commit is contained in:
Paul Bovbel
2015-01-15 13:41:57 -05:00
committed by Paul Bovbel
parent eafe961c0c
commit de8a0aca3f
4 changed files with 23 additions and 21 deletions
@@ -50,7 +50,7 @@ namespace pointcloud_to_laserscan
void PointCloudToLaserScanNodelet::onInit()
{
nh_ = getMTPrivateNodeHandle();
nh_ = getMTNodeHandle();
private_nh_ = getMTPrivateNodeHandle();
private_nh_.param<std::string>("target_frame", target_frame_, "");
@@ -83,6 +83,24 @@ namespace pointcloud_to_laserscan
boost::bind(&PointCloudToLaserScanNodelet::disconnectCb, this));
}
void PointCloudToLaserScanNodelet::connectCb()
{
boost::mutex::scoped_lock lock(connect_mutex_);
if (!sub_ && pub_.getNumSubscribers() > 0) {
NODELET_DEBUG("Connecting to depth topic.");
sub_ = nh_.subscribe("cloud_in", input_queue_size_, &PointCloudToLaserScanNodelet::cloudCb, this);
}
}
void PointCloudToLaserScanNodelet::disconnectCb()
{
boost::mutex::scoped_lock lock(connect_mutex_);
if (pub_.getNumSubscribers() == 0) {
NODELET_DEBUG("Unsubscribing from depth topic.");
sub_.shutdown();
}
}
void PointCloudToLaserScanNodelet::cloudCb(const PointCloud::ConstPtr &cloud_msg)
{
//pointer to pointcloud data to transform to laserscan
@@ -164,23 +182,6 @@ namespace pointcloud_to_laserscan
pub_.publish(output);
}
void PointCloudToLaserScanNodelet::connectCb()
{
boost::mutex::scoped_lock lock(connect_mutex_);
if (!sub_ && pub_.getNumSubscribers() > 0) {
NODELET_DEBUG("Connecting to depth topic.");
sub_ = nh_.subscribe("cloud_in", input_queue_size_, &PointCloudToLaserScanNodelet::cloudCb, this);
}
}
void PointCloudToLaserScanNodelet::disconnectCb()
{
boost::mutex::scoped_lock lock(connect_mutex_);
if (pub_.getNumSubscribers() == 0) {
NODELET_DEBUG("Unsubscribing from depth topic.");
sub_.shutdown();
}
}
}
PLUGINLIB_DECLARE_CLASS(pointcloud_to_laserscan, PointCloudToLaserScanNodelet, pointcloud_to_laserscan::PointCloudToLaserScanNodelet, nodelet::Nodelet);