# create the simulated environment called stage_4 $ roslaunch turtlebot3_gazebo turtlebot3_stage_4.launch # launch a simulated turtlebot3 that drives a random pattern $ roslaunch turtlebot3_gazebo turtlebot3_simulation.launch # launch the slam algoritm, which will create an in-memory map data structure $ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping # After the map looks done, save it into a map file for later. $ cd ~ $ rosrun map_server map_saver -f stage4
# Now, close all the exiting ROS nodes down and next run this. Be careful with the # file names because the yaml file contains a file name too and it is easy to # get things misaligned. # {filemname} will be something like /home/youraccount/stage4.yaml but check to make sure. $ roslaunch turtlebot3_gazebo turtlebot3_stage_4.launch $ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:={filename}