Skip to content

Workshop 11 ‐ Mapping

gcielniak edited this page Dec 5, 2023 · 12 revisions

Preparations

  • Pull the latest changes to the docker image or, if you work on your own installation of the software, from the repo. Then start up the simulation.
  • It is not critical for this workshop, but you might still want to work on your fork of the course's repository. Check out this practical example for guidance on how to work with GitHub repositories.

Task 1 - Mapping

  • Launch the simulator with the default environment: ros2 launch limo_gazebosim limo_gazebo_diff.launch.py.
  • Launch the slam toolbox: ros2 launch slam_toolbox online_async_launch.py use_sim_time:=true.
  • Run RViz (rviz2), load the default config from limo_gazebosim/rviz/urdf.rviz and add map visualisation (Add, By topic, /map/Map). Change the fixed frame from base_link to map.
  • Use the teloperation node to drive the robot around and cover the entire environment to complete the map: ros2 run teleop_twist_keyboard teleop_twist_keyboard.
  • Save the created map using map_saver: ros2 run nav2_map_server map_saver_cli -f my_map.
  • Inspect the created files including my_map.yaml and .pgm. It is a good practice to store these files in the maps folder of your development package (e.g. in uol_cmp9767_tutorial/maps/).
  • You can now terminate slam_toolbox. To use the newly created map, launch the navigation stack with an additional parameter specifying the map file: ros2 launch limo_navigation limo_navigation.launch.py map:=my_map.yaml use_sim_time:=true. It is a good practice to provide the full path to your map file (e.g. map:=/home/kasm-user/ros2_ws/src/CMP9767_LIMO/uol_cmp9767_tutorial/maps/my_map.yaml). Note the performance of the robot localisation component whilst navigating around.

Task 2 - Making Changes

Changes in the Environment

  • Modify the simulation environment by adding 2-4 new static obstacles, remap the environment again and save the resulting map. Note the changes in localisation/navigation quality when using the two maps built before and after the modifications.

Changing slam_toolbox parameters

  • Read about the slam_toolbox key parameters.
  • Establish input arguments for the online_async_launch node: ros2 launch slam_toolbox online_async_launch.py --show-args. Note the slam_params_file argument and the default location of the config file.
  • Make a local copy of the default config file: cp /opt/ros/humble/share/slam_toolbox/config/mapper_params_online_async.yaml .
  • Make changes to some key parameters in that file: e.g. increase the map resolution to 0.01.
  • Launch the toolbox with the modified config file: ros2 launch slam_toolbox online_async_launch.py slam_params_file:=mapper_params_online_async.yaml and note the changes to the resulting map. Experiment with other parameters and note the behaviour of the mapping toolbox.
  • If you would like to keep that file, store it in the config folder of your package.

Task 3 - The Real Stuff!

  • Run the slam_toolbox on the robot, map the lab and use the map with the navigation stack to direct the robot to selected points in the environment. Identify the difficult spots - what might be the reasons for lower performance in such places?