Skip to content

Commit 465b184

Browse files
committed
Bugfix: cannot recieve 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.
1 parent 1278d96 commit 465b184

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

slam_gmapping/src/slam_gmapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void SlamGmapping::startLiveSlam() {
149149
sst_ = this->create_publisher<nav_msgs::msg::OccupancyGrid>("map");
150150
sstm_ = this->create_publisher<nav_msgs::msg::MapMetaData>("map_metadata");
151151
scan_filter_sub_ = std::make_shared<message_filters::Subscriber<sensor_msgs::msg::LaserScan>>
152-
(node_, "scan");
152+
(node_, "scan", rmw_qos_profile_sensor_data);
153153
scan_filter_ = std::make_shared<tf2_ros::MessageFilter<sensor_msgs::msg::LaserScan>>
154154
(*scan_filter_sub_, *buffer_, odom_frame_, 10, node_);
155155
scan_filter_->registerCallback(std::bind(&SlamGmapping::laserCallback, this, std::placeholders::_1));

0 commit comments

Comments
 (0)