[Documentation] [TitleIndex] [WordIndex

(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

How to build a Map Using Logged Data

Description: This tutorial shows you how to create a 2-D map from logged transform and laser scan data.

Tutorial Level: BEGINNER

Building a map

1. Make sure you have installed hector_slam correctly. The easiest option is to install using the package manager (example for ROS indigo):

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

2. Get a bagfile to work with. For this tutorial, we will use the RoboCup 2011 Rescue Arena bagfile we recorded with a handheld mapping system. Download it to the current directory using wget:

wget http://tu-darmstadt-ros-pkg.googlecode.com/files/Team_Hector_MappingBox_RoboCup_2011_Rescue_Arena.bag

You can also try the other bagfiles we provide here: http://code.google.com/p/tu-darmstadt-ros-pkg/downloads/list

3. Start the hector_slam system:

roslaunch hector_slam_launch tutorial.launch

This launch file starts the hector_mapping node as well as the hector_trajectory_server and hector_geotiff nodes needed for generating geotiff maps. Add the desired displayed types using the 'Add' button, e.g. the Map type and Point Cloud type, to visualize the desired datas.

4. Open another terminal. Type

rosbag play Team_Hector_MappingBox_RoboCup_2011_Rescue_Arena.bag  --clock

You should now see the mapping process in realtime in rviz.

Generating a GeoTiff map

1. To save a geotiff file at any time during the mapping process type:

rostopic pub syscommand std_msgs/String "savegeotiff"

2. By default, geotiff maps are saved to the 'hector_slam/hector_geotiff/maps' folder. You should find both a .tif file containing the image data and a .tfw file containing the georeference information there. The creation time is appended to the map base name for both files.


2019-12-07 12:39