[Solved] Data transfer delay when running two ROSbot 2.0

Hello,

I am trying to control two ROSbot 2.0 to visit some waypoints while streaming images simultaneously.

For each ROSbot, I connect it to a laptop to receive image and robot pose data.

The data transfer between the ROSbot and the laptop is smooth when only one ROSbot is in the LAN. Whenever the second ROSbot enters the LAN, the data transfer immediately becomes very slow, meaning that there exists a huge delay in the images that I receive on the laptop.

Is there a way to reduce the time delay when two robots are in the LAN?

Thank you!

Hi ldjyl

Unfortunately, the issue is mostly related to your router bandwidth. You can either try reducing the size of the streamed image or try a different wifi router. ROSbot 2.0 hardware is supporting only 2.4 GHz wifi, so there is also a huge bottleneck on bandwidth.

I would suggest experimenting with different router or potentially using an external 5.0 GHz wifi card. The second option I will suggest as a last resort, since compiling and testing the drivers might be extremely time-consuming and might even end up being complete failure.

Best regards,
Krzysztof Wojciechowski.

HI Krzysztof,

Thank you very much for replying to my question!
I have tried using different routers with higher bandwidth, which does not seems to improve the speed of image transfer. I will try reducing the image size as a next step.
I have two follow-up questions:

  1. My team was thinking to use a dual antenna adaptor so we can add another antenna to the ROSbot. Do you think that will help increasing the speed of data transfer? (by the way, we are using wifi to connect a Rosbot and a laptop)
  2. The reason we need image data is to run some object detection algorithm. Do you think it will be better if we run the algorithm on the ROSbot and then only transfer the detection result rather than the entire image? Then, another question will be, do you know whether the ROSbot hardware can support the running of a deep neural network such as MaskRCNN?

Any of your feedback will be greatly appreciated!

In terms of bandwidth, I am not sure if bigger/more antennas will help. Probably you are running into limitations of 2.4 GHz wifi network. Presence of a laptop most likely won’t change anything here since most likely it is connected to the 5 GHz network (assuming the laptop is at max 4 years old).

You can try reducing the image to fit neural network input on the ROSbot. You can also try transferring the image with sensor_msgs/CompressedImage instead sensor_msgs/Image. This should reduce the amount of data being transferred.

Running the whole code on ROSbot might end up being painful. It might work, but probably you would have to compress the model and export it to C++ to make it work on this hardware. If the goal is to achieve more than 5 FPS it might be challenging.

Personally, I would first try resizing the image to fit the neural network input, then use a compressed message and see if it improved. If the problem is still present I would go with external usb wifi card. I guess it will be still way faster to make the external wifi work on the TinkerBoard than rewriting the code to C++ and compressing the network.

Best regards,
Krzysztof Wojciechowski.

Hi Krzysztof_Woj,

I have a follow up question on this thread.
We have changed to a much better router ( ASUS ROG Rapture WiFi 6 Gaming Router (GT-AX11000)), but it does not improve the data transfer speed at all.
Whenever a second robot connects to the same router, the images transfer speed of both robots (the second robot and the one that is previously connected to the router) become extremely slow.

I don’t understand why adding a second robot (each robot connects to a different laptop that are also connected to the same router) will affect the image transfer that much.

Could you provide any insight on what can be the reason?

Previously, we connected a ROSBot and a DJI Drone to the same router, and they do not affect each other at all.

Thank you very much!

Hi ldjyl.

Sorry for late response. My only guess is that both robots have to share the same frequency at 2.4 GHz and the time domain on data transfer is shattered between both of them so much they loose connection. The DJI drone on the other hand most likely is connecting to the second available frequency, which is 5.0 GHz. I might be wrong, but I tried to find some information about which frequency is used in their drones, and it seems like Mavic Drones and their ROS enabled ones are indeed using 5.0 GHz WiFi.

I guess we are left with the 5.0 GHz WiFi adapter and so you already opened questions about that, let’s move on to those topics. I will test if I will succeed in building the kernel driver for WiFi adapters we have at our office in few days. This will give us a baseline for making your working.

Best regards,
Krzysztof Wojciechowski.

HI Krzysztof,

Thank you so much for your reply!
The information you provided is very helpful. I look forward to hearing from you about the test with 5.0 GHz wifi adaptor.

Hi ldjyl.

I tried to build the kernel driver for two 5.0 GHz WiFi USB adapters and both failed with unclear error messages. As I expected, it might end up being time consuming. Before considering building that driver, I will also make sure to fully reproduce your case with two robots, so I will be able to identify problems I might have missed previously.

Best regards,
Krzysztof Wojciechowski.