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 missing qos_profile argument to publisher and subscriber in migration guide #3858

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

mjforan
Copy link
Contributor

@mjforan mjforan commented Aug 22, 2023

No description provided.

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.

i am not sure if we want to add this to migration guide.

i think these migration guide is meant to show some basic API mapping between ROS 1 and ROS 2. probably it would be simpler if we do not add any other configuration details such as QoS?

i would like to have other opinion. thanks.

@mjforan
Copy link
Contributor Author

mjforan commented Aug 23, 2023

In ROS 1 the queue_size argument was optional, but in ROS 2 it is required. The examples given will not run without my changes. I added the optional queue_size argument on the ROS 1 side to show a more direct correspondence to the ROS 2 functions. I think the short description (quoted from the API definition) is useful to explain the difference between the two possible choices.

@fujitatomoya
Copy link
Collaborator

In ROS 1 the queue_size argument was optional, but in ROS 2 it is required.

this is good point. probably we should fix ROS 2 implementation as optional? i am not sure why this is required arguments for the API, it seems to me that we can use default topic configuration if not specified?

@clalancette what do you think?

@mjforan
Copy link
Contributor Author

mjforan commented Aug 23, 2023

Agreed that it should be optional in the API.

@clalancette
Copy link
Contributor

this is good point. probably we should fix ROS 2 implementation as optional? i am not sure why this is required arguments for the API, it seems to me that we can use default topic configuration if not specified?

We had a lot of discussion about that particular part of the ROS 2 API back near the beginning of development. The original proposal was actually to make the QoS object a required part of the API, but we ended up compromising so just the queue size is required, with the QoS object being optional. The idea is that we should have the user specify these things so that they will be required to think about them; there may be different things a user does in their callbacks when the queue size is 1 vs. 10, for instance.

All of that said, this isn't the right place to discuss this. If you'd like to make a proposal for changing the API, we can certainly discuss it again. Please open a new issue on https://github.com/ros2/ros2 and we can talk further there.

@fujitatomoya
Copy link
Collaborator

what #3858 (comment) said,

The examples given will not run without my changes.

this stands out for now.


or
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure if the following explanation should be added here since this doc simply explains migration mapping between ROS 1 and ROS 2. but this does not block the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, agreed. My thinking is that we aren't necessarily trying to teach ROS 2 here (that is done elsewhere), but just give straightforward advice on how to port. From that perspective, I think we should just use the version above, since that is the most common.


or
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, agreed. My thinking is that we aren't necessarily trying to teach ROS 2 here (that is done elsewhere), but just give straightforward advice on how to port. From that perspective, I think we should just use the version above, since that is the most common.

Comment on lines 95 to 101
or

.. code-block:: python

sub = node.create_subscription(String, 'chatter', callback, rclpy.qos.QoSProfile())

The fourth parameter is "A QoSProfile or a history depth to apply to the subscription. In the case that a history depth is provided, the QoS history is set to KEEP_LAST, the QoS history depth is set to the value of the parameter, and all other QoS settings are set to their default values."
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here; I think we can just drop this whole thing.

@mjforan
Copy link
Contributor Author

mjforan commented Aug 24, 2023

How about this? I removed the description text but I still think it's useful to show both forms of the functions.

@clalancette
Copy link
Contributor

I think this looks OK now, but this is going to conflict with #3861. What I think we should do here is get #3861 in, and then rebase this on top.

@clalancette clalancette added the backport-all backport at reviewers discretion; from rolling to all versions label Aug 30, 2023
@clalancette clalancette merged commit 5c8a652 into ros2:rolling Aug 30, 2023
3 checks passed
mergify bot pushed a commit that referenced this pull request Aug 30, 2023
mergify bot pushed a commit that referenced this pull request Aug 30, 2023
clalancette pushed a commit that referenced this pull request Aug 30, 2023
(cherry picked from commit 5c8a652)

Co-authored-by: Matthew Foran <[email protected]>
clalancette pushed a commit that referenced this pull request Aug 30, 2023
(cherry picked from commit 5c8a652)

Co-authored-by: Matthew Foran <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-all backport at reviewers discretion; from rolling to all versions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants