ROS communication between both machines slow in router with out internet connection
Hi, I’m running
- Ros Kinetic under Ubuntu 16.04. The IP address are: 192.168.1.101 (master) on RPi4 - Robot
- Ros noetic, ubuntu 20.04, slave on my labtop 192.168.1.102 ,
Both are connected to the same router. I run turtlebot3_slam on the slave-labtop to read lidar data from master-rpi4. All computation task do on labtop. With internet connect to router, The ROS communication between both machines works great , I could run turtlebot3 navigation and slam on slave-labtop with lidar data from master-rpi4.
With no internet connection, the ping command responses slow from both sides and I could not run navigation or slam because slow responde data from lidar. Has anyone encountered this problem?
- Edited:
For example: rostopic echo /scan
With internet: It took 1s to show /scan data.
Without internet: It take 20 s to setup connect and get /scan info.
After lidar /scan data show, ping rate is similar. I thought the problem here, It took alot of time to set direct connecttion between publisher (Rpi4) and subscriber (labtop) when without internet. .
Thanh you aarsh_t ,I have tried to diffirent wifi router, set rosmaster on Labtop, same problem happen.
I have tried google search but could not find solution. I tried use multimaster but It does not improve Ros communication on router without internet. http://wiki.ros.org/multimaster_fkie/...
Some topic i have found: http://wiki.ros.org/ROS/Tutorials/Mul... https://answers.ros.org/question/3791... https://answers.ros.org/question/2187...
On the second question you posted, Redhwan posted an answer to address your question. I suggest trying that and commenting on that answer if something goes wrong.
It's possible this has to do with DNS timeouts.
Make sure you can either resolve all hostnames to their IP addresses without relying on your router, or don't use hostnames at all (by setting
ROS_IP
andROS_MASTER_URI
to IPs, instead of hostnames).I'd recommend to use Wireshark to check what's going on in case of the slowdowns you observe.
I'd also recommend to stay away from more complicated setups -- which
multimaster_fkie
definitely is -- until you've figured out the cause of your problem, as adding more complexity typically does not help solving a problem like this.I do not think this can be the case. Try using different router or try connecting both via LAN for testing. I think upto 30-40ms of lag should be okay on wifi.
Try to setup the current time and update the RPi on robot.
Have you given thought that it might be due to the different versions of the ROS? I had somewhat similar issue and it got solved when I used similar version of ROS on both rosmaster and rosnode on PC.
One more thing I can think of is, Use your PC as rosmaster instead RPi, ssh to the Rpi and run nodes over there.
Just to set this straight, as I keep seeing the terminology used here on ROS Answers:
ROS is a peer-to-peer framework. By definition all nodes are equal.
There are no slaves, nor masters.
The ROS master only functions as DNS server. It is not directly involved in communication between nodes.
Haha yes, I should stop using it.
I did not suggest any of these things.
What is the ping rate with and without the internet connection? try to ping RPi from laptop terminal using
ping IP_OF_RPi
Dear, aarsh_t , For example: rostopic echo /scan
With internet: It took 1s to get info. Without internet: It take 20 s to setup connect and get /scan info. After lidar /scan data show, ping rate is similar . I thought the problem here, It took alot of time to set direct connecttion between publisher (Rpi4) and subscriber (labtop) when without internet.