The first knowledge of the ROS series gmapping and the first knowledge of ros gmapping

Source: Internet
Author: User

The first knowledge of the ROS series gmapping and the first knowledge of ros gmapping
Introduction

The gmaping package provided by ROS is used to generate maps. It is an implementation of the famous open source OpenSlam package under the ROS framework. This package provides Slam for the laser device, and builds a grid-based 2D map based on the input and posture data of the laser device. It needs to listen to many topics from the ROS system and output a Topic -- map (nav_msgs/OccupancyGrid), which is also the input Topic of RViz.

Procedure: Download gmaping and sample data

sudo apt-get install ros-indigo-slam-gmapping
wget http://pr.willowgarage.com/data/gmapping/basic_localization_stage.bag

Start ROS master

This is the first step for all ROS operations, just like starting up.
roscore
After the terminal is started, it is suspended and another terminal is opened for other programs.

Set ROS system time

Configure ROS to enable the time in the replay data instead of the local time, which affects the output results of all the time APIs of the system. By default, ROS uses the ubuntu system time, that is, the wall clock time (wall clock ). However, when replaying a history file, the history time is recorded, so we need to tell ROS to enable the simulation time from now on.
rosparam set use_sim_time true

Start gmapping

Start gmapping and listen for messages sent from scan_base topic. This topic is released by the simulator.
rosrun gmapping slam_gmapping scan:=base_scan
After the terminal is started, it is suspended and another terminal is opened for other programs.

Start RViz

Start RViz, click add (lower left), select map in the pop-up list, and click OK. An empty map is displayed.
rosrun rviz rviz
The most critical step is to tell RViz what is the topic that generates the map information. As we have mentioned earlier, the topic output by gmapping is/map, so it is configured as/map.
After the terminal is started, it is suspended and another terminal is opened for other programs.

Start the simulator to replay data

rosbag play --clock basic_localization_stage.bag
Now you can see the dynamic creation of the map in RViz.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.