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

Unable to load map using amcl in Turtlebot Indigo

asked 2016-03-23 15:24:44 -0500

niraj007 gravatar image

updated 2016-03-25 08:13:42 -0500


I am trying to implement autonomous navigation using Kinect 1517 in Turtlebot 2. I use source installation of Indigo on Ubuntu 14.04 on Asus X200CA Notebook PC.

First I create a map using the tutorial link text.

Then I follow this tutorial for autonomous navigation link text. I export my map as in the tutorial as export TURTLEBOT_MAP_FILE=/tmp/my_map.yaml in Turtlebot. Then I launch roslaunch turtlebot_navigation amcl_demo.launch in turtlebot and roslaunch turtlebot_rviz_launchers view_navigation.launch --screen in workstation. However the rviz loads the Willow Garage map!!. When I do echo $TURTLEBOT_MAP_FILE, in Turtlebot it shows


Can anybody help me what is wrong with my settings?

Thanks in advance.

edit retag flag offensive close merge delete


Today I create another map in remote PC and manually copy yaml and pgm file to Turtlebot. Then I run amcl in Turtlebot;

roslaunch turtlebot_navigation amcl_demo.launch map_file:=/home/user/Desktop/my_map2.yaml

After some time map-server will die and warn about timeout waiting.

Please help

niraj007 gravatar image niraj007  ( 2016-03-25 10:00:39 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-03-25 08:44:22 -0500

tgibbons gravatar image

updated 2016-03-25 10:37:01 -0500

Make sure you are saving the map when you create it, that is step 4 of the tutorial you linked to above.

rosrun map_server map_saver -f /tmp/my_map

This should create two files associated with the map you create, my_map.yaml and my_map.pgm. If you list the files in /tmp you should see these two files.

The next thing to check is which pc you are running amcl_demo.launch on and which pc you saved the maps. If I remember the tutorials correctly, the maps are saved on the turtlebot's laptop, which amcl_demo.launch is run on the remote control laptop. We generally have to manually transfer the map files from one machine to the other for this to work. That is if you are running roslaunch turtlebot_navigation amcl_demo.launch on the remote control laptop and not ssh'ing into the turtlebot, then make sure the map files are on the remote control laptop, called the PC in the tutorials.

If you move the two map files to a new location, you will need to edit the .yaml file since it hardcodes the full path of the .pgm file. You can use gedit or any other text editor on the .yaml map file. The first line of this file should be the location of the .pgm file which you need to update.

edit flag offensive delete link more


Hi tgibbons, thanks for the response. I follow your step and I have another error in map server as described in my comment above. After launching amcl, I get message [map_server-15] has died.. Then i receive warning like Timed out waiting for transform from base_footprint to map..

niraj007 gravatar image niraj007  ( 2016-03-25 10:07:32 -0500 )edit

Ok, I think I forgot a step when moving maps. I think the map.yaml file hardcodes the location of the pgm file in it. Try editing the .yaml file with gedit or some other text editor. The first line should be the location of the .pgm file. You may have to change this line to match the new location

tgibbons gravatar image tgibbons  ( 2016-03-25 10:25:37 -0500 )edit

Ok, the problem was path to pgm file. When I enter the command as in the tutorial; rosrun map_server map_server Desktop/my_map2.yaml I got this [ INFO] [1458921543.276357109]: Loading map from image "Desktop/Desktop/my_map2.pgm" I remove the location in yaml file and it work! Thanks a lot

niraj007 gravatar image niraj007  ( 2016-03-27 13:44:33 -0500 )edit

answered 2016-03-27 13:51:59 -0500

niraj007 gravatar image

updated 2016-03-27 13:58:42 -0500

The problem is in specifying location of pgm file when running map_server. When I run the map_server with screen output rosrun map_server map_server Desktop/my_map2.yaml --screen I see the actual problem;

[ INFO] [1458921609.048061847]: Loading map from image "Desktop/Desktop/my_map2.pgm"

I tried to load the yaml file directly but without success. Then I remove the Desktop path in yaml file like image: /my_map2.pgm and load the map_server

$ rosrun map_server map_server Desktop/my_map2.yaml -screen


Thanks a lot Tgibbons

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-03-23 15:24:44 -0500

Seen: 1,160 times

Last updated: Mar 27 '16