forked from LCAS/ROB2002
-
Notifications
You must be signed in to change notification settings - Fork 6
Workshop 8 ‐ Mapping
gcielniak edited this page Nov 17, 2024
·
6 revisions
First, synchronise your fork with the main repository on GitHub (Sync fork
) as some structural changes were made and new files were added. Then clone or pull the repository to your local PC and re-open it in the dev container using VSC. Rebuild the updated packages colcon build --symlink-install
, and source the workspace source install/setup.bash
.
- 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 with the config file from the Limo's navigation toolbox
rviz2 -d /opt/ros/lcas/install/limo_navigation/share/limo_navigation/rviz/limo_navigation.rviz
. - 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. incmp9767_tutorial/maps/
). - You can now terminate the slam_toolbox and restart the simulator. 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
. If your map files are stored in the maps folder, remember to source your workspace first and then issueros2 launch limo_navigation limo_navigation.launch.py map:=src/cmp9767_tutorial/maps/my_map.yaml use_sim_time:=true
. Note the performance of the robot localisation component whilst navigating around.
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 the slam_toolbox parameters
- Read about the slam_toolbox key parameters.
- A copy of the parameter file for the slam toolbox (mapper_params_online_async.yaml) is stored in the 'cmp9767_tutorial/config' folder. 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:=src/cmp9767_tutorial/config/mapper_params_online_async.yaml
and note the changes to the resulting map. You can just experiment with other parameters and note the behaviour of the mapping toolbox.
- 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 the lower performance in such places?