Example #1
0
 def __init__(self, pni, msm, error_event):
     self._logger = logging.getLogger(RCMP_LOGGER_NAME)
     # we keep track of the watchdog managed by the platform node instance
     # (only one on the robot side or one for each robot managed by the server
     # on the server side)
     self.wd = {}
     # lock for synchronization around watchdogs
     self.wd_lock = threading.RLock()
     self.pni = pni
     # event tied to the shutdown to stop the watchdogs
     self.pni_error_event = error_event
     self.msm = msm
Example #2
0
 def __init__(self, pni, msm, error_event):
     self._logger = logging.getLogger(RCMP_LOGGER_NAME)
     # we keep track of the watchdog managed by the platform node instance
     # (only one on the robot side or one for each robot managed by the server
     # on the server side)
     self.wd = {}
     # lock for synchronization around watchdogs
     self.wd_lock = threading.RLock()
     self.pni = pni
     # event tied to the shutdown to stop the watchdogs
     self.pni_error_event = error_event
     self.msm = msm
Example #3
0
 def __init__(self, pni, dispatcher, stop_event, error_event, paired_node_name=None, paired_node_ip=None):
     threading.Thread.__init__(self)
     self._logger = logging.getLogger(RCMP_LOGGER_NAME)
     self.pni = pni
     self.stop_event = stop_event
     # this is used to notify to the platform node that something went wrong and
     # it has to restart its main daemon loop
     self.error_event = error_event
     self.paired_node_name = paired_node_name
     self.paired_node_ip = paired_node_ip
     self._logger.debug("Watchdog paired_node_name = %s, paired_node_ip = %s" % (paired_node_name, paired_node_ip))
     self.name = "WDog_%s_%s" % (self.pni[RCMPlatformNode.PNI_NAME], paired_node_name)
     self.dispatcher = dispatcher
Example #4
0
 def __init__(self, rs_queue, es_queue, port=DEFAULT_DRIVER_PORT):
     self._connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self._driver_address = (self.DEFAULT_DRIVER_ADDRESS, port)
     self._buf_size = 1024
     # in milliseconds
     self._timeout = 5000
     # we get a polling object
     self._po = select.poll()
     # register the server on read only events
     self._po.register(self._connection, self.READ_WRITE)
     # map file descriptors to socket objects
     self._fd_to_socket = {self._connection.fileno(): self._connection}
     self._rs_queue = rs_queue
     self._es_queue = es_queue
     self._logger = logging.getLogger(RCMP_LOGGER_NAME)
Example #5
0
 def __init__(self, rs_queue, es_queue, port=DEFAULT_DRIVER_PORT):
     self._connection = socket.socket(socket.AF_INET,
                                      socket.SOCK_STREAM)
     self._driver_address = (self.DEFAULT_DRIVER_ADDRESS, port)
     self._buf_size = 1024
     # in milliseconds
     self._timeout = 5000
     # we get a polling object
     self._po = select.poll()
     # register the server on read only events
     self._po.register(self._connection, self.READ_WRITE)
     # map file descriptors to socket objects
     self._fd_to_socket = {self._connection.fileno(): self._connection}
     self._rs_queue = rs_queue
     self._es_queue = es_queue
     self._logger = logging.getLogger(RCMP_LOGGER_NAME)
Example #6
0
 def __init__(self,
              pni,
              dispatcher,
              stop_event,
              error_event,
              paired_node_name=None,
              paired_node_ip=None):
     threading.Thread.__init__(self)
     self._logger = logging.getLogger(RCMP_LOGGER_NAME)
     self.pni = pni
     self.stop_event = stop_event
     # this is used to notify to the platform node that something went wrong and
     # it has to restart its main daemon loop
     self.error_event = error_event
     self.paired_node_name = paired_node_name
     self.paired_node_ip = paired_node_ip
     self._logger.debug(
         "Watchdog paired_node_name = %s, paired_node_ip = %s" %
         (paired_node_name, paired_node_ip))
     self.name = "WDog_%s_%s" % (self.pni[RCMPlatformNode.PNI_NAME],
                                 paired_node_name)
     self.dispatcher = dispatcher