def registerByROS(self, masteruri, wait=False): ''' This method creates a ROS subscriber to received the notifications of connection updates. The retrieved messages will be emitted as stats_signal. @param masteruri: the ROS master URI @type masteruri: str @param wait: wait for the topic @type wait: boolean ''' found = False self.stop() self.sub_stats = [] topic_names = interface_finder.get_stats_topic(masteruri, wait) for topic_name in topic_names: rospy.loginfo("listen for connection statistics on %s", topic_name) sub_stats = rospy.Subscriber(topic_name, LinkStatesStamped, self.handlerMasterStatsMsg) self.sub_stats.append(sub_stats) found = True return found