0
$\begingroup$

Rosanswers logo

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

Originally posted by BPeasley on ROS Answers with karma: 11 on 2011-08-03

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

no activity ~1 month, closing


Originally posted by kwc with karma: 12244 on 2011-09-02

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$
0
$\begingroup$

Rosanswers logo

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

Originally posted by dornhege with karma: 31395 on 2011-08-03

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by dornhege on 2011-08-03:
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).

Comment by BPeasley on 2011-08-03:
Here is my logfile http://www.mediafire.com/?4od6j3n8hes3sat

Comment by BPeasley on 2011-08-03:
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.

Comment by dornhege on 2011-08-03:
Yes. Section 2.2. You can also test the logfile there. That should work fine out of the box.

Comment by BPeasley on 2011-08-03:
Not sure how you make a log file. Is it the same thing discussed here http://www.ros.org/wiki/slam_gmapping/Tutorials/MappingFromLoggedData ?

Comment by dornhege on 2011-08-03:
Then it should work... Unless someone else has an idea, can you upload a log file for testing?

Comment by BPeasley on 2011-08-03:
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.

$\endgroup$

Your Answer

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