ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Saving geotiff map in Hector_slam

asked 2015-05-22 04:26:08 -0600

Raman gravatar image

updated 2015-05-22 05:13:25 -0600


I am new to ROS. I have been trying to save my lidar data as a geotiff map using Hector _Slam . The tutorial says to run :

rostopic pub syscommand std_msgs/String "savegeotiff"

Running this command does not show any error. The tutorial says that it will then automatically save the map to the 'hector_slam/hector_geotiff/maps' folder . However I find no hector_geotiff folder within the Hector_SLAM folder. I was wondering if I need to create some listener node for this purpose. Please guide as I am a beginner in ROS.

edit retag flag offensive close merge delete


Please check logs of hector_geotiff node. Also, could you please share your output for rostopic list.

ajain gravatar image ajain  ( 2015-05-28 10:38:21 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-09-14 18:26:58 -0600

samer.hanoun gravatar image

You will need to run this command to save the map either while the mapping process is ongoing (then you will get a partial map) or once you are satisfied by the produced map as shown by RVIZ (then you will get a full map).

Note that hector_slam should be active for hector_map_server to be able to export the generated map.

Please refer to this tutorial: for detailed steps.

hector_slam package has hector_geotiff with a folder called "maps".

Download hector_slam full version from: . catkin_make it and run:

roslaunch hector_slam_launch tutorial.launch


rosbag play Team_Hector_MappingBox_RoboCup_2011_Rescue_Arena.bag  --clock

as described in the mentioned tutorial, then save the map using:

rostopic pub syscommand std_msgs/String "savegeotiff"
edit flag offensive delete link more

answered 2018-07-18 14:04:57 -0600

rebecatourinho gravatar image

I've installed hector_slam via apt-get, so the package is on /opt/ros/DISTRO/share path (mine was indigo). In this case, I've had to recursively change hector_geotiff's folder owner because savegeotiff command had no permission to generate *.tif and *.tfw files. Another issue was referred maps folder missing on my installation, so I've had to manually create it.

So if you:

sudo apt-get install ros-DISTRO-hector-slam


sudo chown -R USER:GROUP /opt/ros/DISTRO/share/hector_geotiff

If maps folder is missing:

mkdir /opt/ros/DISTRO/share/hector_geotiff/maps

Run again (while hector_slam launch and bag are running too):

rostopic pub syscommand std_msgs/String "savegeotiff"
edit flag offensive delete link more


Hi I am unable to execute the second command. Error is invalid user: "USER:GROUP". How can I solve this?

rui gravatar image rui  ( 2018-11-07 01:04:09 -0600 )edit

You need to replace USER by your username and GROUP by a group you belong to. Generally, are the same, like username:username.

rebecatourinho gravatar image rebecatourinho  ( 2018-11-12 12:37:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-05-22 04:26:08 -0600

Seen: 5,104 times

Last updated: Sep 14 '15