Skip to content

Mapping an environment

Riccardo Polvara edited this page May 27, 2021 · 2 revisions

Mapping an environment

If you want to perform a mapping task in a simulation or in a real environment, you can use the gmapping package by passing the correct parameters. This can be achieved in the following order:

  1. First, we need to merge front and back laserscan in a single pointcloud so to get a 360degrees view over the environment.
roslaunch bacchus_move_base corner_lasers_merger.launch
  1. Secondly, we can run gmapping which will create a temporary transformation from a global map frame to our robot's base_link one.
rosrun gmapping slam_gmapping scan:=/thorvald_001/scan _odom_frame:=thorvald_001/odom _base_frame:=thorvald_001/base_link
  1. After the environment has been mapped, we can save the map on disk with. This will generate a .pgm file and a .yaml with configuration regarding the map.
rosrun map_server map_saver -f <name_map>