From cb74e07a46c9bbe9e3dce364c154491fcc8e7811 Mon Sep 17 00:00:00 2001 From: CalamityChen <1218138462@qq.com> Date: Mon, 7 May 2018 21:24:55 +0800 Subject: [PATCH 1/2] Fix missing clusters split while jumping back --- leg_detector/src/laser_processor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leg_detector/src/laser_processor.cpp b/leg_detector/src/laser_processor.cpp index 582676e8..637b47f6 100644 --- a/leg_detector/src/laser_processor.cpp +++ b/leg_detector/src/laser_processor.cpp @@ -255,7 +255,7 @@ ScanProcessor::splitConnected(float thresh) while ((s_rest != (*c_iter)->end() && (*s_rest)->index < (*s_q)->index + expand)) { - if ((*s_rest)->range - (*s_q)->range > thresh) + if (std::abs((*s_rest)->range - (*s_q)->range) > thresh) { break; } From aab9bd2b6fa8e4195f0a237f4cef6451d85dac15 Mon Sep 17 00:00:00 2001 From: CalamityChen <1218138462@qq.com> Date: Tue, 8 May 2018 09:41:47 +0800 Subject: [PATCH 2/2] Improve result of pairing up legs with no id. --- leg_detector/src/leg_detector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/leg_detector/src/leg_detector.cpp b/leg_detector/src/leg_detector.cpp index 8a3cc50a..f15506dc 100644 --- a/leg_detector/src/leg_detector.cpp +++ b/leg_detector/src/leg_detector.cpp @@ -647,16 +647,16 @@ class LegDetector || (*leg1)->getReliability() < leg_reliability_limit_) continue; - for (leg2 = begin; leg2 != end; ++leg2) + for (leg2 = leg1,leg2++; leg2 != end; ++leg2) { if (((*leg2)->object_id != "") - || ((*leg2)->getReliability() < leg_reliability_limit_) - || (leg1 == leg2)) continue; + || ((*leg2)->getReliability() < leg_reliability_limit_)) continue; double d = distance(leg1, leg2); if (d < closest_dist) { best1 = leg1; best2 = leg2; + closest_dist = d; } } }