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

Prevent rosbridge buffering unsent messages

asked 2018-06-22 10:07:17 -0600

h66 gravatar image

updated 2018-07-03 12:54:44 -0600


I'm using rosbridge to send usb_cam images from a ROS setup in Linux to a computer running the ROSSharp package. I'm performing several network tests, reducing bandwidth and increasing network errors to simulate a slow/bad internet connection, for example.

We perceive that somehow the image frames that were not sent due network problems from the Linux host are "buffered" at the rosbridge package and then sent when the network is fast again. It seems that rosbridge is buffering all messages, as we can see an important increase in memory with the process.

Is there a way to stop buffering unsent messages with the rosbridge package? For example, drop messages older than 2 seconds at the queue? I didn't find any info about this at the docs.

The docs have something related to "throttle_rate" and "queue_length" ( ) when client initiate a subscriber connection, but after messing around with those parameters I didn't see any improvement with the buffering of messages at the server.

I'm using Ros Kinetic with Ubuntu 16.04.


edit retag flag offensive close merge delete


Just a note: the official repository for rosbridge_suite is RobotWebTools/rosbridge_suite, not the one you link.

gvdhoorn gravatar image gvdhoorn  ( 2018-06-22 15:11:34 -0600 )edit

You can trying adding a queue_size argument to the Subscriber constructed in the rosbridge_library. The change needs to be made at .

kartikmohta gravatar image kartikmohta  ( 2018-06-22 22:19:21 -0600 )edit

@gvdhoorn Thanks! Just updated the link.

h66 gravatar image h66  ( 2018-07-03 12:54:59 -0600 )edit

@kartikmohta, I just manually set the queue_size to 1 at the rosbridge source but still has some buffering issues. There must be other parameters to define!

h66 gravatar image h66  ( 2018-07-03 12:56:16 -0600 )edit

oh man... having this issue since a few days. Didn't find any solution yet. Also tried to reduce the queue_size and queue_length on the subscriber side

var listener = new ROSLIB.Topic({...queue_size:1,queue_length:1 ...})

mojovski gravatar image mojovski  ( 2018-08-29 09:18:11 -0600 )edit

Also having this issue. Has the problem been solved by anyone?

JeffHu7 gravatar image JeffHu7  ( 2019-02-12 18:12:46 -0600 )edit

I'm experiencing a similar issue with too many pointclouds getting buffered. I'd love for it to throw out the data if the network is still uploading. Is it the socket itself that's storing up all the data to be transmitted or is the rosbridge hanging on to it all and sending when free?

CodeMonkey gravatar image CodeMonkey  ( 2019-02-22 14:40:43 -0600 )edit

Has any progress been made on this?

kosmastsk gravatar image kosmastsk  ( 2021-04-03 08:06:22 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-10-07 23:57:41 -0600

hmeng29 gravatar image

Isn't it just because of the nature of the TCP protocol (on which rosbridge is based)? It will ensure that your data is sent with a built-in re-try mechanism. If your goal is to keep the video/image data running and allow frame drops, you may want to consider implementing a proxy server to send your raw/compressed image over a UDP protocol-based socket and do other stuff from there.

edit flag offensive delete link more

Question Tools



Asked: 2018-06-22 10:07:17 -0600

Seen: 1,529 times

Last updated: Oct 07 '22