(!) 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 map

Description: Explore the real environment from robot's vision and save a map.

Tutorial Level: BEGINNER

Next Tutorial: Navigate with a known map

Power up robot

If the robot is already running, you can pass to second section directly. Otherwise you can turn back to previous tutorial and access control of it.

Start Gmapping Process

Now you can open SLAM application. Open up a terminal on your Personal Computer and connect to robot via SSH first:

$ ssh mrp2@<IP_OF_ROBOT>

Default credentials are username: mrp2 password: temppwd.

Then enter the command below in order to run gmapping:

$ roslaunch mrp2_navigation gmapping_demo.launch

Now, gmapping process is started and robot started to create a map and locating itself. You can start moving robot via joystick or what you prefer to control as a described in previous tutorials.

Visualise Gmapping Process via RViz

To launch RViz you will need to use mrp2_viz package open up a new terminal SSH to robot and run this command;

$ roslaunch mrp2_viz view_gmapping.launch

On RViz you can see the part of our world's 2D map from robot's perception. View is similiar to simulation as we can see. You can control the robot via interactive markers, send a simple goal from RViz.


If your exploring will done, You can save the map , open up a new terminal connect to robot via ssh and save the map;

$ rosrun map_server map_saver -f /home/mrp2/my_new_map

Note that you are currently working on robot's computer so the files you save are on robot's filesystem.

This command generates two files: new_map.pgm and new_map.yaml.

One can use these files with amcl application later. You can follow the previous amcl tutorial, It is similiar with simulation.

Wiki: mrp2_navigation/Tutorials/Navigate with real robot/Explore surrounding areas and make a map (last edited 2017-03-08 09:44:19 by orhanoz)