From b849ab25a48caf1730981ee6e4e57bc379239cc7 Mon Sep 17 00:00:00 2001 From: Kacper Bojakowski Date: Mon, 1 Jun 2026 06:34:37 +0200 Subject: [PATCH 1/7] Update Setting up turtlesim how-to Change from tutorial to how-to and update accordingly. --- .../Introducing-Turtlesim.rst | 255 ++++++++---------- 1 file changed, 113 insertions(+), 142 deletions(-) diff --git a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst index 23755c0e920..7b4ab3f45f0 100644 --- a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst +++ b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst @@ -4,50 +4,46 @@ .. _Turtlesim: -Using ``turtlesim``, ``ros2``, and ``rqt`` -========================================== +Setting up Turtlesim - how-to +============================= -**Goal:** Install and use the turtlesim package and rqt tools to prepare for upcoming tutorials. +The beginner ROS tutorials use Turtlesim, a simple simulator, to demonstrate core concepts without any real hardware. +This article walks you through installing Turtlesim along with the rqt GUI, then helps you run a short exercise to get hands-on experience with the basics. -**Tutorial level:** Beginner - -**Time:** 15 minutes +**Area: ROS-tutorials | Content-type: how-to | Experience: beginner** .. contents:: Contents - :depth: 2 + :depth: 3 :local: -Background ----------- - -Turtlesim is a lightweight simulator for learning ROS 2. -It illustrates what ROS 2 does at the most basic level to give you an idea of what you will do with a real robot or a robot simulation later on. - -The ros2 tool is how the user manages, introspects, and interacts with a ROS system. -It supports multiple commands that target different aspects of the system and its operation. -One might use it to start a node, set a parameter, listen to a topic, and many more. -The ros2 tool is part of the core ROS 2 installation. +Summary +------- -rqt is a graphical user interface (GUI) tool for ROS 2. -Everything done in rqt can be done on the command line, but rqt provides a more user-friendly way to manipulate ROS 2 elements. +Turtlesim is a lightweight simulator for learning ROS basics. +It helps you practice core concepts such as nodes, topics, and services, before you can work with larger systems. -This tutorial touches upon core ROS 2 concepts, like nodes, topics, and services. -All of these concepts will be elaborated on in later tutorials; for now, you will simply set up the tools and get a feel for them. +The rqt tool is a graphical interface for interacting with ROS. +You can do the same tasks from the command line, but rqt gives you a faster way to inspect and call services while learning. Prerequisites ------------- -The previous tutorial, :doc:`../Configuring-ROS2-Environment`, will show you how to set up your environment. +Before you start, make sure ROS is installed and your environment is configured. -Tasks +To learn how to set up your environment, see :doc:`../Configuring-ROS2-Environment`. + +Steps ----- -1 Install turtlesim +1 Install Turtlesim ^^^^^^^^^^^^^^^^^^^ +Turtlesim is a lightweight simulator that represents a robot as a turtle you can control on the screen. +It lets you practice core ROS concepts without the need for any real hardware. + As always, start by sourcing your setup files in a new terminal, as described in the :doc:`previous tutorial <../Configuring-ROS2-Environment>`. -Install the turtlesim package for your ROS 2 distro: +Install the Turtlesim package for your ROS distribution: .. tabs:: @@ -66,13 +62,13 @@ Install the turtlesim package for your ROS 2 distro: .. group-tab:: macOS - As long as the archive you installed ROS 2 from contains the ``ros_tutorials`` repository, you should already have turtlesim installed. + As long as the archive you installed ROS from contains the ``ros_tutorials`` repository, you should already have Turtlesim installed. .. group-tab:: Windows - As long as the archive you installed ROS 2 from contains the ``ros_tutorials`` repository, you should already have turtlesim installed. + As long as the archive you installed ROS from contains the ``ros_tutorials`` repository, you should already have Turtlesim installed. -To check if the package is installed, run the following command, which should return a list of turtlesim's executables: +To check if the package is installed, run the following command, which should return a list of Turtlesim's executables: .. code-block:: console @@ -82,63 +78,12 @@ To check if the package is installed, run the following command, which should re turtlesim turtle_teleop_key turtlesim turtlesim_node -2 Start turtlesim -^^^^^^^^^^^^^^^^^ - -To start turtlesim, enter the following command in your terminal: - -.. code-block:: console - - $ ros2 run turtlesim turtlesim_node - [INFO] [turtlesim]: Starting turtlesim with node name /turtlesim - [INFO] [turtlesim]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000] - -Under the command, you will see messages from the node. -There you can see the default turtle's name and the coordinates where it spawns. - -The simulator window should appear, with a random turtle in the center. - -.. image:: images/turtlesim.png - - -3 Use turtlesim -^^^^^^^^^^^^^^^ - -Open a new terminal and source ROS 2 again. - -Now you will run a new node to control the turtle in the first node: - -.. code-block:: console - - $ ros2 run turtlesim turtle_teleop_key +2 Install rqt (recommended) +^^^^^^^^^^^^^^^^^^^^^^^^^^^ -At this point you should have three windows open: a terminal running ``turtlesim_node``, a terminal running ``turtle_teleop_key`` and the turtlesim window. -Arrange these windows so that you can see the turtlesim window, but also have the terminal running ``turtle_teleop_key`` active so that you can control the turtle in turtlesim. +The rqt tool is a graphical interface for ROS. Instead of typing commands by hand, you can use rqt to explore and call Turtlesim's services with a few clicks. -Use the arrow keys on your keyboard to control the turtle. -It will move around the screen, using its attached "pen" to draw the path it followed so far. - -.. note:: - - Pressing an arrow key will only cause the turtle to move a short distance and then stop. - This is because, realistically, you wouldn't want a robot to continue carrying on an instruction if, for example, the operator lost the connection to the robot. - -You can see the nodes, and their associated topics, services, and actions, using the ``list`` subcommands of the respective commands: - -.. code-block:: console - - $ ros2 node list - $ ros2 topic list - $ ros2 service list - $ ros2 action list - -You will learn more about these concepts in the coming tutorials. -Since the goal of this tutorial is only to get a general overview of turtlesim, you will use rqt to call some of the turtlesim services and interact with ``turtlesim_node``. - -4 Install rqt -^^^^^^^^^^^^^ - -Open a new terminal to install ``rqt`` and its plugins: +In a new terminal, install ``rqt`` and the common plugins: .. tabs:: @@ -157,115 +102,141 @@ Open a new terminal to install ``rqt`` and its plugins: .. group-tab:: macOS - The standard archive for installing ROS 2 on macOS contains ``rqt`` and its plugins, so you should already have ``rqt`` installed. + The standard archive for installing ROS on macOS contains ``rqt`` and its plugins, so you should already have ``rqt`` installed. .. group-tab:: Windows - The standard archive for installing ROS 2 on Windows contains ``rqt`` and its plugins, so you should already have ``rqt`` installed. + The standard archive for installing ROS on Windows contains ``rqt`` and its plugins, so you should already have ``rqt`` installed. -To run rqt: +3 Try out Turtlesim with rqt +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: console +The following example uses rqt, but you can also operate Turtlesim by using the command line only. + +#. Start Turtlesim: - $ rqt + .. code-block:: console -5 Use rqt -^^^^^^^^^ + $ ros2 run turtlesim turtlesim_node + [INFO] [turtlesim]: Starting turtlesim with node name /turtlesim + [INFO] [turtlesim]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000] -When running rqt for the first time, the window will be blank. -No worries; just select **Plugins** > **Services** > **Service Caller** from the menu bar at the top. + The simulator window appears with a random turtle in the center. -.. note:: + .. image:: images/turtlesim.png - It may take some time for rqt to locate all the plugins. - If you click on **Plugins** but don't see **Services** or any other options, you should close rqt and enter the command ``rqt --force-discover`` in your terminal. +#. In a new terminal, source ROS again and start keyboard teleoperation: -.. image:: images/rqt.png + .. code-block:: console -Use the refresh button to the left of the **Service** dropdown list to ensure all the services of your turtlesim node are available. + $ ros2 run turtlesim turtle_teleop_key -Click on the **Service** dropdown list to see turtlesim's services, and select the ``/spawn`` service. + Keep the ``turtle_teleop_key`` terminal active and use arrow keys to move the turtle. -5.1 Try the spawn service -~~~~~~~~~~~~~~~~~~~~~~~~~ + .. note:: -Let's use rqt to call the ``/spawn`` service. -You can guess from its name that ``/spawn`` will create another turtle in the turtlesim window. + Pressing an arrow key will only cause the turtle to move a short distance and then stop. + This is because, realistically, you wouldn't want a robot to continue carrying on an instruction if, for example, the operator lost the connection to the robot. -Give the new turtle a unique name, like ``turtle2``, by double-clicking between the empty single quotes in the **Expression** column. -You can see that this expression corresponds to the value of **name** and is of type **string**. +#. Optional: Inspect the running system: -Next enter some valid coordinates at which to spawn the new turtle, like ``x = 1.0`` and ``y = 1.0``. + .. code-block:: console -.. image:: images/spawn.png + $ ros2 node list + $ ros2 topic list + $ ros2 service list + $ ros2 action list -.. note:: +#. Start rqt: - If you try to spawn a new turtle with the same name as an existing turtle, like the default ``turtle1``, you will get an error message in the terminal running ``turtlesim_node``: + .. code-block:: console - .. code-block:: console + $ rqt - [ERROR] [turtlesim]: A turtle named [turtle1] already exists +#. In rqt, select **Plugins** > **Services** > **Service Caller**. -To spawn ``turtle2``, you then need to call the service by clicking the **Call** button on the upper right side of the rqt window. + .. note:: -If the service call was successful, you should see a new turtle (again with a random design) spawn at the coordinates you input for **x** and **y**. + It may take some time for rqt to locate all the plugins. + If you click on **Plugins** but don't see **Services** or any other options, close rqt and enter the command ``rqt --force-discover`` in your terminal. -If you refresh the service list in rqt, you will also see that now there are services related to the new turtle, ``/turtle2/...``, in addition to ``/turtle1/...``. + .. image:: images/rqt.png -5.2 Try the set_pen service -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#. Select the ``/spawn`` service, then enter: -Now let's give ``turtle1`` a unique pen using the ``/set_pen`` service: + - ``name`` = ``turtle2`` + - ``x`` = ``1.0`` + - ``y`` = ``1.0`` -.. image:: images/set_pen.png + Click **Call** to spawn the second turtle. -The values for **r**, **g** and **b**, which are between 0 and 255, set the color of the pen ``turtle1`` draws with, and **width** sets the thickness of the line. + .. image:: images/spawn.png -To have ``turtle1`` draw with a distinct red line, change the value of **r** to 255, and the value of **width** to 5. -Don't forget to call the service after updating the values. + .. note:: -If you return to the terminal where ``turtle_teleop_key`` is running and press the arrow keys, you will see ``turtle1``'s pen has changed. + If you try to spawn a new turtle with the same name as an existing turtle, like the default ``turtle1``, you will get an error message in the terminal that runs ``turtlesim_node``: -.. image:: images/new_pen.png + .. code-block:: console -You've probably also noticed that there's no way to move ``turtle2``. -That's because there is no teleop node for ``turtle2``. + [ERROR] [turtlesim]: A turtle named [turtle1] already exists -6 Remapping -^^^^^^^^^^^ +#. Select the ``/turtle1/set_pen`` service, then set: -You need a second teleop node in order to control ``turtle2``. -However, if you try to run the same command as before, you will notice that this one also controls ``turtle1``. -The way to change this behavior is by remapping the ``cmd_vel`` topic and the ``rotate_absolute`` action. + - ``r`` = ``255`` + - ``width`` = ``5`` -In a new terminal, source ROS 2, and run: + Click **Call**, then use arrow keys in the teleop terminal to confirm the turtle draws a red, thicker line. -.. code-block:: console + .. image:: images/set_pen.png - $ ros2 run turtlesim turtle_teleop_key --ros-args --remap turtle1/cmd_vel:=turtle2/cmd_vel --remap turtle1/rotate_absolute:=turtle2/rotate_absolute + .. image:: images/new_pen.png +#. Control ``turtle2`` from another terminal by remapping: -Now, you can move ``turtle2`` when this terminal is active, and ``turtle1`` when the other terminal running ``turtle_teleop_key`` is active. + .. code-block:: console -.. image:: images/remap.png + $ ros2 run turtlesim turtle_teleop_key --ros-args --remap turtle1/cmd_vel:=turtle2/cmd_vel --remap turtle1/rotate_absolute:=turtle2/rotate_absolute -7 Close turtlesim -^^^^^^^^^^^^^^^^^ + Keep this new terminal active to move ``turtle2``. + Use the original teleop terminal to move ``turtle1``. -To stop the simulation, you can enter ``Ctrl + C`` in the ``turtlesim_node`` terminal, and ``q`` in the ``turtle_teleop_key`` terminals. + .. image:: images/remap.png -Summary -------- +#. Close Turtlesim: -Using turtlesim and rqt is a great way to learn the core concepts of ROS 2. + - In the ``turtlesim_node`` terminal, press ``Ctrl + C``. + - In ``turtle_teleop_key`` terminals, press ``q``. Next steps ---------- -Now that you have turtlesim and rqt up and running, and an idea of how they work, let's dive into the first core ROS 2 concept with the next tutorial, :doc:`../Understanding-ROS2-Nodes/Understanding-ROS2-Nodes`. +Now that you have Turtlesim and rqt running, you can continue with :doc:`../Understanding-ROS2-Nodes/Understanding-ROS2-Nodes`. Related content --------------- -The turtlesim package can be found in the `ros_tutorials `_ repo. +More articles: + +* :doc:`../Configuring-ROS2-Environment` +* :doc:`../Understanding-ROS2-Nodes/Understanding-ROS2-Nodes` +* :doc:`../Understanding-ROS2-Topics/Understanding-ROS2-Topics` + +Packages/reference: + +* `Turtlesim package in ros_tutorials `__ +* `rqt `__ +* `rqt_common_plugins `__ + +FAQs +---- + +Do I need rqt to use Turtlesim? + No. You can use Turtlesim entirely from the command line. The rqt tool is recommended because it helps you visualise the instructions you send to the turtle. + +Why can I move only one turtle at a time? + Each ``turtle_teleop_key`` instance controls one turtle namespace. + To control ``turtle2``, run a second teleop node with topic and action remapping. + +Why doesn't the turtle move when I press the arrow keys? + The ``turtle_teleop_key`` terminal must be the active window for it to capture your key presses. + Each press also moves the turtle only a short distance, so you need to press the keys repeatedly to keep the turtle moving. From 20de3f6b2f19683ac75ffba9d73131ca0058d45e Mon Sep 17 00:00:00 2001 From: Kacper Bojakowski Date: Mon, 15 Jun 2026 05:16:43 +0200 Subject: [PATCH 2/7] Implement peer review feedback --- .../Introducing-Turtlesim.rst | 56 +++++++++++-------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst index 7b4ab3f45f0..45cec70111b 100644 --- a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst +++ b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst @@ -7,10 +7,11 @@ Setting up Turtlesim - how-to ============================= -The beginner ROS tutorials use Turtlesim, a simple simulator, to demonstrate core concepts without any real hardware. -This article walks you through installing Turtlesim along with the rqt GUI, then helps you run a short exercise to get hands-on experience with the basics. +Turtlesim is a simple simulator to demonstrate core concepts without any hardware. +This article walks you through installation of Turtlesim and the rqt GUI. +A short exercise provides you with basic experience with these tools. -**Area: ROS-tutorials | Content-type: how-to | Experience: beginner** +**Area: Framework | Content-type: how-to | Experience: beginner** .. contents:: Contents :depth: 3 @@ -20,10 +21,10 @@ Summary ------- Turtlesim is a lightweight simulator for learning ROS basics. -It helps you practice core concepts such as nodes, topics, and services, before you can work with larger systems. +Install the package ``ros-{DISTRO}-turtlesim``. The rqt tool is a graphical interface for interacting with ROS. -You can do the same tasks from the command line, but rqt gives you a faster way to inspect and call services while learning. +Install the package ``ros-{DISTRO}-rqt``. Prerequisites ------------- @@ -41,7 +42,7 @@ Steps Turtlesim is a lightweight simulator that represents a robot as a turtle you can control on the screen. It lets you practice core ROS concepts without the need for any real hardware. -As always, start by sourcing your setup files in a new terminal, as described in the :doc:`previous tutorial <../Configuring-ROS2-Environment>`. +Start by sourcing your setup files in a new terminal, as described in :doc:`Configuring environment <../Configuring-ROS2-Environment>`. Install the Turtlesim package for your ROS distribution: @@ -81,7 +82,8 @@ To check if the package is installed, run the following command, which should re 2 Install rqt (recommended) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The rqt tool is a graphical interface for ROS. Instead of typing commands by hand, you can use rqt to explore and call Turtlesim's services with a few clicks. +The rqt tool is a graphical interface for ROS. +Instead of typing commands by hand, you can use rqt to explore and call Turtlesim's services with a few clicks. In a new terminal, install ``rqt`` and the common plugins: @@ -108,10 +110,18 @@ In a new terminal, install ``rqt`` and the common plugins: The standard archive for installing ROS on Windows contains ``rqt`` and its plugins, so you should already have ``rqt`` installed. +To check if the packages are installed, in a terminal, enter the following: + +.. code-block:: console + + $ ros2 pkg list | grep -E '^rqt$|^rqt_common_plugins$' + rqt + rqt_common_plugins + 3 Try out Turtlesim with rqt ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following example uses rqt, but you can also operate Turtlesim by using the command line only. +The following example uses rqt but you can also operate Turtlesim by entering the same commands in the command line. #. Start Turtlesim: @@ -135,10 +145,10 @@ The following example uses rqt, but you can also operate Turtlesim by using the .. note:: - Pressing an arrow key will only cause the turtle to move a short distance and then stop. - This is because, realistically, you wouldn't want a robot to continue carrying on an instruction if, for example, the operator lost the connection to the robot. + Pressing an arrow key causes the turtle to move a short distance and then stop. + This behaviour ensures a robot doesn't continue carrying on an instruction if, for example, the operator loses connection to the robot. -#. Optional: Inspect the running system: +#. (Optional) Inspect the running system: .. code-block:: console @@ -162,30 +172,32 @@ The following example uses rqt, but you can also operate Turtlesim by using the .. image:: images/rqt.png -#. Select the ``/spawn`` service, then enter: +#. To spawn a second turtle, select the ``/spawn`` service, then enter: - ``name`` = ``turtle2`` - ``x`` = ``1.0`` - ``y`` = ``1.0`` - Click **Call** to spawn the second turtle. + Click **Call**. .. image:: images/spawn.png .. note:: - If you try to spawn a new turtle with the same name as an existing turtle, like the default ``turtle1``, you will get an error message in the terminal that runs ``turtlesim_node``: + Each turtle needs a unique name. + If you spawn a turtle with an existing name, you get an error message in the terminal that runs ``turtlesim_node``: .. code-block:: console [ERROR] [turtlesim]: A turtle named [turtle1] already exists -#. Select the ``/turtle1/set_pen`` service, then set: +#. Set the turtle to draw a red, thicker line. + Select the ``/turtle1/set_pen`` service, then set: - ``r`` = ``255`` - ``width`` = ``5`` - Click **Call**, then use arrow keys in the teleop terminal to confirm the turtle draws a red, thicker line. + Click **Call**, then use arrow keys in the teleoperation terminal to confirm the turtle draws a red, thicker line. .. image:: images/set_pen.png @@ -198,7 +210,7 @@ The following example uses rqt, but you can also operate Turtlesim by using the $ ros2 run turtlesim turtle_teleop_key --ros-args --remap turtle1/cmd_vel:=turtle2/cmd_vel --remap turtle1/rotate_absolute:=turtle2/rotate_absolute Keep this new terminal active to move ``turtle2``. - Use the original teleop terminal to move ``turtle1``. + Continue using the original teleoperation terminal to move ``turtle1``. .. image:: images/remap.png @@ -207,16 +219,12 @@ The following example uses rqt, but you can also operate Turtlesim by using the - In the ``turtlesim_node`` terminal, press ``Ctrl + C``. - In ``turtle_teleop_key`` terminals, press ``q``. -Next steps ----------- - -Now that you have Turtlesim and rqt running, you can continue with :doc:`../Understanding-ROS2-Nodes/Understanding-ROS2-Nodes`. - Related content --------------- More articles: +* :doc:`First steps with ROS <../../../First-Steps>` * :doc:`../Configuring-ROS2-Environment` * :doc:`../Understanding-ROS2-Nodes/Understanding-ROS2-Nodes` * :doc:`../Understanding-ROS2-Topics/Understanding-ROS2-Topics` @@ -231,7 +239,9 @@ FAQs ---- Do I need rqt to use Turtlesim? - No. You can use Turtlesim entirely from the command line. The rqt tool is recommended because it helps you visualise the instructions you send to the turtle. + No. + You can use Turtlesim entirely from the command line. + The rqt tool is recommended because it helps you visualize the instructions you send to the turtle. Why can I move only one turtle at a time? Each ``turtle_teleop_key`` instance controls one turtle namespace. From c26469d04311d3acd20f7d34ff15b900d6c0cdab Mon Sep 17 00:00:00 2001 From: Denise Marshall Date: Wed, 1 Jul 2026 13:42:42 +0000 Subject: [PATCH 3/7] Peer review updates to Turtlesim topic --- .../Introducing-Turtlesim/Introducing-Turtlesim.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst index 45cec70111b..fc9839185ca 100644 --- a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst +++ b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst @@ -7,7 +7,7 @@ Setting up Turtlesim - how-to ============================= -Turtlesim is a simple simulator to demonstrate core concepts without any hardware. +Turtlesim is a simple simulator to demonstrate core ROS concepts without any hardware. This article walks you through installation of Turtlesim and the rqt GUI. A short exercise provides you with basic experience with these tools. @@ -40,7 +40,7 @@ Steps ^^^^^^^^^^^^^^^^^^^ Turtlesim is a lightweight simulator that represents a robot as a turtle you can control on the screen. -It lets you practice core ROS concepts without the need for any real hardware. +It lets you practice core ROS concepts without the need for any hardware. Start by sourcing your setup files in a new terminal, as described in :doc:`Configuring environment <../Configuring-ROS2-Environment>`. @@ -69,7 +69,7 @@ Install the Turtlesim package for your ROS distribution: As long as the archive you installed ROS from contains the ``ros_tutorials`` repository, you should already have Turtlesim installed. -To check if the package is installed, run the following command, which should return a list of Turtlesim's executables: +To check if the package is installed, run the following command, which returns a list of Turtlesim's executables: .. code-block:: console @@ -83,6 +83,8 @@ To check if the package is installed, run the following command, which should re ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The rqt tool is a graphical interface for ROS. +For more information about rqt, see :doc:`../../../../Concepts/Intermediate/About-RQt`. + Instead of typing commands by hand, you can use rqt to explore and call Turtlesim's services with a few clicks. In a new terminal, install ``rqt`` and the common plugins: @@ -131,7 +133,7 @@ The following example uses rqt but you can also operate Turtlesim by entering th [INFO] [turtlesim]: Starting turtlesim with node name /turtlesim [INFO] [turtlesim]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000] - The simulator window appears with a random turtle in the center. + The simulator window opens with a random turtle in the center. .. image:: images/turtlesim.png From ddec86c468d8ed8b08f795a4fab37793befaf2d8 Mon Sep 17 00:00:00 2001 From: Kacper Bojakowski Date: Thu, 2 Jul 2026 07:21:05 +0200 Subject: [PATCH 4/7] Peer review update --- .../Introducing-Turtlesim.rst | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst index 45cec70111b..1d4ee6a71a5 100644 --- a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst +++ b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst @@ -36,14 +36,16 @@ To learn how to set up your environment, see :doc:`../Configuring-ROS2-Environme Steps ----- +.. note:: + Do not forget to source ROS in every new terminal you open. + See :doc:`Configuring environment <../Configuring-ROS2-Environment>`. + 1 Install Turtlesim ^^^^^^^^^^^^^^^^^^^ Turtlesim is a lightweight simulator that represents a robot as a turtle you can control on the screen. It lets you practice core ROS concepts without the need for any real hardware. -Start by sourcing your setup files in a new terminal, as described in :doc:`Configuring environment <../Configuring-ROS2-Environment>`. - Install the Turtlesim package for your ROS distribution: .. tabs:: @@ -69,11 +71,16 @@ Install the Turtlesim package for your ROS distribution: As long as the archive you installed ROS from contains the ``ros_tutorials`` repository, you should already have Turtlesim installed. -To check if the package is installed, run the following command, which should return a list of Turtlesim's executables: +To check if the package is installed, run: .. code-block:: console $ ros2 pkg executables turtlesim + +The output should list Turtlesim's executables: + +.. code-block:: console + turtlesim draw_square turtlesim mimic turtlesim turtle_teleop_key @@ -110,13 +117,22 @@ In a new terminal, install ``rqt`` and the common plugins: The standard archive for installing ROS on Windows contains ``rqt`` and its plugins, so you should already have ``rqt`` installed. -To check if the packages are installed, in a terminal, enter the following: +To check if the packages are installed, in a terminal, run: + +.. code-block:: console + + $ ros2 pkg list | grep -E '^rqt_gui$|^rqt_common_plugins$' + +The output should include: .. code-block:: console - $ ros2 pkg list | grep -E '^rqt$|^rqt_common_plugins$' - rqt rqt_common_plugins + rqt_gui + +.. note:: + + If the packages do not appear in the list, make sure you have sourced ROS in the current terminal. 3 Try out Turtlesim with rqt ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -148,7 +164,7 @@ The following example uses rqt but you can also operate Turtlesim by entering th Pressing an arrow key causes the turtle to move a short distance and then stop. This behaviour ensures a robot doesn't continue carrying on an instruction if, for example, the operator loses connection to the robot. -#. (Optional) Inspect the running system: +#. (Optional) In a new terminal, source ROS again and inspect the running system: .. code-block:: console @@ -170,6 +186,10 @@ The following example uses rqt but you can also operate Turtlesim by entering th It may take some time for rqt to locate all the plugins. If you click on **Plugins** but don't see **Services** or any other options, close rqt and enter the command ``rqt --force-discover`` in your terminal. + .. note:: + + You might need to select the **Refresh Service** button to the left of the **Service** drop-down. + .. image:: images/rqt.png #. To spawn a second turtle, select the ``/spawn`` service, then enter: @@ -203,7 +223,7 @@ The following example uses rqt but you can also operate Turtlesim by entering th .. image:: images/new_pen.png -#. Control ``turtle2`` from another terminal by remapping: +#. In a new terminal, control ``turtle2`` by remapping: .. code-block:: console From 43f4be83d8a455fdb234cb91578a33ea0598979a Mon Sep 17 00:00:00 2001 From: Kacper Bojakowski Date: Thu, 2 Jul 2026 07:27:15 +0200 Subject: [PATCH 5/7] Update Introducing-Turtlesim.rst --- .../Introducing-Turtlesim/Introducing-Turtlesim.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst index ce5de5db23a..4fa0fc4ad35 100644 --- a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst +++ b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst @@ -44,9 +44,6 @@ Steps ^^^^^^^^^^^^^^^^^^^ Turtlesim is a lightweight simulator that represents a robot as a turtle you can control on the screen. -It lets you practice core ROS concepts without the need for any hardware. - -Start by sourcing your setup files in a new terminal, as described in :doc:`Configuring environment <../Configuring-ROS2-Environment>`. It lets you practice core ROS concepts without the need for any real hardware. Install the Turtlesim package for your ROS distribution: From 27b29d0fd62c4a52476d4d39cad469fd1447233a Mon Sep 17 00:00:00 2001 From: Kacper Bojakowski Date: Sun, 19 Jul 2026 05:27:08 +0200 Subject: [PATCH 6/7] Implement SME feedback --- .../Introducing-Turtlesim.rst | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst index 4fa0fc4ad35..e2b9e370255 100644 --- a/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst +++ b/source/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.rst @@ -90,9 +90,8 @@ The output should list Turtlesim's executables: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The rqt tool is a graphical interface for ROS. -For more information about rqt, see :doc:`../../../../Concepts/Intermediate/About-RQt`. - Instead of typing commands by hand, you can use rqt to explore and call Turtlesim's services with a few clicks. +For more information about rqt, see :doc:`../../../../Concepts/Intermediate/About-RQt`. In a new terminal, install ``rqt`` and the common plugins: @@ -166,7 +165,10 @@ The following example uses rqt but you can also operate Turtlesim by entering th Pressing an arrow key causes the turtle to move a short distance and then stop. This behaviour ensures a robot doesn't continue carrying on an instruction if, for example, the operator loses connection to the robot. -#. (Optional) In a new terminal, source ROS again and inspect the running system: +#. (Optional) List the active nodes, topics, services, and actions. + This will help you verify what is currently running and available. + + In a new terminal, source ROS again, then run: .. code-block:: console @@ -175,6 +177,11 @@ The following example uses rqt but you can also operate Turtlesim by entering th $ ros2 service list $ ros2 action list + ``ros2 node list`` shows the nodes currently running in the system. + ``ros2 topic list`` shows the topics through which nodes exchange data. + ``ros2 service list`` shows the services nodes expose for request-response interactions. + ``ros2 action list`` shows the actions available for long-running tasks such as rotating the turtle. + #. Start rqt: .. code-block:: console @@ -225,7 +232,13 @@ The following example uses rqt but you can also operate Turtlesim by entering th .. image:: images/new_pen.png -#. In a new terminal, control ``turtle2`` by remapping: +#. Set up a teleoperation node for ``turtle2``. + + By default, ``turtle_teleop_key`` sends commands to topics and actions under the ``turtle1`` namespace. + To control ``turtle2`` instead, use the ``--remap`` option to point those topics and actions at the ``turtle2`` namespace. + This lets you reuse the same executable for a different turtle without changing any code. + + In a new terminal, run: .. code-block:: console From 00019e92990dbe92f43ef311d8951174f17fe7b5 Mon Sep 17 00:00:00 2001 From: Kacper Bojakowski Date: Sun, 19 Jul 2026 06:00:10 +0200 Subject: [PATCH 7/7] Fix links --- .../Introducing-Turtlesim/Introducing-Turtlesim.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Get-Started/Introducing-Turtlesim/Introducing-Turtlesim.rst b/source/Get-Started/Introducing-Turtlesim/Introducing-Turtlesim.rst index e2b9e370255..e46a4297057 100644 --- a/source/Get-Started/Introducing-Turtlesim/Introducing-Turtlesim.rst +++ b/source/Get-Started/Introducing-Turtlesim/Introducing-Turtlesim.rst @@ -91,7 +91,7 @@ The output should list Turtlesim's executables: The rqt tool is a graphical interface for ROS. Instead of typing commands by hand, you can use rqt to explore and call Turtlesim's services with a few clicks. -For more information about rqt, see :doc:`../../../../Concepts/Intermediate/About-RQt`. +For more information about rqt, see :doc:`../../Developer-Tools/Visualization/About-RQt`. In a new terminal, install ``rqt`` and the common plugins: @@ -259,10 +259,10 @@ Related content More articles: -* :doc:`First steps with ROS <../../../First-Steps>` +* :doc:`First steps with ROS <../../First-Steps>` * :doc:`../Configuring-ROS2-Environment` -* :doc:`../Understanding-ROS2-Nodes/Understanding-ROS2-Nodes` -* :doc:`../Understanding-ROS2-Topics/Understanding-ROS2-Topics` +* :doc:`../../ROS-Framework/nodes/Working-with-nodes/Understanding-ROS2-Nodes/Understanding-ROS2-Nodes` +* :doc:`../../ROS-Framework/interfaces/topics/Understanding-ROS2-Topics/Understanding-ROS2-Topics` Packages/reference: