From fdf44ed28825a303e2359d0e390518a232e0a67d Mon Sep 17 00:00:00 2001 From: Windel Bouwman Date: Tue, 21 Sep 2021 19:19:19 +0200 Subject: [PATCH] Replace boost::bind by std::bind. --- src/CameraNode.cpp | 2 +- src/MapOptimizerNode.cpp | 2 +- src/costmap_2d/static_layer.cpp | 4 ++-- src/costmap_2d/voxel_layer.cpp | 4 ++-- src/nodelets/data_odom_sync.cpp | 2 +- src/nodelets/data_throttle.cpp | 4 ++-- src/nodelets/rgbdicp_odometry.cpp | 16 ++++++++-------- src/nodelets/stereo_odometry.cpp | 4 ++-- src/nodelets/stereo_throttle.cpp | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/CameraNode.cpp b/src/CameraNode.cpp index 10fff2f2..eeb0e3e2 100644 --- a/src/CameraNode.cpp +++ b/src/CameraNode.cpp @@ -278,7 +278,7 @@ int main(int argc, char** argv) dynamic_reconfigure::Server server; dynamic_reconfigure::Server::CallbackType f; - f = boost::bind(&callback, _1, _2); + f = std::bind(&callback, std::placeholders::_1, std::placeholders::_2); server.setCallback(f); ros::spin(); diff --git a/src/MapOptimizerNode.cpp b/src/MapOptimizerNode.cpp index 7d188ec5..caea66bf 100644 --- a/src/MapOptimizerNode.cpp +++ b/src/MapOptimizerNode.cpp @@ -103,7 +103,7 @@ public: ROS_INFO("map_optimizer: map_frame_id = %s", mapFrameId_.c_str()); ROS_INFO("map_optimizer: odom_frame_id = %s", odomFrameId_.c_str()); ROS_INFO("map_optimizer: tf_delay = %f", tfDelay); - transformThread_ = new boost::thread(boost::bind(&MapOptimizer::publishLoop, this, tfDelay)); + transformThread_ = new boost::thread(std::bind(&MapOptimizer::publishLoop, this, tfDelay)); } } diff --git a/src/costmap_2d/static_layer.cpp b/src/costmap_2d/static_layer.cpp index 90f92b6c..29ea66cc 100644 --- a/src/costmap_2d/static_layer.cpp +++ b/src/costmap_2d/static_layer.cpp @@ -109,8 +109,8 @@ void StaticLayer::onInitialize() } dsrv_ = new dynamic_reconfigure::Server(nh); - dynamic_reconfigure::Server::CallbackType cb = boost::bind( - &StaticLayer::reconfigureCB, this, _1, _2); + dynamic_reconfigure::Server::CallbackType cb = std::bind( + &StaticLayer::reconfigureCB, this, std::placeholders::_1, std::placeholders::_2); dsrv_->setCallback(cb); } diff --git a/src/costmap_2d/voxel_layer.cpp b/src/costmap_2d/voxel_layer.cpp index 78d3560a..77c39328 100644 --- a/src/costmap_2d/voxel_layer.cpp +++ b/src/costmap_2d/voxel_layer.cpp @@ -77,8 +77,8 @@ void VoxelLayer::onInitialize() void VoxelLayer::setupDynamicReconfigure(ros::NodeHandle& nh) { voxel_dsrv_ = new dynamic_reconfigure::Server(nh); - dynamic_reconfigure::Server::CallbackType cb = boost::bind( - &VoxelLayer::reconfigureCB, this, _1, _2); + dynamic_reconfigure::Server::CallbackType cb = std::bind( + &VoxelLayer::reconfigureCB, this, std::placeholders::_1, std::placeholders::_2); voxel_dsrv_->setCallback(cb); } diff --git a/src/nodelets/data_odom_sync.cpp b/src/nodelets/data_odom_sync.cpp index 6725af96..3988de83 100644 --- a/src/nodelets/data_odom_sync.cpp +++ b/src/nodelets/data_odom_sync.cpp @@ -75,7 +75,7 @@ private: private_nh.param("queue_size", queueSize, queueSize); sync_ = new message_filters::Synchronizer(MySyncPolicy(queueSize), image_sub_, image_depth_sub_, info_sub_, odom_sub_); - sync_->registerCallback(boost::bind(&DataOdomSyncNodelet::callback, this, _1, _2, _3, _4)); + sync_->registerCallback(std::bind(&DataOdomSyncNodelet::callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); image_sub_.subscribe(rgb_it, rgb_nh.resolveName("image_in"), 1, hintsRgb); image_depth_sub_.subscribe(depth_it, depth_nh.resolveName("image_in"), 1, hintsDepth); diff --git a/src/nodelets/data_throttle.cpp b/src/nodelets/data_throttle.cpp index a3061364..1df09a8b 100644 --- a/src/nodelets/data_throttle.cpp +++ b/src/nodelets/data_throttle.cpp @@ -105,12 +105,12 @@ private: if(approxSync) { approxSync_ = new message_filters::Synchronizer(MyApproxSyncPolicy(queueSize), image_sub_, image_depth_sub_, info_sub_); - approxSync_->registerCallback(boost::bind(&DataThrottleNodelet::callback, this, _1, _2, _3)); + approxSync_->registerCallback(std::bind(&DataThrottleNodelet::callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); } else { exactSync_ = new message_filters::Synchronizer(MyExactSyncPolicy(queueSize), image_sub_, image_depth_sub_, info_sub_); - exactSync_->registerCallback(boost::bind(&DataThrottleNodelet::callback, this, _1, _2, _3)); + exactSync_->registerCallback(std::bind(&DataThrottleNodelet::callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); } image_sub_.subscribe(rgb_it, rgb_nh.resolveName("image_in"), 1, hintsRgb); diff --git a/src/nodelets/rgbdicp_odometry.cpp b/src/nodelets/rgbdicp_odometry.cpp index 9b3e1673..d62ac95b 100644 --- a/src/nodelets/rgbdicp_odometry.cpp +++ b/src/nodelets/rgbdicp_odometry.cpp @@ -151,12 +151,12 @@ private: if(approxSync) { approxCloudSync_ = new message_filters::Synchronizer(MyApproxCloudSyncPolicy(queueSize_), image_mono_sub_, image_depth_sub_, info_sub_, cloud_sub_); - approxCloudSync_->registerCallback(boost::bind(&RGBDICPOdometry::callbackCloud, this, _1, _2, _3, _4)); + approxCloudSync_->registerCallback(std::bind(&RGBDICPOdometry::callbackCloud, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } else { exactCloudSync_ = new message_filters::Synchronizer(MyExactCloudSyncPolicy(queueSize_), image_mono_sub_, image_depth_sub_, info_sub_, cloud_sub_); - exactCloudSync_->registerCallback(boost::bind(&RGBDICPOdometry::callbackCloud, this, _1, _2, _3, _4)); + exactCloudSync_->registerCallback(std::bind(&RGBDICPOdometry::callbackCloud, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } subscribedTopicsMsg = uFormat("\n%s subscribed to (%s sync):\n %s,\n %s,\n %s, \n %s", @@ -173,12 +173,12 @@ private: if(approxSync) { approxScanSync_ = new message_filters::Synchronizer(MyApproxScanSyncPolicy(queueSize_), image_mono_sub_, image_depth_sub_, info_sub_, scan_sub_); - approxScanSync_->registerCallback(boost::bind(&RGBDICPOdometry::callbackScan, this, _1, _2, _3, _4)); + approxScanSync_->registerCallback(std::bind(&RGBDICPOdometry::callbackScan, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } else { exactScanSync_ = new message_filters::Synchronizer(MyExactScanSyncPolicy(queueSize_), image_mono_sub_, image_depth_sub_, info_sub_, scan_sub_); - exactScanSync_->registerCallback(boost::bind(&RGBDICPOdometry::callbackScan, this, _1, _2, _3, _4)); + exactScanSync_->registerCallback(std::bind(&RGBDICPOdometry::callbackScan, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } subscribedTopicsMsg = uFormat("\n%s subscribed to (%s sync):\n %s,\n %s,\n %s, \n %s", @@ -425,25 +425,25 @@ protected: { delete approxScanSync_; approxScanSync_ = new message_filters::Synchronizer(MyApproxScanSyncPolicy(queueSize_), image_mono_sub_, image_depth_sub_, info_sub_, scan_sub_); - approxScanSync_->registerCallback(boost::bind(&RGBDICPOdometry::callbackScan, this, _1, _2, _3, _4)); + approxScanSync_->registerCallback(std::bind(&RGBDICPOdometry::callbackScan, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } if(exactScanSync_) { delete exactScanSync_; exactScanSync_ = new message_filters::Synchronizer(MyExactScanSyncPolicy(queueSize_), image_mono_sub_, image_depth_sub_, info_sub_, scan_sub_); - exactScanSync_->registerCallback(boost::bind(&RGBDICPOdometry::callbackScan, this, _1, _2, _3, _4)); + exactScanSync_->registerCallback(std::bind(&RGBDICPOdometry::callbackScan, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } if(approxCloudSync_) { delete approxCloudSync_; approxCloudSync_ = new message_filters::Synchronizer(MyApproxCloudSyncPolicy(queueSize_), image_mono_sub_, image_depth_sub_, info_sub_, cloud_sub_); - approxCloudSync_->registerCallback(boost::bind(&RGBDICPOdometry::callbackCloud, this, _1, _2, _3, _4)); + approxCloudSync_->registerCallback(std::bind(&RGBDICPOdometry::callbackCloud, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } if(exactCloudSync_) { delete exactCloudSync_; exactCloudSync_ = new message_filters::Synchronizer(MyExactCloudSyncPolicy(queueSize_), image_mono_sub_, image_depth_sub_, info_sub_, cloud_sub_); - exactCloudSync_->registerCallback(boost::bind(&RGBDICPOdometry::callbackCloud, this, _1, _2, _3, _4)); + exactCloudSync_->registerCallback(std::bind(&RGBDICPOdometry::callbackCloud, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } } diff --git a/src/nodelets/stereo_odometry.cpp b/src/nodelets/stereo_odometry.cpp index 76f5a3e1..d6859940 100644 --- a/src/nodelets/stereo_odometry.cpp +++ b/src/nodelets/stereo_odometry.cpp @@ -309,13 +309,13 @@ void StereoOdometry::flushCallbacks() { delete approxSync_; approxSync_ = new message_filters::Synchronizer(MyApproxSyncPolicy(queueSize()), imageRectLeft_, imageRectRight_, cameraInfoLeft_, cameraInfoRight_); - approxSync_->registerCallback(boost::bind(&StereoOdometry::callback, this, _1, _2, _3, _4)); + approxSync_->registerCallback(std::bind(&StereoOdometry::callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } if(exactSync_) { delete exactSync_; exactSync_ = new message_filters::Synchronizer(MyExactSyncPolicy(queueSize()), imageRectLeft_, imageRectRight_, cameraInfoLeft_, cameraInfoRight_); - exactSync_->registerCallback(boost::bind(&StereoOdometry::callback, this, _1, _2, _3, _4)); + exactSync_->registerCallback(std::bind(&StereoOdometry::callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } } diff --git a/src/nodelets/stereo_throttle.cpp b/src/nodelets/stereo_throttle.cpp index 6665a2b1..8674d606 100644 --- a/src/nodelets/stereo_throttle.cpp +++ b/src/nodelets/stereo_throttle.cpp @@ -100,12 +100,12 @@ private: if(approxSync) { approxSync_ = new message_filters::Synchronizer(MyApproxSyncPolicy(queueSize), imageLeft_, imageRight_, cameraInfoLeft_, cameraInfoRight_); - approxSync_->registerCallback(boost::bind(&StereoThrottleNodelet::callback, this, _1, _2, _3, _4)); + approxSync_->registerCallback(std::bind(&StereoThrottleNodelet::callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } else { exactSync_ = new message_filters::Synchronizer(MyExactSyncPolicy(queueSize), imageLeft_, imageRight_, cameraInfoLeft_, cameraInfoRight_); - exactSync_->registerCallback(boost::bind(&StereoThrottleNodelet::callback, this, _1, _2, _3, _4)); + exactSync_->registerCallback(std::bind(&StereoThrottleNodelet::callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } imageLeft_.subscribe(left_it, left_nh.resolveName("image"), 1, hintsLeft);