Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Understanding-ROS2-Topics.rst (backport #4803) #4818

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ If the message does not use a full header, but just has a field with type ``buil
8 ros2 topic hz
^^^^^^^^^^^^^^^

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

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

.. 9 rqt_plot
^^^^^^^^^^
Can't do this section now because there's some significant UI issues with rqt_plot for ROS 2
9 ros2 topic bw
^^^^^^^^^^^^^^^

The bandwidth used by a topic can be viewed using:

.. code-block:: console
ros2 topic bw /turtle1/pose
It returns the bandwidth utilization and number of messages being published to the ``/turtle1/pose`` the topic.

.. code-block:: console
9 Clean up
^^^^^^^^^^
Subscribed to [/turtle1/pose]
1.51 KB/s from 62 messages
Message size mean: 0.02 KB min: 0.02 KB max: 0.02 KB
10 ros2 topic find
^^^^^^^^^^^^^^^^^^

To list a list of available topics of a given type use:

.. code-block:: console
ros2 topic find <topic_type>
Recall that the ``cmd_vel`` topic has the type:

.. code-block:: console
geometry_msgs/msg/Twist
Using the ``find`` command outputs topics available when given the message type:

.. code-block:: console
ros2 topic find geometry_msgs/msg/Twist
This outputs:

.. code-block:: console
/turtle1/cmd_vel
11 Clean up
^^^^^^^^^^^

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