Mapping the environment

To move the robot autonomously in the environment, the robot needs to know the environment. This could be done using a mapping technique such as gmapping or karto. Both of these techniques are available as ROS packages and both would need encoder information (say, odom, in our case), laser scan data, and transform information. Gmapping uses particle filters and is open source while Karto is Apache-licensed. However, you could still use the open source wrapper for testing and educational purposes in Karto. For our application, let's use gmapping to map the environment.

We shall install gmapping SLAM using the following command:

$ sudo apt-get install ros-melodic-slam-gmapping

Now that the mapping technique has been installed, let's look at how to localize the robot on the map we've acquired.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset