Note: This tutorial assumes that you have completed the previous tutorials: xbot bringup.
(!) Please ask about problems and questions regarding this tutorial on Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

SLAM Map Building with xbot

Description: How to generate a map using gmapping && hector

Keywords: navigation

Tutorial Level: BEGINNER

Next Tutorial: Autonomous Navigation of a Known Map with xbot

Package Summary

this package will introduce how building a map by hector/gmapping with xbot.


  • Before navigation, we need make a map first, which let robot know current environment.
  • Here we fuse Asus_xtion_pro depth data and rpldar distance data together to make a map. The advantage of using fusion data to build map is robot could efficiently record the outline of hanging objects and sloping things with wide angle into map.
  • Then, you could fell free to chose a mapping method to made a map


  • Firstly, you should install hector OR gmapping package for sure.

Howe to install gmaping package

  • 1.make sure you have not install gmapping yet:

    rospack find gmapping
  • 2.install gmapping package

    sudo apt-get install ros-indigo-gmapping

Howe to install hector package

  • 1.make sure you have not install hector yet:

    rospack find hector_mapping
  • 2.install hector package

    sudo apt-get install ros-indigo-hector-mapping
  • Then, you should make sure you have download nav_staff in your workspace

Howe to install nav_staff package

    sudo apt-get install ros-indigo-xbot_nav_staff.git

or use git

    git clone

How to Run

1. launch machine

    roslaunch  xbot_bringup xbot_rplidar_asus.launch


  • a.hector
  •     roslaunch  machine hector.launch
  • b.gmapping
  •     roslaunch  machine gmapping.launch

3.launch rviz

    roslaunch machine 3D_RVIZ.launch

4. launch keyboard control

    rosrun nav_staff

Then you can control your robot mapping

What Next?

Wiki: xbot/tutorials/indigo/SLAM Map Building with xbot (last edited 2017-04-10 08:14:48 by DinnerHowe)