diff --git a/face_detector/CMakeLists.txt b/face_detector/CMakeLists.txt index 8d680f25..2f6c743f 100644 --- a/face_detector/CMakeLists.txt +++ b/face_detector/CMakeLists.txt @@ -22,7 +22,7 @@ find_package(catkin REQUIRED COMPONENTS tf ) -find_package(Boost REQUIRED COMPONENTS system thread) +find_package(Boost REQUIRED COMPONENTS thread) find_package(OpenCV) find_package(yaml-cpp REQUIRED) diff --git a/face_detector/src/face_detection.cpp b/face_detector/src/face_detection.cpp index 7cf7f3c0..e6ce519e 100644 --- a/face_detector/src/face_detection.cpp +++ b/face_detector/src/face_detection.cpp @@ -316,14 +316,15 @@ class FaceDetector approximate_depth_sync_.reset(new ApproximateDepthSync(ApproximateDepthPolicy(queue_size), image_sub_, depth_image_sub_, c1_info_sub_, c2_info_sub_)); approximate_depth_sync_->registerCallback(boost::bind(&FaceDetector::imageCBAllDepth, - this, _1, _2, _3, _4)); + this, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4)); } else { exact_depth_sync_.reset(new ExactDepthSync(ExactDepthPolicy(queue_size), image_sub_, depth_image_sub_, c1_info_sub_, c2_info_sub_)); exact_depth_sync_->registerCallback(boost::bind(&FaceDetector::imageCBAllDepth, - this, _1, _2, _3, _4)); + this, boost::placeholders::_1, boost::placeholders::_2, + boost::placeholders::_3, boost::placeholders::_4)); } } else @@ -345,14 +346,15 @@ class FaceDetector approximate_disp_sync_.reset(new ApproximateDispSync(ApproximateDispPolicy(queue_size), image_sub_, disp_image_sub_, c1_info_sub_, c2_info_sub_)); approximate_disp_sync_->registerCallback(boost::bind(&FaceDetector::imageCBAllDisp, - this, _1, _2, _3, _4)); + this, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4)); } else { exact_disp_sync_.reset(new ExactDispSync(ExactDispPolicy(queue_size), image_sub_, disp_image_sub_, c1_info_sub_, c2_info_sub_)); exact_disp_sync_->registerCallback(boost::bind(&FaceDetector::imageCBAllDisp, - this, _1, _2, _3, _4)); + this, boost::placeholders::_1, boost::placeholders::_2, + boost::placeholders::_3, boost::placeholders::_4)); } } @@ -716,7 +718,9 @@ class FaceDetector else { max_id_++; - pos.object_id = static_cast(&(std::ostringstream() << max_id_))->str(); + std::ostringstream oss; + oss << max_id_; + pos.object_id = oss.str(); ROS_INFO_STREAM_NAMED("face_detector", "Didn't find face to match, starting new ID " << pos.object_id); } result_.face_positions.push_back(pos); diff --git a/leg_detector/include/leg_detector/laser_processor.h b/leg_detector/include/leg_detector/laser_processor.h index 004da9df..8b6425df 100644 --- a/leg_detector/include/leg_detector/laser_processor.h +++ b/leg_detector/include/leg_detector/laser_processor.h @@ -73,7 +73,7 @@ struct CompareSample { CompareSample() {} - inline bool operator()(const Sample* a, const Sample* b) + inline bool operator()(const Sample* a, const Sample* b) const { return (a->index < b->index); } diff --git a/leg_detector/package.xml b/leg_detector/package.xml index 3d4d1a01..a1ac0a30 100644 --- a/leg_detector/package.xml +++ b/leg_detector/package.xml @@ -8,7 +8,7 @@ http://ros.org/wiki/leg_detector catkin - liborocos-bfl + bfl dynamic_reconfigure geometry_msgs image_geometry diff --git a/leg_detector/src/leg_detector.cpp b/leg_detector/src/leg_detector.cpp index f39a2e9c..afbf4f24 100644 --- a/leg_detector/src/leg_detector.cpp +++ b/leg_detector/src/leg_detector.cpp @@ -302,15 +302,13 @@ class LegDetector if (use_seeds_) { - people_notifier_.registerCallback(boost::bind(&LegDetector::peopleCallback, this, _1)); + people_notifier_.registerCallback([this](auto msg){ peopleCallback(msg); }); people_notifier_.setTolerance(ros::Duration(0.01)); } - laser_notifier_.registerCallback(boost::bind(&LegDetector::laserCallback, this, _1)); + laser_notifier_.registerCallback([this](auto scan){ laserCallback(scan); }); laser_notifier_.setTolerance(ros::Duration(0.01)); - dynamic_reconfigure::Server::CallbackType f; - f = boost::bind(&LegDetector::configure, this, _1, _2); - server_.setCallback(f); + server_.setCallback([this](auto& config, uint32_t level){ configure(config, level); }); feature_id_ = 0; } @@ -731,9 +729,12 @@ class LegDetector memcpy(tmp_mat.data, f.data(), f.size()*sizeof(float)); - float probability = 0.5 - - forest->predict(tmp_mat, cv::noArray(), cv::ml::RTrees::PREDICT_SUM) / - forest->getRoots().size(); + cv::Mat votes; + + forest->getVotes(tmp_mat, votes, 0); + // first row of columns cotains class labels. Here -1 and 1. + // second row then contains the number of trees voting for this class. + float probability = static_cast(votes.at(1, 1)) / static_cast(forest->getRoots().size()); tf::Stamped loc((*i)->center(), scan->header.stamp, scan->header.frame_id); try diff --git a/people_tracking_filter/package.xml b/people_tracking_filter/package.xml index e0a44672..dcede627 100644 --- a/people_tracking_filter/package.xml +++ b/people_tracking_filter/package.xml @@ -11,8 +11,8 @@ catkin + bfl geometry_msgs - liborocos-bfl-dev message_filters people_msgs roscpp diff --git a/people_velocity_tracker/scripts/tracker.py b/people_velocity_tracker/scripts/tracker.py index a76e5ebe..809022d8 100755 --- a/people_velocity_tracker/scripts/tracker.py +++ b/people_velocity_tracker/scripts/tracker.py @@ -123,9 +123,9 @@ def spin(self): while not rospy.is_shutdown(): # Remove People Older Than timeout param now = rospy.Time.now() - for p in self.people.values(): + for p in list(self.people.values()): if now - p.age() > self.TIMEOUT: - del self.people[p.id()] + del self.people[p.get_id()] self.publish() rate.sleep() @@ -134,7 +134,7 @@ def publish(self): pl = People() pl.header.frame_id = None - for p in self.people.values(): + for p in list(self.people.values()): p.publish_markers(self.mpub) frame, person = p.get_person() pl.header.frame_id = frame