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

Topic Latching - QoS Profiles for Subscribers #134

Open
mikelyndersOKCC opened this issue Feb 27, 2020 · 1 comment
Open

Topic Latching - QoS Profiles for Subscribers #134

mikelyndersOKCC opened this issue Feb 27, 2020 · 1 comment

Comments

@mikelyndersOKCC
Copy link

mikelyndersOKCC commented Feb 27, 2020

I am trying to achieve a latching topic through the ros2-web-bridge.

In ROS1 there was a publisher option called latching:

When a connection is latched, the last message published is saved and automatically sent to any future subscribers that connect. This is useful for slow-changing to static data like a map.

This behavior would be very useful for web interfaces where topic driven data might be un-populated when the user first loads or refreshes the page, and remains un-populated until a new message is published.

In ROS2, the behavior can be achieved by using QoS profiles as described here. The trick is to have both the publisher and subscriber use the "transient local" profile. I have achieved this between two rclpy nodes and the latching behavior works. However, this behavior does not seem to work between roslibjs, ros2-web-bridge, and a "transient local" rclpy publisher. I think this is because ros2-web-bridge uses the default QoS policy where the durability is "volatile".

It seems that rclnodejs supports QoS profiles as seen here.

roslibjs does not provide a method to set the QoS policy because the rosbridge v2 protocol does not have a specification for it as someone pointed out in this issue.

I could see two ways of supporting QoS profiles other than the default in ros2-web-bridge:

  • Providing a configuration file or command line argument for overriding the default QoS profile of the ros2-web-bridge
  • Adding to section 3.4.4 of the rosbridge v2 protocol to include an optional "qos_profile" field. Then changes could be made to ros2-web-bridge to support QoS profiles on a per subscriber/publisher basis.
@minggangw
Copy link
Member

I think the first solution, adding an additional arg, is more feasible because rosbridge v2 protocol is not designed for ROS2 specifically. Of course, the ideal way is that it can be supported by the rosbridge protocol, then each connection could customize its own QoS profile.

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

No branches or pull requests

2 participants