Increase ros2 web bridge buffer size, possible?

asked 2020-05-23 09:18:27 -0500

dr563105 gravatar image

updated 2020-05-23 09:19:35 -0500

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?

Thank you for your help.

edit retag flag offensive close merge delete

Comments

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..?

flo gravatar image flo  ( 2020-05-23 10:11:12 -0500 )edit

Thank you. I was aware of sensor_msgs/compressed as LGSVL simulator itself transport it but not the underlying functionality behind it. I'm still seeing if directly using pub/sub methods will help me in the next weeks. My project's objective was to use ros2 and now since certain repos are not upto speed, I might have to use ros1_bridge after all. I don't know if I will time to contribute to the ros2 project. I will look into it.

dr563105 gravatar image dr563105  ( 2020-05-26 00:51:30 -0500 )edit