# Increase ros2 web bridge buffer size, possible?

Hello!

I use a simulator from LGSVL team which publishes compressed images from 3 camera nodes(default 15Hz) and control messages from a control topic. The simulator publishes images at 8-10 Hz and the control messages at 100 Hz. So almost 10 times the camera images through ros2 web bridge. This obviously creates a bottleneck in the collector node.

To avoid arrival mismatch I use approx time sync class from the ros2_message_filters. It carries arguments for queue size and slop. I adjusted them to 100 and 0.1.

ts = message_filters.ApproximateTimeSynchronizer([sub_center_camera, sub_left_camera, sub_right_camera, sub_control], 100, 0.1)

ts.registerCallback(self.callback)

In the callback I save the images and control messages in a CSV file. As mentioned above, because of the bottleneck at the receiving end, only about 5 entries get entered in the CSV file. My target is 100,000 data entries and corresponding images. At that rate, I would need to drive for around for more than 6 hours to achieve the target. No change occurs even if I change the camera node frequency greater than 15Hz.

As the problem is with ros2 web bridge, I would like to know how to increase the buffer size of it. Note that I'm running both simulator and the collection node on the same Ubuntu Linux pc.

So does anyone know how to increase the buffer of ros2 web bridge or know an alternate solution?

It seems they have porting the png crompressionfor the ros2 version of the ros2_web_bridge on their roadmap. See here: https://github.com/RobotWebTools/ros2... You can contribute to this. But if you are running the simulation on the exact same machine, why are you not using "bare-bone" ros(2) communication methods, like pub/sub, instead of adding ros2-web-bridge? Image_transport from the image_comm repo is not already up to speed(ros2 support): https://discourse.ros.org/t/image-tra... But maybe you can integrate it via a ros1_bridge..?