Skip to content

Conversation

artivis
Copy link
Contributor

@artivis artivis commented Jun 7, 2019

Add the type verb to service which return the type of a given service.
E.g.
given ros2 run demo_nodes_cpp talker

$ ros2 service type /talker/describe_parameters
rcl_interfaces/srv/DescribeParameters


for (service_name, service_types) in service_names_and_types:
if args.service_name == service_name:
print(service_types[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should this only print the first type? (I guess the same question applies to the previous topic PR.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, can it really have several types ?? If so then this is a mistake.
I only print the first one for a formatting purpose, I could do the same with a loop I guess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it really have several types ??

Yes, it can have multiple types. That is why the API returns a list of type names.

I could do the same with a loop I guess.

👍 one type per line sounds good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Signed-off-by: artivis <[email protected]>
@artivis artivis mentioned this pull request Jun 7, 2019
@dirk-thomas
Copy link
Member

Thanks for the feature addition.

Build Status

@dirk-thomas dirk-thomas merged commit 9e1cb8d into ros2:master Jun 7, 2019
@artivis artivis deleted the feature/service_type branch June 11, 2019 20:51
@kyrofa kyrofa mentioned this pull request Sep 4, 2019
34 tasks
esteve pushed a commit to esteve/ros2cli that referenced this pull request Dec 16, 2022
* Assert the client call succeeded

Signed-off-by: Shane Loretz <[email protected]>

* Shutdown rclpy when test throws exceptions

Signed-off-by: Shane Loretz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants