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

Added ros2 service info to documentation #4080

Merged
merged 3 commits into from
Dec 26, 2023
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 @@ -142,7 +142,32 @@ Which will return:
/turtle1/teleport_relative [turtlesim/srv/TeleportRelative]
...

4 ros2 service find
4 ros2 service info
^^^^^^^^^^^^^^^^^^^

To see information of a particular service, use the command:

.. code-block:: console

ros2 service info <service_name>

This returns the service type and the count of service clients and servers.

For example, you can find the count of clients and servers for the ``/clear`` service:

.. code-block:: console

ros2 service info /clear

Which will return:

.. code-block:: console

Type: std_srvs/srv/Empty
Clients count: 0
Services count: 1

5 ros2 service find
^^^^^^^^^^^^^^^^^^^

If you want to find all the services of a specific type, you can use the command:
Expand All @@ -164,7 +189,7 @@ Which will return:
/clear
/reset

5 ros2 interface show
6 ros2 interface show
^^^^^^^^^^^^^^^^^^^^^

You can call services from the command line, but first you need to know the structure of the input arguments.
Expand Down Expand Up @@ -214,7 +239,7 @@ The information above the ``---`` line tells us the arguments needed to call ``/

The information below the line isn't something you need to know in this case, but it can help you understand the data type of the response you get from the call.

6 ros2 service call
7 ros2 service call
^^^^^^^^^^^^^^^^^^^

Now that you know what a service type is, how to find a service's type, and how to find the structure of that type's arguments, you can call a service using:
Expand Down