ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Is there a way to throttle publisher rate in ROS2?

asked 2022-01-19 20:41:24 -0600

lexi gravatar image

I have video topics that are being published over a network, but some of the subscribers to the video topics are also local. I'd like to have local subscribers get data as often as possible, but have remote subscribers be able to specify the rate they would like to receive data. Something like being able to pass a rate in hz when you subscribe and then the throttling gets done on the publisher side so that network traffic is limited. Is there a way to do this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-01-20 03:25:13 -0600

gvdhoorn gravatar image

updated 2022-01-20 03:29:56 -0600

No, this is currently not supported.

DDS (ie: the default middleware for ROS 2) does support specifying such conditions/configuration, but this is currently not exposed in ROS 2.

What you could potentially do is create a "sub sampled" or "throttled" topic, and have your remote subscribers subscribe to that topic instead of the regular one. You could use the topic_tools/throttle node to create such a topic. The throttle would run on the publishers "side" of course (ie: on the same machine as where the publisher runs).

Note: you should not need to change any code on the subscriber side (in your remote subscribers). A simple remap for the remote subscribers should suffice (as the topic type does not change).

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-01-19 20:41:24 -0600

Seen: 933 times

Last updated: Jan 20 '22