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

Add 'service type' verb #273

Merged
merged 2 commits into from
Jun 7, 2019
Merged

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

Signed-off-by: artivis <jeremie.deray@canonical.com>

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 <jeremie.deray@canonical.com>
@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 <sloretz@openrobotics.org>

* Shutdown rclpy when test throws exceptions

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
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.

None yet

2 participants