0% found this document useful (0 votes)
98 views

W3 - T1 - Using The Hector SLAM

This tutorial discusses installing and running the hector SLAM package in ROS to generate a map from laser scan data. It describes editing the tutorial launch file to set simulated timestamps and launching rviz, the static transform publisher, and the rosbag playback. Adjusting parameters in the mapping launch file like frames, resolution, and map updating can impact map quality. The tutorial demonstrates running the processes to generate a map and saving it with the map server.

Uploaded by

zero ok
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views

W3 - T1 - Using The Hector SLAM

This tutorial discusses installing and running the hector SLAM package in ROS to generate a map from laser scan data. It describes editing the tutorial launch file to set simulated timestamps and launching rviz, the static transform publisher, and the rosbag playback. Adjusting parameters in the mapping launch file like frames, resolution, and map updating can impact map quality. The tutorial demonstrates running the processes to generate a map and saving it with the map server.

Uploaded by

zero ok
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Tutorial : Using the Hector SLAM

The F1/10 Team

Introduction
This tutorial will cover the installation of hector slam package and running a demo file to generate the map
from a rosbag containing laser scans. You might use the self created ros bags or request one from us.
Transcript to the Video Tutorial
In the video lecture, we discussed the concepts behind simultaneous localization and mapping. Lets see how
to implement th same in ROS. We will be using a package called hector slam. Use the command you see on
the screen to install the hector slam package. I am not running the command here as its already installed on
the system.

sudo apt−g e t i n s t a l l r o s −i n d i g o −h e c t o r −slam

Once the package is installed, we need to make some minor tweaks in the launch file. Go to the source
folder for the installed package.

roscd hector slam launch / launch /

Look up the launch file by name tutorial. You can ignore the other launch files you see on the screen as
they have been created for test purposes. Open the launch file in a text editor with super user permissions.

sudo g e d i t t u t o r i a l . l a u n c h

Lets go through the code here. The parameter sim time suggests the rosmaster to use simulated time stamps
when running the launch file. We will run the bagged laser data on simulated time stamps and hence we set
this parameter as true. However when using the raw laser data to build the map, you should set this parameter
as false.

These lines launch the rviz with some default configurations. The mapping default launch file loaded here is
the place where we set parameters for the hector algorithm. The hector slam package generates the transform
between map and base frame, however we need transforms between world and map frame; and the base frame
and laser frame. A static transform publisher package as shown here, serves this purpose.
Thats all for the editing. Lets generate the map.
First, run the roscore. We will play the rosbag with –clock argument as we will be using the simulated time
stamps. Run the tutorial launch file.

roscore
r o s b a g p l a y Lecture3SLAM Tutorial . bag −−c l o c k
roslaunch hector slam launch t u t o r i a l . launch

The map may or may not work as perfect as visible here. You might have to play around with certain
parameters we talked about during the lecture. You can go through the mapping default launch file to get an
indepth idea of various parameters.

1
roscd hector mapping / launch
sudo g e d i t m a p p i n g d e f a u l t . l a u n c h

As you can see here, we have parameters to set the various frames, set the resolution, number of grids to
be used by the optimization algorithm, and several map update parameters which can create a heavy impact
on the map quality. To read more on this, and a few more parameters follow the ROS wiki page for the hector
mapping package. Also don’t forget to save the map using the map server.

r o s r u n m a p s e r v e r map saver −f mymap

References
• Hector Mapping ROS Wiki : http://wiki.ros.org/hector_mapping
• Github link to Launch file.

You might also like