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 QoS parameter to ros2 service call #812

Open
wants to merge 2 commits into
base: humble
Choose a base branch
from

Conversation

bastianhjaeger
Copy link

In case of service setups diverging from the default QoS on a service, a service may not be called by cli due to mismatching QoS profiles.
This PR should fix it.

@bastianhjaeger bastianhjaeger force-pushed the add-qos-tp-service-call branch 7 times, most recently from 6a4df53 to 8e9f8d9 Compare March 20, 2023 15:50
Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

besides adding test cases in ros2service.test.test_cli would be better.

ros2service/ros2service/verb/call.py Outdated Show resolved Hide resolved
ros2service/ros2service/api/__init__.py Outdated Show resolved Hide resolved
ros2service/ros2service/verb/call.py Outdated Show resolved Hide resolved
@fujitatomoya
Copy link
Collaborator

@bastianhjaeger are you gonna work on this?

@bastianhjaeger
Copy link
Author

bastianhjaeger commented Apr 11, 2023

@bastianhjaeger are you gonna work on this?

Yes. I am. I am more a c++ developer, so I am slow(er), but I am willing to work on this.

Regarding your comment

besides adding test cases in ros2service.test.test_cli would be better.
Can you elaborate what you mean in detail? What kind of test cases?

And my question to you here is still open:
#812 (comment)

In addition, I do not comprehend why the test fails here:
https://build.ros2.org/job/Hpr__ros2cli__ubuntu_jammy_amd64/20/testReport/ros2service.ros2service.test/test_cli/test_cli/
Maybe someone can elaborate this?

@bastianhjaeger bastianhjaeger force-pushed the add-qos-tp-service-call branch 2 times, most recently from 0a2e7ea to 64d5ad3 Compare April 12, 2023 13:56
@fujitatomoya
Copy link
Collaborator

@bastianhjaeger thank you for the contribution, i will look into this.

ros2service/package.xml Show resolved Hide resolved
ros2service/ros2service/verb/call.py Show resolved Hide resolved
@fujitatomoya
Copy link
Collaborator

@bastianhjaeger sorry to be late to get back to you, i think implementation looks good, but could be updated for future maintenance and flexibility. thanks

…opic pub`

Signed-off-by: Bastian <bastian.h.jaeger@gmail.com>

[squash before merge] React on comments

Signed-off-by: Bastian <bastian.h.jaeger@gmail.com>
Signed-off-by: Bastian <bastian.h.jaeger@gmail.com>
@bastianhjaeger
Copy link
Author

@fujitatomoya
I actually just realized, that the merging of all the QoS arguments and its handling is not so desirable. For the ros2 topic echo you actually want the default to match current publishers QoS (reliability and durability). For ros2 topic pub it is different. This results in different descriptions in how arguments are handles, thus the arg description is different.

Moving all the QoS argument handling in one file would result in one file, but the file would contain something like

if "topic echo"
  // automatically adapt reliability/durability to current publisher
else if "topic pub"
  //...

and this is, in my opinion not desirable. My approach now would be to revert everything for the topic section and add a specific QoS arg handling for service call. What do you think?

'--qos-profile',
choices=rclpy.qos.QoSPresetProfiles.short_keys(),
default=default_profile_str,
help='Quality of service preset profile to subscribe with (default: {})'
Copy link
Collaborator

Choose a reason for hiding this comment

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

cont to https://github.com/ros2/ros2cli/pull/812/files#r1202519155, entity name should be removed as well? (it says all for subscription only.)

Suggested change
help='Quality of service preset profile to subscribe with (default: {})'
help='Quality of service preset profile with (default: {})'

@@ -0,0 +1,88 @@
# Copyright 2017 Open Source Robotics Foundation, Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry missed it 😅

Suggested change
# Copyright 2017 Open Source Robotics Foundation, Inc.
# Copyright 2023 Open Source Robotics Foundation, Inc.

@fujitatomoya
Copy link
Collaborator

match current

@fujitatomoya
Copy link
Collaborator

sorry accidentally closed, reopened.

@fujitatomoya
Copy link
Collaborator

@fujitatomoya I actually just realized, that the merging of all the QoS arguments and its handling is not so desirable. For the ros2 topic echo you actually want the default to match current publishers QoS (reliability and durability). For ros2 topic pub it is different. This results in different descriptions in how arguments are handles, thus the arg description is different.

Moving all the QoS argument handling in one file would result in one file, but the file would contain something like

if "topic echo"
  // automatically adapt reliability/durability to current publisher
else if "topic pub"
  //...

and this is, in my opinion not desirable. My approach now would be to revert everything for the topic section and add a specific QoS arg handling for service call. What do you think?

I am not clear on this. originally this PR is meant to introduce the QoS argument for ros2 service call.
but are you saying that we should introduce the new logic to see the most appropriate QoS setting for ros2 xxx xxx command individually? e.g ros2/rclcpp#1868

i might be mistaken, could you elaborate it?

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