Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Workshop 9 Mapping

gcielniak edited this page Dec 5, 2022 · 9 revisions

Preparations

  • You should start working on your assignment this week but the workshop tasks below should help you in developing additional functionality for your individual projects.

  • Update the dependecies: sudo apt-get update and install today's packages:

    sudo apt-get install \
        ros-noetic-gmapping
    

The tutorial code is included in the uol_cmp9767m_tutorial folder. If you are unsure about a typical workflow when working with the course material, have a look at this tutorial.

Task 1 - Mapping

  • Run our simulation environment without localisation roslaunch bacchus_gazebo vineyard_demo.launch fake_localisation:=false.
  • Since, we want to use both lasers for mapping, let us run the laser scan merger node roslaunch bacchus_move_base corner_lasers_merger.launch tf_prefix:=thorvald_001/ which will broadcast a merged scan under topic thorvald_001/scan.
  • Now, run the gmapping node with the following parameters rosrun gmapping slam_gmapping scan:=/thorvald_001/scan _odom_frame:=thorvald_001/odom _base_frame:=thorvald_001/base_link map:=gmap _xmin:=-15 _xmax:=15 _ymin:=-15 _ymax:=15. Note, that the new map is published under a different topic (i.e. /gmap) so that we can still use the original map provided by map_server (/map) for navigation. In RVIZ, add visualisation for the new map.
  • Now, map the environment by driving the robot around. When you are satisfied with the results, save the map by issuing rosrun map_server map_saver map:=/gmap -f vineyard. It is a good practice to store the maps in the maps folder: create one in uol_cmp9767m_tutorial and move the resulting map files (*.yaml and *.pgm) there.
  • To use the newly created map, restart the simulation launch file with a custom map parameter nav_map_yaml specifying the location of your map: roslaunch bacchus_gazebo vineyard_demo.launch nav_map_yaml:=$(rospack find uol_cmp9767m_tutorial)/maps/vineyard.yaml

Task 2

  • Use the setup from the localisation workshop to launch AMCL node and compare the localisation and navigation results when using the original and newly created map.
  • Modify the simulation environment by adding new static obstacles and remap the environment again. Note the changes in localisation/navigation quality after the modifications. To achieve this step, you will need to save the simulation environment in Gazebo in addition to your newly created map. To do so, save the world in Gazebo (File/Save World As) to the tutorial folder e.g. uol_cmp9767m_tutorial/worlds/vineyard_new.world. Then, you need to manually edit the world file and remove the robot model which was exported together with other parts of the environment. In a text editor, find the line <model name='thorvald_001'> and remove all the lines until the </model> closing tag. To launch the newly created world file, run our simulation with the following option roslaunch bacchus_gazebo vineyard_demo.launch world:=$(rospack find uol_cmp9767m_tutorial)/worlds/vineyard_new.world.

Clone this wiki locally