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

Introduce QoS property #409

Merged
merged 12 commits into from
Sep 19, 2019
Merged

Conversation

Martin-Idel
Copy link
Contributor

Fix #360

Idea:

  • Introduce a new set of properties to any display with a topic to change all interesting QoS settings
  • In order not to clutter the panel too much (the settings are probably only relevant to a subset of users), we hide the settings below a topic property.
  • This allows to cleanup the unreliable property as well as the queue_size property.

Not in this PR:

  • There are to-do comments to switch to using rclcpp::QoS. I did not do this change to simplify reviewing and because at least for the property, I think it is much easier to work with the rmw profile as it simplifies working with all options.

Feedback needed for:

  • What kind of feedback can and should we give the user if messages with an incompatible profile are shown? For instance, if the publisher uses volatile but I set transient local, then no message gets received. Should we and how can we provide user feedback?
  • Do we need the lifetime options for RViz (no real documentation so I'm not sure whether this is necessary for rviz)?
  • I'm unsure whether all options in the enums contained in rmw_qos_profile_t are necessary. In particular, I'm unsure whether we need the Unknown options.
  • I would suggest adding a separate QoS property for every topic, i.e.: if a display can subscribe to multiple topics (e.g. map or camera), every topic property should get an associated qos property. This has not been done, yet.
  • Publishing displays/tools should probably also use this property?

@jacobperron
Copy link
Member

jacobperron commented Sep 10, 2019

What kind of feedback can and should we give the user if messages with an incompatible profile are shown? For instance, if the publisher uses volatile but I set transient local, then no message gets received. Should we and how can we provide user feedback?

I think this would be nice to have, but I'm not sure the best way to detect incompatible publishers. I think one way would involve comparing the number of matched publishers to the actual number of publishers for a given topic. We can get the number of matched publishers with SubscriptionBase::get_publisher_count(), and number of publishers on a topic with NodeGraph::count_publishers().

I think it we be okay to leave this as an enhancement "TODO" for the first pass.

Do we need the lifetime options for RViz (no real documentation so I'm not sure whether this is necessary for rviz)?

Consider that lifespan and liveliness are not addressed the relevant design document I would say we can ignore them for now.
We can always add them later as needed.

I'm unsure whether all options in the enums contained in rmw_qos_profile_t are necessary. In particular, I'm unsure whether we need the Unknown options.

I think the unknown options are more for error handling and we probably shouldn't include those as options in RViz.

I would suggest adding a separate QoS property for every topic, i.e.: if a display can subscribe to multiple topics (e.g. map or camera), every topic property should get an associated qos property. This has not been done, yet.

👍 Makes sense to me.

Publishing displays/tools should probably also use this property?

Seems reasonable. For example, I could imagine someone wanting the initial pose tool to have durability set to transient local.

@Martin-Idel
Copy link
Contributor Author

I think it we be okay to leave this as an enhancement "TODO" for the first pass.

Sounds good to me.

I would suggest adding a separate QoS property for every topic, i.e.: if a display can subscribe to multiple topics (e.g. map or camera), every topic property should get an associated qos property. This has not been done, yet.

+1 Makes sense to me.

Map display and Camera (those are the two displays with an additional subscription) also use the qos profile in their second subscription now. However, I did not yet add another profile property. The reason is that both displays only have one topic property and the second subscription is derived "magically" from the first (e.g. the map update topic is the map topic + "_update"). Therefore, there is no good place to have a separate qos property. Does it make sense to have different QoS settings for the camera and the camera info topic? What about the map and map update topic?
If yes (and for the map, I'd say it makes sense), I'd propose adding a second topic property. If the name of the map_update and the camera_info topics are more than a convention (e.g. some rule), I could try to make them non-editable.

Seems reasonable. For example, I could imagine someone wanting the initial pose tool to have durability set to transient local.

Publishing tools now have their own qos_profile.

I tried to use the rclcpp::QoS-API everywhere, except for the property where I believe it's simpler to use the rmw types.

Apart from this, I'm nearly done - one test is failing that I have to fix.

@Martin-Idel
Copy link
Contributor Author

Martin-Idel commented Sep 11, 2019

Test is fixed - the rclcpp::QosInitialization::from_rmw tripped me up, it doesn't do what I thought from the name because it only fills certain fields...

I'm done for now, we only need to decide what to do with map and camera, otherwise this is good to review.

@jacobperron
Copy link
Member

Does it make sense to have different QoS settings for the camera and the camera info topic? What about the map and map update topic?
If yes (and for the map, I'd say it makes sense), I'd propose adding a second topic property. If the name of the map_update and the camera_info topics are more than a convention (e.g. some rule), I could try to make them non-editable.

I agree it makes sense to have separate QoS settings for the map and map_update topics, and therefore an additional topic property. I guess it makes sense for the camera and camera_info topics as well. Looking at the image_transport code, it looks like they use the same QoS settings, but I think this is more of a convention. I'm not aware of any REP or standard stating otherwise.

I'm fine leaving this as a follow-up enhancement, but I'll leave it up to you.

@Martin-Idel
Copy link
Contributor Author

@jacobperron I'm done. I tested it locally and it all seemed to work.

Regarding the camera and map display, here is what I did:

  • Since the camera display should use image tools anyway and there is an open ticket Camera display makes unclear assumptions about camera info topic #207 I'll leave it as is, i.e. the camera info topic will always have the same profile as the camera topic.
  • For the map display, I introduced a new read-only property for the update topic which has a QoS property. This means:
    • You can change the QoS settings for the map and the update topic separately
    • You can see where the update topic will be subscribed to
    • But you cannot change where the update topic will subscribe - this is (as of now) fixed to the old behaviour

It's not difficult to change the behaviour to allow the user to change the update topic, too, but there are a few questions and fine points to this (Should we keep the old behaviour, i.e. automatically subscribe to the update topic? In code, the functions are a bit intertwined, one has to be careful to not produce an infinite update loop), so I think we should wait until somebody really needs this.

When this gets merged, we should also open a ticket to track future improvements for user feedback regarding subscriptions to existing topics which have different QoS properties.

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

Looks good to me, mostly just minor comments.

This will also need a rebase before running CI.


private Q_SLOTS:
void updateQueueSize();
void updateQosProfile();

private:
rviz_common::properties::IntProperty * queue_size_property_;
Copy link
Member

Choose a reason for hiding this comment

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

The term depth is used in the context of DDS. What do you think about renaming instances of "queue" to "depth"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used "depth" instead of "queue_size" as "depth_size" seemed redundant. Hopefully caught everything.

rviz_common/test/properties/qos_profile_property_test.cpp Outdated Show resolved Hide resolved
- not a "true" property, but a container of properties
- will call a callback when changed, similar to queue_size_property
before
- this will allow the property to be put below each ros topic property
- Will be superseded by QOS property
will be superseded by qos profile property
- below ros topic property to not needlessly clutter
  the panel
The fluent API is nice, but for the property itself,
it seems easier to just use the rmw type.
The alternative is a lot of if-statements which is
not easier to read
@Martin-Idel Martin-Idel force-pushed the introduce_qos_property branch 2 times, most recently from 925eff4 to f3c91ec Compare September 19, 2019 18:19
@Martin-Idel
Copy link
Contributor Author

I added the suggestions and rebased it. Ready for the next round.

@jacobperron
Copy link
Member

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@jacobperron
Copy link
Member

jacobperron commented Sep 19, 2019

There a Windows warning and looks like the change may have introduced some test failures on Linux and macOS

Deleting the queue size property changes the position
of all properties. Tests which rely on the absolute position
need to be changed, too.
@Martin-Idel
Copy link
Contributor Author

The tests had a simple problem: Removing the queue size property (which was always below the topic property and thus the second property) changes the position of all other properties by one. There are a few tests which actually rely on the position of the property - those are the ones that failed.

So hopefully, that should fix all warnings and test failures (I ran the failing tests locally on Linux and they are fine now).

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM pending CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

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.

Unreliable option for topics
2 participants