Rosanswers logo


I am having problems getting gmapping to work.

I am running kinetic on Ubuntu 16.04, with a Turtlebot robot

The problem is gmapping runs but only updates the map once with the first laser scan. All subsequent scans are registered, and localisation seems to occur (odom is updated when robot moves, and robot is localised against initial map, but the map does not change (no new maps are broadcast). The output of slam_gmapping shows "Regsitering scans: Done" & "Laser Pose =...". Sometimes I see: "Partilces Deleted", but no other output

I believe I have set up the frames correctly, rtq_tf_tree shows map->odom->base_footprint->base_link->laser and I can see laser and updated odom in rviz.

I checked rtq_console for gmapping debugging and it says "cannot process scan" from laserCallback:630

EDIT> problem seems to occur in slam_gmapping.cpp int function addScan()

which calls gsp_->processScan(reading)

where reading is:

GMapping::RangeReading reading(scan.ranges.size(), ranges_double, gsp_laser_, scan.header.stamp.toSec());

The gsp_ object is of type GMapping::GridSlamProcessor, which I can't find the code for at the moment.

I guess the problem might be in the scan.header timestamp? Anything specific I should check?

  • EDIT

I will look at that code (I presume 630 is the line number)

I generate the scans from point_cloud_to_laser_scan (using Occam Stereo ros node to generate pointcloud2 had to hack code to change from pointcloud type & publish as pointcloud2) so I guess I might be doing something wrong there, but the scans are visible and gmapping says they are being registered OK.


I convert using sensor_msgs::convertPointCloudToPointCloud2() then publish The Occam node code only seems to be initising the point cloud header frame_id before I convert to pointcloud so the lack of a time stamp here might be the problem.

Does publishing initialise timestamps or shoul I set manually before publishing? -EDIT

Anything likely candidates as to why scan produced by point_cloud_to_scan can be registered for localisation but not processed for map update?

I have tried setting "linearUpdate", "angularUpdate", "temporalUpdate" & "map_update_interval" to appropriate values.

I would appreciate any suggestions.

Originally posted by simon on ROS Answers with karma: 16 on 2017-11-13

Post score: 0

Original comments

Comment by gvdhoorn on 2017-11-13:\

Does publishing initialise timestamps or shoul I set manually before publishing?

not an answer, but no, calling publish(..) does not update timestamps, you have to set those fields yourself.


1 Answer 1


Rosanswers logo

Fixed - setting the header time stamp in the occam stereo node fixed the problem. Sorry to waste anyone time reading this, but writing this out helped me to think about the problem. Hope it can help someone else.

Originally posted by simon with karma: 16 on 2017-11-13

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.