Example #1
0
 def __init__(self):
     self.__metadata_storage = MetadataStorage()
     self.__specification_handler = SpecificationHandler()
     self.__publisher = rospy.Publisher('/statistics_rated',
                                        arni_msgs.msg.RatedStatistics,
                                        queue_size=50)
     self.__master_api_publisher = rospy.Publisher('/statistics_master',
                                                   arni_msgs.msg.MasterApi,
                                                   queue_size=10)
     self.__pub_queue = []
     self.__master_api_queue = []
     self.__aggregate = []
     self.__aggregation_window = rospy.get_param("~aggregation_window", 3)
     self.__aggregate_start = rospy.Time.now()
     self.__processing_enabled = rospy.get_param("/enable_statistics",
                                                 False)
     self.__alive_timers = {}
     self.__alive_countdown = {}
     rospy.Timer(rospy.Duration(rospy.get_param("~publish_interval", 5)),
                 self.__publish_queue)
     rospy.Timer(rospy.Duration(rospy.get_param("~alive_interval", 5)),
                 self.__check_alive)
     rospy.Timer(
         rospy.Duration(rospy.get_param("~master_api_publish_interval", 1)),
         self.__pollMasterAPI)
     rospy.Timer(
         rospy.Duration(rospy.get_param("/arni/check_enabled_interval",
                                        10)), self.__update_enabled)