roslibjs icon indicating copy to clipboard operation
roslibjs copied to clipboard

Ros.js cannot handle very large messages

Open rctoris opened this issue 12 years ago • 5 comments

Migrated from https://github.com/RobotWebTools/rosjs/issues/27

@baalexander :

Very large messages, like some point cloud streams, cause the browser to freeze. This was originally reported by @jihoonl, who emailed me example code to reproduce (I uploaded it here, but haven't checked it out yet).

If the issue is blocking the main thread, one thing could be using webworkers to process the messages. Still need to investigate.

rctoris avatar Apr 15 '13 00:04 rctoris

Web Worker

Migrated from https://github.com/RobotWebTools/roslibjs/issues/34

@rctoris :

@jihoonl :
Web worker allows to have use background thread in the browser.
It may help to keep the interface responsive while it receives the high volume of data from socket.

@rctoris :
Could address things like https://github.com/RobotWebTools/map2djs/issues/5

rctoris avatar Apr 15 '13 01:04 rctoris

The link to original example https://github.com/downloads/RobotWebTools/rosjs/example.tar.gz. It doesn't have a data bag with :( I'll have to generate a large point cloud to reproduce.

syrnick avatar Jul 11 '14 19:07 syrnick

Thought I'd add further insight on this issue. It appears that the ROS.Topic.subscribe code does not implement queue_size on the client side, so data piles up if the listener function can't process data as quickly as it comes it. I implemented a workaround to provide a queue size of 1 by using a separate display "thread" to process the data, leaving the listener.subscribe function to just copy the latest message to a globally shared variable and exit. The display thread is set up using the setInterval() call.

I don't know if I should report the queue_size problem as a separate issue or not, but the fact that queue_size is a parameter to ROSLIB.Topic but not used makes it seem like a good candidate.

btwolfe avatar Nov 04 '14 21:11 btwolfe

related: https://github.com/RobotWebTools/rosbridge_suite/pull/190

rctoris avatar Jul 07 '15 12:07 rctoris