After moving the robot around the world, let's do some mapping of the world. There are launch files present to start a new world in Gazebo and start mapping. Here is the command to start a new world in Gazebo:
$ roslaunch catvehicle catvehicle_canyonview.launch
This will launch the Gazebo simulation in a new world. You can enter the following command to view Gazebo:
$ gzclient
The Gazebo simulator with a new world is shown here:
You can start the teleoperation node to move the robot, and the following command will start hector SLAM:
$ roslaunch catvehicle hectorslam.launch
To visualize the generated map, you can start RViz and open the configuration file called catvehicle.rviz.
You will get the following kind of visualization in RViz:
After completing the mapping process, we can save the map using the following command:
$ rosrun map_server map_saver -f map_name
The preceding command will save the current map as two files called map_name.pgm and map_name.yaml.
In the next section, we will interface a DBW car with ROS.