0
$\begingroup$

Rosanswers logo

So I was using this tutorial to map out the floor in at my school. The map is beautiful.

http://www.ros.org/wiki/slam_gmapping/Tutorials/MappingFromLoggedData

However, once I am done with the bag file I want to use the map for the real robot. I have the robot end, where I plan on starting the robot in the future. Then I start the Segwary RMP driver and with the laser scan. First problem occurs gmapping (Note: It HAS NOT been restarted) will begin mapping in a completely different place.

So I hacked the driver and offset the coordinates by the ending coordinates in /map tf frame. Gmapping appears to get it correct at this point. But when I try to move 1 meter forward it will turn toward the wall and essentially run into it. However, I get the coordinates from goal generated by rviz. The other weird part is I have to subtract the map coordinates from the goal. (It has to be in terms of base link.) Not a huge issue but a weird one.

I am using the move_base find path service.

I have spent a better part of a month trying to get this to work. At first I tried to play with the ros time and sim time, but that didn't seem to help.

I have also tried amcl but the localizer crashes when it gets even a meter off. gmapping's localizer for whatever reason works really well.

So question 1: Can I use a rosbag to create a map in gmapping AND use a real robot on it. (It worked great on the simulator)

Question 2:) How do I get the robot driver to "start" at the same location the mapper left off. Considering it was the same location that the mapper started and is the same location that the robot is currently in.

If I can't do either of these two things then I am in trouble, thanks for the help in advance.

Cheers.


Originally posted by BlackManta on ROS Answers with karma: 56 on 2011-09-18

Post score: 0


Original comments

Comment by RB on 2013-10-28:
I have similar kind of problem in creating a 2D global map. I have not been able to generate the bag file. But my slam_gmapping node appears in rxgraph output. How you come to know that gmapping started or not? My question is here http://answers.ros.org/question/94671/error-in-creating-2d-global-map-of-the-environment/

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

Here is a tutorial that might help you. The main thing that you're trying to do is to save the map generated by gmapping. The command to do that is:

rosrun map_server map_saver

Which will save the map to the current directory. You can then load this map as a static map into move_base, and that should help to resolve your problem.


Originally posted by DimitriProsser with karma: 11163 on 2011-09-19

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

The most common way to do this is to build the map with gmapping and then save the map. Then use amcl to localize the robot in the prebuilt map.


Originally posted by tfoote with karma: 58457 on 2011-09-18

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

AMCL needs to know where to initialize your particle cloud; that's what the "Initial Pose" button in rviz does for you.


Originally posted by Mac with karma: 4119 on 2011-09-28

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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