ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

gmapping not updating map

asked 2011-08-03 03:41:35 -0600

BPeasley gravatar image

updated 2011-08-03 08:02:50 -0600

So I am attempting to use gmapping to build a map using SLAM. As far as I can tell I am passing it all the required transformations (odom->link and laser->link). Also my laser scan looks correct when I display it in rviz as well as my robot odometry. When I start up gmapping, rviz will display a map from the first scan. As I move my robot around the gmapping appears to be registering the new scans and it will update the position of my robot in the map which leads me to believe that gmapping is actually doing something useful. However, no matter how much I drive the robot around the map will never update. So all I get is whatever is seen in the first scan and none of the new scans are added to the map. Is there some step I am missing in order to update the map?

I have three programs running:

1.) Gets laser scan data and publishes it as a sensor_msgs/LaserScan message

2.) Handles teleop of a pioneer robot and publishes odometry tf as well as the laser->link tf

3.) gmapping using default values.

Thanks.

Edit: Output from gmapping

 -maxUrange 4.99 -maxUrange 4.99 -sigma     0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05
 -srr 0.1 -srt 0.2 -str 0.1 -stt 0.2
 -linearUpdate 1 -angularUpdate 0.5 -resampleThreshold 0.5
 -xmin -100 -xmax 100 -ymin -100 -ymax 100 -delta 0.05 -particles 30
[ INFO] [1312401554.739806016]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= 0 0 0
m_count 0
Registering First Scan
update frame 226
update ld=0.0118284 ad=0.54594
Laser Pose= 0 -0.001 -0.54594
m_count 1
Average Scan Matching Score=107.231
neff= 29.9803
Registering Scans:Done
update frame 285
update ld=0.0142426 ad=0.525215
Laser Pose= 0 -0.001 -0.292794
m_count 2
Average Scan Matching Score=248.354
neff= 29.9592
Registering Scans:Done
update frame 358
update ld=0.00641421 ad=0.507834
Laser Pose= 0 0 0.21504
m_count 3
Average Scan Matching Score=212.766
neff= 29.6688
Registering Scans:Done
update frame 432
update ld=0 ad=0.50579
Laser Pose= 0 0 0.354772
m_count 4
Average Scan Matching Score=167.437
neff= 28.1639
Registering Scans:Done
edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
0

answered 2011-09-02 11:46:04 -0600

kwc gravatar image

no activity ~1 month, closing

edit flag offensive delete link more
1

answered 2011-08-03 03:57:13 -0600

dornhege gravatar image

updated 2011-08-03 06:34:39 -0600

The base frame used by gmapping is called base_link, not link (There is a param to configure that).

Maybe you set the fixed_frame in rviz to odom and this is what you see driving? Although I don't know how you would see the map with the first scan.

Besides that: If gmapping gets valid data it should do something. Can you check the data rate of laser and tf for odom? Can you do the checks from section 2.2 in the Navigation Tuning Guide? They are designed to show that you are getting correct input, but will also discover that data is missing.

What does gmapping say it does. I get something like:

 -maxUrange 29.99 -maxUrange 29.99 -sigma     0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05
 -srr 0.1 -srt 0.2 -str 0.1 -stt 0.2
 -linearUpdate 1 -angularUpdate 0.5 -resampleThreshold 0.5
 -xmin -100 -xmax 100 -ymin -100 -ymax 100 -delta 0.05 -particles 30
[ INFO] [1312396236.181686189, 34.827621059]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= 0 0 0
m_count 0
Registering First Scan
update frame 43
update ld=0.8 ad=0.523599
Laser Pose= 0.8 1.65828e-14 0.523599
m_count 1
Average Scan Matching Score=855.45
neff= 29.7596
Registering Scans:Done
update frame 63
update ld=1.05 ad=0.418879
Laser Pose= 1.41717 0.849468 0.942478
m_count 2
Average Scan Matching Score=847.289
neff= 27.6526
Registering Scans:Done
update frame 70
update ld=1.04877 ad=0.20944
Laser Pose= 1.99375 1.72269 1.15192
m_count 3
edit flag offensive delete link more

Comments

I'm not sure exactly the frame rate of the Laser scan and odometry, but its publishing in real time. So I would guess around 20-30ish fps. I did the checks in 2.2 and everything worked out great.
BPeasley gravatar image BPeasley  ( 2011-08-03 05:48:59 -0600 )edit
Then it should work... Unless someone else has an idea, can you upload a log file for testing?
dornhege gravatar image dornhege  ( 2011-08-03 06:07:24 -0600 )edit
Not sure how you make a log file. Is it the same thing discussed here http://www.ros.org/wiki/slam_gmapping/Tutorials/MappingFromLoggedData ?
BPeasley gravatar image BPeasley  ( 2011-08-03 06:14:26 -0600 )edit
Yes. Section 2.2. You can also test the logfile there. That should work fine out of the box.
dornhege gravatar image dornhege  ( 2011-08-03 06:33:18 -0600 )edit
Yea, I can run there logfile. When I create a bag I run into the same problem that I am having when running it on live data.
BPeasley gravatar image BPeasley  ( 2011-08-03 08:08:24 -0600 )edit
BPeasley gravatar image BPeasley  ( 2011-08-03 08:11:31 -0600 )edit
If I play the log, the robot never moves (also in /odom). Is that correct, i.e. what you recorded? If yes, try to drive for a bit (at least the linear_update = 1 meter).
dornhege gravatar image dornhege  ( 2011-08-03 10:55:00 -0600 )edit
0

answered 2018-09-19 09:28:07 -0600

afrixs gravatar image

I had exactly the same problem when I published laser data without timestamp. Check the header of your published scan message, maybe the problem is there

edit flag offensive delete link more
0

answered 2011-08-03 04:46:33 -0600

BPeasley gravatar image

updated 2011-08-03 04:49:51 -0600

I do call it base_link, just shortened it to link when typing the message. Sorry about the confusion. In rviz the fixed_frame is set to /odom but I see /base_link, /base_laser, /odom, and /map. Here is an image to what I see in rviz

http://s19.photobucket.com/albums/b169/Peasley1/?action=view&current=Screenshot-RViz-4.png

This is what my tf tree looks like

 Tree
    /map
       /odom
          /base_link
             /base_laser
edit flag offensive delete link more

Comments

OK, that explains why the robot is driving - gmapping does nothing to it. Does the robot not move, when you choose /map as the fixed_frame? Also do you get more than 1 map updates (should be in the Status)?
dornhege gravatar image dornhege  ( 2011-08-03 05:27:14 -0600 )edit
BTW: You can update your original post, instead of answering.
dornhege gravatar image dornhege  ( 2011-08-03 05:27:34 -0600 )edit
The robot still drives around no matter which fixed_frame I choose. Also, not sure how to check how many map updates I am getting, how do I check the status? Thanks.
BPeasley gravatar image BPeasley  ( 2011-08-03 05:43:49 -0600 )edit
besides rostopic hz, I meant the Status in rviz. Click the + in front of the Status: OK.
dornhege gravatar image dornhege  ( 2011-08-03 06:04:52 -0600 )edit
It says Map OK/Map Received/Transform OK. It doesn't say anything about how many maps I am receiving
BPeasley gravatar image BPeasley  ( 2011-08-03 06:13:05 -0600 )edit
Sorry, the information isn't there like this. I thought of another plugin.
dornhege gravatar image dornhege  ( 2011-08-03 06:32:27 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2011-08-03 03:41:35 -0600

Seen: 4,587 times

Last updated: Sep 02 '11