Skip to content

Commit a839c3b

Browse files
authored
Update Understanding-ROS2-Topics.rst (#4803)
* Update Understanding-ROS2-Topics.rst Introduce bw and find commands to understanding topics tutorial * Update Understanding-ROS2-Topics.rst Rephrase description of bw command for clarity Fixes #4610 * Update Understanding-ROS2-Topics.rst Remove redundant lines * Update Understanding-ROS2-Topics.rst * Update Understanding-ROS2-Topics.rst Changes for readability and remove unnecessary lines Signed-off-by: mnhaqq <118978306+mnhaqq@users.noreply.github.com>
1 parent d9391f3 commit a839c3b

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.rst

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ If the message does not use a full header, but just has a field with type ``buil
313313
8 ros2 topic hz
314314
^^^^^^^^^^^^^^^
315315

316-
For one last introspection on this process, you can view the rate at which data is published using:
316+
You can also view the rate at which data is published using:
317317

318318
.. code-block:: console
319319
@@ -329,12 +329,52 @@ It will return data on the rate at which the ``/turtlesim`` node is publishing d
329329
Recall that you set the rate of ``turtle1/cmd_vel`` to publish at a steady 1 Hz using ``ros2 topic pub --rate 1``.
330330
If you run the above command with ``turtle1/cmd_vel`` instead of ``turtle1/pose``, you will see an average reflecting that rate.
331331

332-
.. 9 rqt_plot
333-
^^^^^^^^^^
334-
Can't do this section now because there's some significant UI issues with rqt_plot for ROS 2
332+
9 ros2 topic bw
333+
^^^^^^^^^^^^^^^
334+
335+
The bandwidth used by a topic can be viewed using:
336+
337+
.. code-block:: console
338+
339+
ros2 topic bw /turtle1/pose
340+
341+
It returns the bandwidth utilization and number of messages being published to the ``/turtle1/pose`` the topic.
342+
343+
.. code-block:: console
335344
336-
9 Clean up
337-
^^^^^^^^^^
345+
Subscribed to [/turtle1/pose]
346+
1.51 KB/s from 62 messages
347+
Message size mean: 0.02 KB min: 0.02 KB max: 0.02 KB
348+
349+
10 ros2 topic find
350+
^^^^^^^^^^^^^^^^^^
351+
352+
To list a list of available topics of a given type use:
353+
354+
.. code-block:: console
355+
356+
ros2 topic find <topic_type>
357+
358+
Recall that the ``cmd_vel`` topic has the type:
359+
360+
.. code-block:: console
361+
362+
geometry_msgs/msg/Twist
363+
364+
Using the ``find`` command outputs topics available when given the message type:
365+
366+
.. code-block:: console
367+
368+
ros2 topic find geometry_msgs/msg/Twist
369+
370+
This outputs:
371+
372+
.. code-block:: console
373+
374+
/turtle1/cmd_vel
375+
376+
11 Clean up
377+
^^^^^^^^^^^
338378

339379
At this point you'll have a lot of nodes running.
340380
Don't forget to stop them by entering ``Ctrl+C`` in each terminal.

0 commit comments

Comments
 (0)