In this section we will learn how to add the world configuration that we created in the last section in the launch file.

Step 1: Open the created world in Gazebo

Use this command to open the world in Gazebo:

gazebo my_world.world

Step 2: Remove the Robot from the world and save the file as test_world.world

  1. Under Models Right-click on robot then delete.
  2. Then go to File →Save World As and name it test_world.world

Step 3: Create New Folder named worlds in my_robot_bringup package

image.png


Step 4: Move test_world.world File to worlds Folder

Use this command:

mv test_world.world ros2_ws/src/my_robot_bringup/worlds/

Step 5: Install the worlds Folder in the CMakeLists.txt

image.png