multimaster使用

配置说明

一共需要开启2个节点:

  1. fkie_master_discovery
该节点launch文件按照默认配置即可,如下:

  
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    []
    
    
    
    
    
    
  


  1. fkie_master_sync
** 该节点launch文件需要配置sync_topics 和 sync_services。
其中,sync_topics列表中需要写入待接收的话题名字; sync_services列表中需要写入待接收的服务名字。
** 需要注意的是: 如果sync_topics 列表中写了话题名字,参数sync_topics_on_demand设置为true 和 false 都不起作用;
如果sync_topics 列表为空, 表示接收所有master节点的话题;
如果sync_topics 列表为空,  表示屏蔽所有master节点的话题;

报错分析

[WARN] [1679020476.751010]: SyncThread[192.168.2.106] publisherUpdate[/broadcast_state_flag] -> node: http://192.168.2.106:38233/ [/drone_5_ego_planner_node], publisher uris: ['http://192.168.2.102:44241/', 'http://192.168.2.104:46677/', 'http://192.168.2.101:34635/', 'http://192.168.2.106:38233/']: exception=timed out
[ERROR] [1679020497.054794]: SyncThread[192.168.2.106] ERROR: Traceback (most recent call last):
  File "/home/nvidia/work/multimaster/src/multimaster/fkie_master_sync/src/fkie_master_sync/sync_thread.py", line 479, in _check_md5sums
    remote_md5sums_topics = remote_monitor.getTopicsMd5sum(topic_types)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1311, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1459, in send_content
    connection.endheaders(request_body)
  File "/usr/lib/python2.7/httplib.py", line 1095, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 898, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 860, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 837, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
timeout: timed out
分析:该错误【SyncThread[192.168.2.106] publisherUpdate[/broadcast_state_flag] -> node: http://192.168.2.106:38233/ [/drone_5_ego_planner_node]】
表示当前master节点(192.168.2.102)长时间没有和节点(192.168.2.106)通讯。
其中,节点管理器中注册的话题名字是/broadcast_state_flag,发布该话题的节点有: publisher uris: ['http://192.168.2.102:44241/', 'http://192.168.2.104:46677/', 'http://192.168.2.101:34635/', 'http://192.168.2.106:38233/']
测试结果:当节点(192.168.2.106)与 节点(192.168.2.102)恢复通讯后,话题( /broadcast_state_flag)可正常接收。所以,该报错不会导致节点fkie_master_sync死掉。待通讯正常后,一切正常。

你可能感兴趣的:(linux)