Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from boost::bind to std::bind #3249

Merged
merged 1 commit into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cuda/apps/src/kinect_cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>

#include <functional>

using namespace message_filters;
using namespace pcl;
using namespace pcl_cuda;
Expand Down Expand Up @@ -111,13 +113,13 @@ main (int argc, char **argv)
ROS_INFO ("[disparity_to_cloud] Using RGB to color the points.");
sync_rgb.connectInput (sub_depth, sub_rgb, sub_info);
//sync_rgb.registerCallback (bind (&pcl_cuda::DisparityToCloud::callback, k, _1, _2, _3));
sync_rgb.registerCallback (boost::bind (&EventHelper::callback, &h, _1, _2, _3));
sync_rgb.registerCallback (std::bind (&EventHelper::callback, &h, _1, _2, _3));
}
else
{
sync.connectInput (sub_depth, sub_info);
//sync.registerCallback (bind (&pcl_cuda::DisparityToCloud::callback, k, _1, PCLImageConstPtr (), _2));
sync.registerCallback (boost::bind (&EventHelper::callback, &h, _1, PCLImageConstPtr (), _2));
sync.registerCallback (std::bind (&EventHelper::callback, &h, _1, PCLImageConstPtr (), _2));
}

// Do this indefinitely
Expand Down
2 changes: 1 addition & 1 deletion cuda/apps/src/kinect_debayering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SimpleKinectTool
cv::namedWindow("test", CV_WINDOW_AUTOSIZE);
pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id);

std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image)> f = std::bind (&SimpleKinectTool::cloud_cb_, this, _1);

boost::signals2::connection c = interface->registerCallback (f);

Expand Down
2 changes: 1 addition & 1 deletion cuda/apps/src/kinect_dediscretize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class SimpleKinectTool
{
pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id);

std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&SimpleKinectTool::cloud_cb_, this, _1, _2, _3);

boost::signals2::connection c = interface->registerCallback (f);

Expand Down
6 changes: 3 additions & 3 deletions cuda/apps/src/kinect_mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,18 @@ class MultiRansac
if (use_device)
{
std::cerr << "[RANSAC] Using GPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb<pcl_cuda::Device>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&MultiRansac::cloud_cb<pcl_cuda::Device>, this, _1, _2, _3);
c = interface->registerCallback (f);
}
else
{
std::cerr << "[RANSAC] Using CPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb<pcl_cuda::Host>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&MultiRansac::cloud_cb<pcl_cuda::Host>, this, _1, _2, _3);
c = interface->registerCallback (f);
}

if (use_viewer)
viewer.runOnVisualizationThread (boost::bind(&MultiRansac::viz_cb, this, _1), "viz_cb");
viewer.runOnVisualizationThread (std::bind(&MultiRansac::viz_cb, this, _1), "viz_cb");

interface->start ();

Expand Down
10 changes: 5 additions & 5 deletions cuda/apps/src/kinect_normals_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ class NormalEstimation
if (use_device)
{
std::cerr << "[NormalEstimation] Using GPU..." << std::endl;
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&NormalEstimation::file_cloud_cb<Device>, this, _1);
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&NormalEstimation::file_cloud_cb<Device>, this, _1);
filegrabber->registerCallback (f);
}
else
{
std::cerr << "[NormalEstimation] Using CPU..." << std::endl;
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&NormalEstimation::file_cloud_cb<Host>, this, _1);
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&NormalEstimation::file_cloud_cb<Host>, this, _1);
filegrabber->registerCallback (f);
}

Expand All @@ -219,17 +219,17 @@ class NormalEstimation
if (use_device)
{
std::cerr << "[NormalEstimation] Using GPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&NormalEstimation::cloud_cb<Device>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&NormalEstimation::cloud_cb<Device>, this, _1, _2, _3);
c = grabber->registerCallback (f);
}
else
{
std::cerr << "[NormalEstimation] Using CPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&NormalEstimation::cloud_cb<Host>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&NormalEstimation::cloud_cb<Host>, this, _1, _2, _3);
c = grabber->registerCallback (f);
}

viewer.runOnVisualizationThread (boost::bind(&NormalEstimation::viz_cb, this, _1), "viz_cb");
viewer.runOnVisualizationThread (std::bind(&NormalEstimation::viz_cb, this, _1), "viz_cb");

grabber->start ();

Expand Down
8 changes: 4 additions & 4 deletions cuda/apps/src/kinect_planes_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,18 @@ class MultiRansac
if (use_device)
{
std::cerr << "[RANSAC] Using GPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb<Device>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&MultiRansac::cloud_cb<Device>, this, _1, _2, _3);
c = interface->registerCallback (f);
}
else
{
std::cerr << "[RANSAC] Using CPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb<Host>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&MultiRansac::cloud_cb<Host>, this, _1, _2, _3);
c = interface->registerCallback (f);
}

if (use_viewer)
viewer.runOnVisualizationThread (boost::bind(&MultiRansac::viz_cb, this, _1), "viz_cb");
viewer.runOnVisualizationThread (std::bind(&MultiRansac::viz_cb, this, _1), "viz_cb");

interface->start ();

