-
Notifications
You must be signed in to change notification settings - Fork 246
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
Mixed-QoS settings used for ros2 bag play #629
Comments
This is definitely something we considered when building it (and clearly just backed off from making a final decision). The problem here is that because ROS 2 is built up as an anonymized pub/sub system - we don't know where an individual message is coming from, and therefore don't know how to associate a specific message with a specific QoS. There are a few cases to consider:
Clearly option 1 is unacceptable (probably fully duplicatilng some topics' messages). Option 3 may be a decent compromise but could have subtly confusing side effects for users. Option 2 is the only truly correct way, but it also will require new RMW APIs to expose information that is not presently available. EDIT 2: Leaving above for context - I did not realize that that RMW API rmw_take_with_info exists. This appears to make this problem a lot easier - we could tag messages per origin publisher and play them back on a Publisher with the appropriate QoS. Now that I'm aware of this API the problem seems less daunting. I think it will still require a good deal of code and testing, best broken up into several PRs, but it seems more doable assuming this API is properly implemented for at least the 3 top-tier RMW implementations EDIT 3: I really should do all my research before posting conclusions - the GenericSubscription that |
Thanks @mjeronimo for opening the issue and @emersonknapp for laying out the options. I agree that option 2 seems the most appropriate. I suggest we leave this ticket open for visibility, in case someone really wants to tackle it. Possibly label it as "backlog", as it doesn't sound like something we're planning to address. |
Not sure if comment edits notify watchers, so I am commenting to note that I edited the above with a lot more promising context. |
@emersonknapp Thanks for the helpful info. That'll give someone a good start on this. |
|
Documenting the following issue to get feedback and understand if it is worth addressing or if the case is so infrequent that a change like this is not worth considering...
Description
When recording, ros2 bag record saves QoS information for each publisher on a specific topic to the database (under 'offered_qos_profiles'). Each message received on that topic is also saved. However, there is not an association between the messages and the QoS settings used to originally publish the messages. Currently, when playing back from a previously-recorded database, ros2 bag play creates a publisher for each topic (even if there were originally multiple publishers for that topic). When creating the publisher, it needs to provide a QoS profile. If the topic had a single publisher, or if a topic had multiple publishers but they all used the same QoS profile, there is not a problem figuring out the QoS profile to use. However, if the original publishers used different QoS profiles, ros2 bag play needs to adapt the recorded QoS profiles ("offered_qos_profiles") into one it can use for the publisher. In this case, the rosbag2 code uses a default QoS setting:
The result is that "ros2 bag play" is not quite faithful, from a QoS perspective to the original publishing.
Implementation Notes / Suggestions
To implement this case, we would need to know the QoS settings used for each published message. We currently store the QoS profiles, but they are not associated with individual messages, but are only associated to a topic (which could possibly have multiple publishers with different QoS). It may be that this is a rare situation and publishers of the same topic should be using the same QoS settings.
The text was updated successfully, but these errors were encountered: