|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.|
Explore surrounding areas and make a mapDescription: Explore the environment from robot's vision and save a map.
Tutorial Level: BEGINNER
Next Tutorial: Navigate with a known map
Start Gazebo Process
Be sure, your ROS_MASTER_IP and ROS_HOSTNAME variables are empty if you are simulating.
To launch gazebo use the following command:
$ roslaunch mrp2_gazebo mrp2_gazebo.launch
Start Gmapping Process
Now you can open Simultaneous Localization and Mapping (SLAM) application, open another terminal window:
$ roslaunch mrp2_navigation gmapping_demo.launch
Now, gmapping process is started and robot started to create a map and self localizing. You can start by moving robot via joystick or via other options that we described in previous tutorial.
Visualise Gmapping Process via RViz
In order to visualise the gmapping process. Let's open up another terminal and run Rviz;
$ roslaunch mrp2_viz view_gmapping.launch
Here you can see the visualized output of gmapping process.
If your exploring is done, You can save the map, open up new terminal and type;
$ rosrun map_server map_saver -f <PATH TO SAVE ex:~/Desktop/>new_map
This command generates two files: new_map.pgm and new_map.yaml. You can use these files with amcl application. To find out how; proceed to the next tutorial.