Expand All @@ -283,7 +283,7 @@ class MultiRansac
//else
// std::cerr << "did not find file" << std::endl;
//
//std::function<void(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&) > f = boost::bind (&MultiRansac::logo_cb, this, _1);
//std::function<void(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&) > f = std::bind (&MultiRansac::logo_cb, this, _1);
//boost::signals2::connection c1 = filegrabber->registerCallback (f);

//filegrabber->start ();
Expand Down
8 changes: 4 additions & 4 deletions cuda/apps/src/kinect_ransac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ class SimpleKinectTool
if (use_device)
{
std::cerr << "[RANSAC] Using GPU..." << std::endl;
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&SimpleKinectTool::file_cloud_cb<pcl_cuda::Device>, this, _1);
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&SimpleKinectTool::file_cloud_cb<pcl_cuda::Device>, this, _1);
filegrabber->registerCallback (f);
}
else
{
std::cerr << "[RANSAC] Using CPU..." << std::endl;
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&SimpleKinectTool::file_cloud_cb<pcl_cuda::Host>, this, _1);
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&SimpleKinectTool::file_cloud_cb<pcl_cuda::Host>, this, _1);
filegrabber->registerCallback (f);
}

Expand All @@ -197,13 +197,13 @@ class SimpleKinectTool
if (use_device)
{
std::cerr << "[RANSAC] Using GPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb<pcl_cuda::Device>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&SimpleKinectTool::cloud_cb<pcl_cuda::Device>, this, _1, _2, _3);
c = interface->registerCallback (f);
}
else
{
std::cerr << "[RANSAC] Using CPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb<pcl_cuda::Host>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&SimpleKinectTool::cloud_cb<pcl_cuda::Host>, this, _1, _2, _3);
c = interface->registerCallback (f);
}

Expand Down
10 changes: 5 additions & 5 deletions cuda/apps/src/kinect_segmentation_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@ class Segmentation
if (use_device)
{
std::cerr << "[Segmentation] Using GPU..." << std::endl;
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb<Device>, this, _1);
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&Segmentation::file_cloud_cb<Device>, this, _1);
filegrabber->registerCallback (f);
}
else
{
// std::cerr << "[Segmentation] Using CPU..." << std::endl;
// std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb<Host>, this, _1);
// std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&Segmentation::file_cloud_cb<Host>, this, _1);
// filegrabber->registerCallback (f);
}

Expand All @@ -393,17 +393,17 @@ class Segmentation
if (use_device)
{
std::cerr << "[Segmentation] Using GPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb<Device>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&Segmentation::cloud_cb<Device>, this, _1, _2, _3);
c = grabber->registerCallback (f);
}
else
{
// std::cerr << "[Segmentation] Using CPU..." << std::endl;
// std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb<Host>, this, _1, _2, _3);
// std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&Segmentation::cloud_cb<Host>, this, _1, _2, _3);
// c = grabber->registerCallback (f);
}

viewer.runOnVisualizationThread (boost::bind(&Segmentation::viz_cb, this, _1), "viz_cb");
viewer.runOnVisualizationThread (std::bind(&Segmentation::viz_cb, this, _1), "viz_cb");

grabber->start ();

Expand Down
10 changes: 5 additions & 5 deletions cuda/apps/src/kinect_segmentation_planes_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ class Segmentation
if (use_device)
{
std::cerr << "[Segmentation] Using GPU..." << std::endl;
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb<Device>, this, _1);
std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&Segmentation::file_cloud_cb<Device>, this, _1);
filegrabber->registerCallback (f);
}
else
{
// std::cerr << "[Segmentation] Using CPU..." << std::endl;
// std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb<Host>, this, _1);
// std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&Segmentation::file_cloud_cb<Host>, this, _1);
// filegrabber->registerCallback (f);
}

Expand All @@ -268,17 +268,17 @@ class Segmentation
if (use_device)
{
std::cerr << "[Segmentation] Using GPU..." << std::endl;
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb<Device>, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&Segmentation::cloud_cb<Device>, this, _1, _2, _3);
c = grabber->registerCallback (f);
}
else
{
// std::cerr << "[Segmentation] Using CPU..." << std::endl;
// std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb<Host>, this, _1, _2, _3);
// std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&Segmentation::cloud_cb<Host>, this, _1, _2, _3);
// c = grabber->registerCallback (f);
}

viewer.runOnVisualizationThread (boost::bind(&Segmentation::viz_cb, this, _1), "viz_cb");
viewer.runOnVisualizationThread (std::bind(&Segmentation::viz_cb, this, _1), "viz_cb");

grabber->start ();

Expand Down
2 changes: 1 addition & 1 deletion cuda/apps/src/kinect_tool_standalone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class SimpleKinectTool
{
pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id);

std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1, _2, _3);
std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)> f = std::bind (&SimpleKinectTool::cloud_cb_, this, _1, _2, _3);

boost::signals2::connection c = interface->registerCallback (f);

Expand Down
2 changes: 1 addition & 1 deletion cuda/apps/src/kinect_viewer_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class KinectViewerCuda
pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id);

std::function<void (const boost::shared_ptr<openni_wrapper::Image>& image, const boost::shared_ptr<openni_wrapper::DepthImage>& depth_image, float)>
f = boost::bind (&KinectViewerCuda::cloud_cb_, this, _1, _2, _3);
f = std::bind (&KinectViewerCuda::cloud_cb_, this, _1, _2, _3);

boost::signals2::connection c = interface->registerCallback (f);

Expand Down