SLAM [Melodic]

SLAM (Simultaneous Localization and Mapping)

Running SLAM

To perform simultaneous localization and mapping (SLAM), run the below line in the terminal shell.

$ roslaunch omo_r1mini_slam omo_r1mini_slam.launch

Running the above command, your terminal should output data like the image below.

To get see SLAM in action on rviz, run the below line in the terminal shell.

$ roslaunch omo_r1mini_slam omo_r1mini_slam_rviz.launch

Running the above command, an rviz GUI like above should appear. In the center, you should be able to see your robot. The black outline indicates where the lidar detects obstacles, and the light grey indicates areas that the lidar is actively scanning.

Completing the map

As you can see above, the SLAM map is incomplete since the area is grey scanned area is not fully enclosed by thick black lines indicating the sensing of a wall.

To complete the map, use teleop to move your robot around the scan space. Remember this can be done by running the below command in a new terminal shell.

$ roslaunch omo_r1mini_teleop omo_r1mini_teleop_key.launch

Next, use the A, W, S, and D key to complete the map using rviz as guidance.

Once your map is complete, run the below command to save the map.

$ rosrun map_server map_saver -f map

Then, kill all the terminals (including roscore) by pressing Control + C.

After that, run the below command to copy the map.pgm and map.yaml files to omo_r1mini_navigation/maps.

$ sudo cp map.pgm map.yaml catkin_ws/src/omo_r1mini/omo_r1mini_navigation/map

Video Demonstration

To see a video demonstration for this page, watch the attached video here: https://www.youtube.com/watch?v=lOkVKbT4eWY

Last updated