fkie / multimaster_fkie

ROS stack with FKIE packages for multi-robot (discovering, synchronizing and management GUI)
BSD 3-Clause "New" or "Revised" License
272 stars 106 forks source link

Connection goes unstable when the number of ros-master increases #147

Closed han-kyung-min closed 3 years ago

han-kyung-min commented 3 years ago

I am trying to sync multiple ros-masters running on a single PC. Everything seems OK when the number of ros-masters are limited to 3. However, when I add the 4th ros-master followed by running "master_discovery" and "master_sync".

My system crashes with the error message below:

[ERROR] [1607409212.189753, 0.000000]: SyncThread[retina_11314] ERROR: Traceback (most recent call last): File "/home/hankm/catkin_ws/src/multimaster/fkie_master_sync/src/fkie_master_sync/sync_thread.py", line 275, in _request_remote_state remote_state = remote_monitor.masterInfo() File "/usr/lib/python3.8/xmlrpc/client.py", line 1109, in call return self.send(self.name, args) File "/usr/lib/python3.8/xmlrpc/client.py", line 1450, in request response = self.transport.request( File "/usr/lib/python3.8/xmlrpc/client.py", line 1153, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python3.8/xmlrpc/client.py", line 1165, in single_request http_conn = self.send_request(host, handler, request_body, verbose) File "/usr/lib/python3.8/xmlrpc/client.py", line 1278, in send_request self.send_content(connection, request_body) File "/usr/lib/python3.8/xmlrpc/client.py", line 1308, in send_content connection.endheaders(request_body) File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output self.send(msg) File "/usr/lib/python3.8/http/client.py", line 950, in send self.connect() File "/usr/lib/python3.8/http/client.py", line 921, in connect self.sock = self._create_connection( File "/usr/lib/python3.8/socket.py", line 808, in create_connection raise err File "/usr/lib/python3.8/socket.py", line 796, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

Besides, ros-masters at other terminals often prints "WARN" message of "Error while start RPC-XML server on port 11613: [Errno 98] Address already in use", then freezes the corresponding simulator for a while.

Could you please give me a piece of advice to address this issue ?

Best,

atiderko commented 3 years ago

It seems the ROS_MASTER_URI is not set properly in terminal where "master_discovery" and "master_sync" are started. Each time you see "Error while start RPC-XML server on port 11613: [Errno 98] Address already in use" the master_discovery node is stopped.

Please try to start the discovery and sync using node_manager, see image below Screenshot_2020-12-08_13-35-39