diff --git a/gpu/kinfu/tools/kinfu_app.cpp b/gpu/kinfu/tools/kinfu_app.cpp index fdc26d4fbdc..a28a2034460 100644 --- a/gpu/kinfu/tools/kinfu_app.cpp +++ b/gpu/kinfu/tools/kinfu_app.cpp @@ -961,18 +961,27 @@ struct KinFuApp using namespace openni_wrapper; using DepthImagePtr = boost::shared_ptr; using ImagePtr = boost::shared_ptr; - - std::function func1_dev = boost::bind (&KinFuApp::source_cb2_device, this, _1, _2, _3); - std::function func2_dev = boost::bind (&KinFuApp::source_cb1_device, this, _1); - std::function func1_oni = boost::bind (&KinFuApp::source_cb2_oni, this, _1, _2, _3); - std::function func2_oni = boost::bind (&KinFuApp::source_cb1_oni, this, _1); - + std::function func1_dev = [this] (const ImagePtr& img, const DepthImagePtr& depth, float constant) + { + source_cb2_device (img, depth, constant); + }; + std::function func2_dev = [this] (const DepthImagePtr& depth) { source_cb1_device (depth); }; + + std::function func1_oni = [this] (const ImagePtr& img, const DepthImagePtr& depth, float constant) + { + source_cb2_oni (img, depth, constant); + }; + std::function func2_oni = [this] (const DepthImagePtr& depth) { source_cb1_oni (depth); }; + bool is_oni = dynamic_cast(&capture_) != nullptr; std::function func1 = is_oni ? func1_oni : func1_dev; std::function func2 = is_oni ? func2_oni : func2_dev; - std::function::ConstPtr&) > func3 = boost::bind (&KinFuApp::source_cb3, this, _1); + std::function::ConstPtr&) > func3 = [this] (const pcl::PointCloud::ConstPtr& cloud) + { + source_cb3 (cloud); + }; bool need_colors = integrate_colors_ || registration_; if ( pcd_source_ && !capture_.providesCallback::ConstPtr&)>() ) diff --git a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp index 3f1df6f9595..6e28f6feb68 100644 --- a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp +++ b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp @@ -983,9 +983,15 @@ struct KinFuLSApp using DepthImagePtr = boost::shared_ptr; using ImagePtr = boost::shared_ptr; - std::function func1 = boost::bind (&KinFuLSApp::source_cb2, this, _1, _2, _3); - std::function func2 = boost::bind (&KinFuLSApp::source_cb1, this, _1); - std::function::ConstPtr&) > func3 = boost::bind (&KinFuLSApp::source_cb3, this, _1); + std::function func1 = [this] (const ImagePtr& img, const DepthImagePtr& depth, float constant) + { + source_cb2 (img, depth, constant); + }; + std::function func2 = [this] (const DepthImagePtr& depth) { source_cb1 (depth); }; + std::function::ConstPtr&) > func3 = [this] (const pcl::PointCloud::ConstPtr& cloud) + { + source_cb3 (cloud); + }; bool need_colors = integrate_colors_ || registration_ || enable_texture_extraction_; diff --git a/gpu/kinfu_large_scale/tools/record_maps_rgb.cpp b/gpu/kinfu_large_scale/tools/record_maps_rgb.cpp index de6c34ac152..5873e1fbb03 100644 --- a/gpu/kinfu_large_scale/tools/record_maps_rgb.cpp +++ b/gpu/kinfu_large_scale/tools/record_maps_rgb.cpp @@ -258,9 +258,15 @@ void grabAndSend () { pcl::Grabber* interface = new pcl::OpenNIGrabber (); - //std::function::ConstPtr& )> f = boost::bind(&grabberCallBack, _1); - std::function&, const boost::shared_ptr&, float constant)> f = boost::bind (&grabberMapsCallBack, _1, _2, _3); + std::function f = [] (const openni_wrapper::Image::Ptr& img, + const openni_wrapper::DepthImage::Ptr& depth, + float constant) + { + grabberMapsCallBack (img, depth, constant); + }; interface->registerCallback (f); diff --git a/gpu/people/tools/people_app.cpp b/gpu/people/tools/people_app.cpp index de66be60f0b..54098fc0aa7 100644 --- a/gpu/people/tools/people_app.cpp +++ b/gpu/people/tools/people_app.cpp @@ -281,9 +281,12 @@ class PeoplePCDApp using DepthImagePtr = boost::shared_ptr; using ImagePtr = boost::shared_ptr; - - std::function >&)> func1 = boost::bind (&PeoplePCDApp::source_cb1, this, _1); - std::function func2 = boost::bind (&PeoplePCDApp::source_cb2, this, _1, _2, _3); + + std::function::ConstPtr&)> func1 = [this] (const PointCloud::ConstPtr& cloud) { source_cb1 (cloud); }; + std::function func2 = [this] (const ImagePtr& img, const DepthImagePtr& depth, float constant) + { + source_cb2 (img, depth, constant); + }; boost::signals2::connection c = cloud_cb_ ? capture_.registerCallback (func1) : capture_.registerCallback (func2); { diff --git a/gpu/people/tools/people_tracking.cpp b/gpu/people/tools/people_tracking.cpp index 7fbdf43177d..6a338d8f9dd 100644 --- a/gpu/people/tools/people_tracking.cpp +++ b/gpu/people/tools/people_tracking.cpp @@ -60,7 +60,7 @@ class PeopleTrackingApp pcl::Grabber* interface = new pcl::OpenNIGrabber(); std::function::ConstPtr&)> f = - boost::bind (&PeopleTrackingApp::cloud_cb_, this, _1); + [this] (const pcl::PointCloud::ConstPtr& cloud) { cloud_cb_ (cloud); }; interface->registerCallback (f); interface->start ();