1.6.2 Launching the TurtleBot3 Simulation

Once the TurtleBot3 packages and Gazebo are installed, you can launch the simulation.

  1. Step 1: Launch the Simulation in Gazebo

    Use the following command to open the TurtleBot3 world in Gazebo:

    ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

    This command does a few things:

    • ros2 launch: Runs launch files in ROS 2.

    • turtlebot3_gazebo: The package containing the TurtleBot3 Gazebo files.

    • turtlebot3_world.launch.py: The launch file that starts Gazebo with a predefined TurtleBot3 environment.

    You should see a virtual environment with the TurtleBot3 model ready to be controlled.

  2. Step 2: Visualizing the Robot in Rviz

    In parallel with Gazebo, you can visualize the robot in Rviz, a 3D visualization tool in ROS. Rviz helps you understand the robot's sensors, position, and movements.

    ros2 launch turtlebot3_bringup rviz2.launch.py

Last updated