Robotics StackExchange | Archived questions

Couldn't save map file

I'm running a fresh indigo install on Ubuntu 14.04. I'm going through the indigo turtlebot simulation mapping and navigation tutorial (found here). I get this error when trying to save my map:

$ rosrun map_server map_saver -f mymap
[ INFO] [1455210144.655511470]: Waiting for the map
[ INFO] [1455210144.863940939]: Received a 512 X 512 map @ 0.050 m/pix
[ INFO] [1455210144.863974294]: Writing map occupancy data to mymap.pgm
[ERROR] [1455210144.864011886]: Couldn't save map file to mymap.pgm

I've not been able to find any information on this so some guidance would be appreciated. Thank you.

EDIT1:
So, saving using the absolute path seems to have resolved the issue with saving...
But, I receive this error when trying to load that saved file.
I can cd in to that directory and see the .pgm and .yaml files, so they're there...

process[move_base-5]: started with pid [7198]
terminate called after throwing an instance of 'std::ios_base::failure'
what():  basic_filebuf::underflow error reading the file
[ WARN] [1455230430.987174577, 512.240000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 512.24 timeout was 0.1.
[map_server-1] process has died [pid 7174, exit code -6, cmd /opt/ros/indigo/lib/map_server/map_server /home/developer-admin/indigo_workspace/sandbox/maps/ __name:=map_server __log:=/home/developer-admin/.ros/log/3fab6fa6-d10f-11e5-82df-d850e6c4e2f6/map_server-1.log].
log file: /home/developer-admin/.ros/log/3fab6fa6-d10f-11e5-82df-d850e6c4e2f6/map_server-1*.log
[ WARN] [1455230436.087845155, 517.340000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 0.1 timeout was 0.1.  

EDIT2:
This is the command I use to try to open the saved map file... it uses the absolute path to where the map file is saved.

roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/home/developer-admin/indigo_workspace/sandbox/maps/

Asked by joe.s on 2016-02-11 14:28:32 UTC

Comments

This is a permission problem. Try to save in another place.

Asked by nampi on 2016-02-11 17:19:00 UTC

Ok. That seems to have done it. I should have read/write permissions across the board... but I guess not. Thanks. ... but now it won't open the map file.

Asked by joe.s on 2016-02-11 17:25:55 UTC

@joe.s Write the command which you use to open a map file.

Asked by nampi on 2016-02-11 17:54:33 UTC

@nampi
and added above

roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/home/developer-admin/indigo_workspace/sandbox/maps/

Asked by joe.s on 2016-02-12 11:26:30 UTC

The right command is: roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/home/developer-admin/indigo_workspace/sandbox/maps/mymap.yaml

Asked by nampi on 2016-02-12 13:48:55 UTC

@nampi
When doing that, I receive the error:
Map_server could not open /home/developer-admin/indigo_workspace/sandbox/maps/mymap.yaml.

Asked by joe.s on 2016-02-12 14:20:18 UTC

Use the full path in the first command too.

rosrun map_server map_saver -f /home/developer-admin/indigo_workspace/sandbox/maps/mymap
roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/home/developer-admin/indigo_workspace/sandbox/maps/mymap.yaml

Asked by nampi on 2016-02-12 14:45:30 UTC

@nampi
alright, it loaded this time... although I get a You must specify at least three points for the robot footpinrt, reverting to previous footprint error... I'll search for that and see what's going on.
Thanks for the help.

Asked by joe.s on 2016-02-12 15:09:35 UTC

Answers

Looking at the code it appears that this is due a fopen call failing. A likely cause for this are either inappropriate permissions (i.e. do you have write permissions for the folder from which you run map_saver?) or no disk space left.

Asked by Stefan Kohlbrecher on 2016-02-11 17:09:01 UTC

Comments

it must have been a permissions issue. but now I'm not able to load the map file.

Asked by joe.s on 2016-02-11 17:46:45 UTC