Prevent rosbridge buffering unsent messages
Hi,
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 "throttlerate" and "queuelength" (https://github.com/RobotWebTools/rosbridge_suite/blob/develop/ROSBRIDGE_PROTOCOL.md) 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.
Thanks!
Asked by h66 on 2018-06-22 10:07:17 UTC
Answers
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.
Asked by hmeng29 on 2022-10-07 23:57:41 UTC
Comments
Just a note: the official repository for
rosbridge_suite
is RobotWebTools/rosbridge_suite, not the one you link.Asked by gvdhoorn on 2018-06-22 15:11:34 UTC
You can trying adding a
queue_size
argument to theSubscriber
constructed in the rosbridge_library. The change needs to be made at https://github.com/RobotWebTools/rosbridge_suite/blob/21868a3732a400e39d39cbd29c9f9b60f2e21a49/rosbridge_library/src/rosbridge_library/internal/subscribers.py#L93.Asked by kartikmohta on 2018-06-22 22:19:21 UTC
@gvdhoorn Thanks! Just updated the link.
Asked by h66 on 2018-07-03 12:54:59 UTC
@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!
Asked by h66 on 2018-07-03 12:56:16 UTC
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 ...})
Asked by mojovski on 2018-08-29 09:18:11 UTC
Also having this issue. Has the problem been solved by anyone?
Asked by JeffHu7 on 2019-02-12 19:12:46 UTC
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?
Asked by CodeMonkey on 2019-02-22 15:40:43 UTC
Has any progress been made on this?
Asked by kosmastsk on 2021-04-03 08:06:22 UTC
Same problem here. Anyone get something yet?
Asked by Bender_From_Futurama on 2021-09-16 04:14:03 UTC
Also interested
Asked by Bender_From_Futurama on 2021-09-16 04:22:47 UTC
I don't think we ever did resolve this. We simply started sending less data until it was no longer a problem. :-\
Asked by CodeMonkey on 2021-09-16 06:45:33 UTC
Also encountering this problem, any news / solution on it?
Asked by cantolini on 2022-07-27 09:19:30 UTC