0
$\begingroup$

Rosanswers logo

I appreciate it very much if someone help me to understand what happen here.

I am using Kinect sensor with Turtlebot2 for creating map using gmapping. I create a bag file with rosbag record scan tf. Also I have created a map at the end of mapping attached in the picture. The picture of map and the bag files are here.

Later I play the bag file and try to create a map but this map is completely different from the original one where walls positions are skewed and in different directions.

I don't know what cause this, I am thinking to change the gmapping parameter, but I don't even know much about their effect.

Thanks a lot


Originally posted by niraj007 on ROS Answers with karma: 11 on 2016-04-04

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Gmapping takes in a large number of scans, but ignores most of them in order to minimize computation time.

If you ran the bag file and ran gmapping, it is unlikely that you will get the exact same map because the scans that gmapping will process are likely to be different.

Another thing to consider. Does your bag file contain map messages? These wouldn't interfere with the gmapping algorithm, but the result on rviz would look strange because you're getting maps from two different sources.

If you recorded a bag without gmapping running, then played back the bag with gmapping running, you will probably get the same result each time you run gmapping because you are running it in a more controlled environment.


Originally posted by Sebastian with karma: 363 on 2016-04-04

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by niraj007 on 2016-04-05:
Hi Sebastian, Thanks for the great idea. I will record without gmapping running and post the result. I am not sure about the map messages inside the bag. I would appreciate again if I can know the way to check.

Comment by mgruhler on 2016-04-05:
Check which topics are in a bagfile: rosbag info <BAGFILE>.

Only publish some topics: rosbag play <BAGFILE> --topics <TOPICS>

See also http://wiki.ros.org/rosbag/Commandline

Comment by niraj007 on 2016-04-07:
Sebastien suggestion it works well. First I run rosrun gmapping and rosbag record scan tf, then I move the Turtlebot2 around, stop the rosbag record. Later I play rosbag with gmapping running, I could generate a same map as before. Thanks a lot to everyone.

$\endgroup$

Your Answer

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