Building the map using a Gazebo simulation involves employing the following workflow:
- Launch the robot model within a modeled environment.
- Launch the mapping ROS package.
- Launch a special visualization in RViz that lets us see the areas the robot is scanning as it moves.
- Teleoperate the robot to make it cover as much as possible of the surface of the virtual environment.
- Once the exploration is finished, save the map, generating the two files in the formats indicated in the preceding section, that is, .pgm and .yaml.
Having finished this information acquisition phase, we are ready for the robot to try and successfully complete a navigation task.