Robotics StackExchange | Archived questions

Unable to load map using amcl in Turtlebot Indigo

Hi,

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

/tmp/my_map.yaml.

Can anybody help me what is wrong with my settings?

Thanks in advance.

Asked by niraj007 on 2016-03-23 15:24:44 UTC

Comments

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

Asked by niraj007 on 2016-03-25 10:00:39 UTC

Answers

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.

Asked by tgibbons on 2016-03-25 08:44:22 UTC

Comments

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..

Asked by niraj007 on 2016-03-25 10:07:32 UTC

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

Asked by tgibbons on 2016-03-25 10:25:37 UTC

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

Asked by niraj007 on 2016-03-27 13:44:33 UTC

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

[ WARN] [1458921684.077763159]: Using deprecated map server interface. Please switch to new interface.

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

[ INFO] [1458921684.104087727]: Read a 512 X 480 map @ 0.050 m/cell

Success!!!

Thanks a lot Tgibbons

Asked by niraj007 on 2016-03-27 13:51:59 UTC

Comments