Bad performance of ROS2 via Wifi
I have a simple setup with a laptop on a mobile robot (Foxy) from which I only want to stream data from a laserscanner to a stationary computer that has a wifi dongle. If I only open the scanner on the laptop, I get around 30Hz but If I also subscribe on the workstation, this frequency drops to 20Hz (on the laptop!) and I only get 2-3 Hz on the workstation (always a small burst of messages every 5 seconds).
Streaming a laser scanner really shouldn't be an issue and a slow or unreliable connection to a new subscriber shouldn't decrease the local performance. Reliability is on Best_effort, Durability Volatile.
I'm using the default DDS, are there any settings I have to change?
Asked by NEngelhard on 2020-09-22 05:29:53 UTC
Answers
I ran some experiments and I think the problem was the Wifi-Dongle on the workstation. I moved the Laptop into a different wifi that is connected to the Lan and after that, the workstation received all sensor data flawlessly.
But that still does not explain why the performance degraded on the Laptop as soon as a subscriber over wifi was started.
Asked by NEngelhard on 2020-09-23 10:02:56 UTC
Comments
https://en.wikipedia.org/wiki/Hidden_node_problem
It's quite easy for the WIFI later to collapse if you start to pump data down it. There lots of things you can do to optomise WIFI, however the less things you have on WIFI the better... how much data are you pumping over WIFI?
Asked by l33 on 2020-10-03 13:36:31 UTC
I only have the laser data on the wifi, which is around 500kB/s
Asked by NEngelhard on 2020-10-06 09:54:16 UTC
Similar issues https://answers.ros.org/question/401891/wifi-connection-issues-with-ros-2-and-humble. It seems setting wifi power management improved overall wifi performance, but I still have more testing to do before I confirm answer there
Asked by dcconner on 2022-06-07 16:39:28 UTC
Comments
Possibly related: ROS2 Default Behavior (Wifi).
I've seen suggestions to use Cyclone DDS, but also reports that newer versions of FastRTPS should fix this.
Asked by gvdhoorn on 2020-09-22 05:57:25 UTC
If you have time I would appreciate it if you reported your experience in our Foxy RMW survey.
Asked by kscottz on 2020-09-22 13:05:00 UTC
I have this same problem and just tried Cyclone DDS, but it shows the same results. What bothers me most is that the local rate on the computer on the mobile robot also decreases. This makes monitoring using rviz kind of risky, because it lowers the rate at which control happens on the mobile robot...
Asked by Mbuijs on 2020-09-23 03:54:17 UTC
I would suggest to post a comment on the Discourse thread (in addition to the survey @kscottz linked), as that is currently the central place for these types of reports to get noticed.
Asked by gvdhoorn on 2020-09-23 03:57:27 UTC