From b0be67553a598cf5f20a3c8adc4d5d1b6ece0986 Mon Sep 17 00:00:00 2001 From: Nikos Koukis Date: Thu, 16 May 2019 16:06:35 +0100 Subject: [PATCH 1/2] Fix bug with misleading indentation --- .../include/gmapping/particlefilter/particlefilter.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openslam_gmapping/include/gmapping/particlefilter/particlefilter.h b/openslam_gmapping/include/gmapping/particlefilter/particlefilter.h index 2a8b8a9..39db224 100644 --- a/openslam_gmapping/include/gmapping/particlefilter/particlefilter.h +++ b/openslam_gmapping/include/gmapping/particlefilter/particlefilter.h @@ -137,9 +137,12 @@ void rle(OutputIterator& out, const Iterator & begin, const Iterator & end){ count=1; } } + if (count>0) + { *out=std::make_pair(current,count); out++; + } } //BEGIN legacy From f97675f058956e0c47c2d76fa456a006b568fb36 Mon Sep 17 00:00:00 2001 From: Skyler Pan Date: Fri, 17 Jan 2020 02:19:14 +0800 Subject: [PATCH 2/2] Bugfix: cannot receive scan topic with best-effort qos. This implementation uses message filter to sub topic. But message filter default only passes topic with reliable qos. I modified the qos setting in message filter to pass both reliable and best-effort topic. --- slam_gmapping/src/slam_gmapping.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slam_gmapping/src/slam_gmapping.cpp b/slam_gmapping/src/slam_gmapping.cpp index 34a7027..eadc1f9 100644 --- a/slam_gmapping/src/slam_gmapping.cpp +++ b/slam_gmapping/src/slam_gmapping.cpp @@ -96,7 +96,7 @@ void SlamGmapping::startLiveSlam() { sst_ = this->create_publisher("map"); sstm_ = this->create_publisher("map_metadata"); scan_filter_sub_ = std::make_shared> - (node_, "scan"); + (node_, "scan", rmw_qos_profile_sensor_data); scan_filter_ = std::make_shared> (*scan_filter_sub_, *buffer_, odom_frame_, 10, node_); scan_filter_->registerCallback(std::bind(&SlamGmapping::laserCallback, this, std::placeholders::_1));