def terminate(self): """ Method should be called to destroy the client and will take care of destroying the Environment as well as deleting all circular references. """ if self._environment: self._environment.remote_destroy() assert self._environment is None Endpoint.terminate(self)
def __init__(self, reactor, commPort): """ Initialize the Environment Client. @param reactor: Reference to the twisted reactor used in this robot process. @type reactor: twisted::reactor @param commPort: Port where the server for the cloud engine internal communication will listen for incoming connections. @type commPort: int """ Endpoint.__init__(self, reactor, Loader(), commPort) self._dbFile = '/opt/rce/data/rosenvbridge.db' # TODO: Hardcoded?
def __init__(self, reactor, commPort): """ Initialize the Environment Client. @param reactor: Reference to the twisted reactor used in this robot process. @type reactor: twisted::reactor @param commPort: Port where the server for the cloud engine internal communication will listen for incoming connections. @type commPort: int """ Endpoint.__init__(self, reactor, commPort) self._environment = None
def __init__(self, reactor, masterIP, masterPort, commPort, extIP, extPort, loader, converter): """ Initialize the Robot Client. @param reactor: Reference to the twisted reactor used in this robot process. @type reactor: twisted::reactor @param masterIP: IP address of the Master process. @type masterIP: str @param masterPort: Port which should be used to authenticate the user with the Master process. @type masterPort: int @param commPort: Port where the server for the cloud engine internal communication is listening for incoming connections. @type commPort: int @param extIP: IP address of network interface used for the external communication. @type extIP: str @param extPort: Port where the server for the external communication is listening for WebSocket connections. @type extPort: int @param loader: Object which is used to load Python modules from ROS packages. @type loader: rce.util.loader.Loader @param converter: Converter which takes care of converting the messages from JSON to ROS message and vice versa. @type converter: rce.util.converter.Converter """ Endpoint.__init__(self, reactor, loader, commPort) self._masterIP = masterIP self._masterPort = masterPort self._extAddress = '{0}:{1}'.format(extIP, extPort) self._loader = loader self._converter = converter self._connections = set() self._deathCandidates = {}
def terminate(self): """ Method should be called to terminate the client before the reactor is stopped. @return: Deferred which fires as soon as the client is ready to stop the reactor. @rtype: twisted.internet.defer.Deferred """ for call in self._deathCandidates.itervalues(): call.cancel() self._deathCandidates = {} for connection in self._connections.copy(): connection.destroy() assert len(self._connections) == 0 Endpoint.terminate(self)
def terminate(self): """ Method should be called to terminate the client before the reactor is stopped. @return: Deferred which fires as soon as the client is ready to stop the reactor. @rtype: twisted::Deferred """ self._pendingRobots = {} for call in self._deathCandidates.itervalues(): call.cancel() self._deathCandidates = {} for robot in self._robots.copy(): robot.remote_destroy() assert len(self._robots) == 0 Endpoint.terminate(self)
def __init__(self, reactor, commPort, extIF, extPort, loader, converter): """ Initialize the Robot Client. @param reactor: Reference to the twisted reactor used in this robot process. @type reactor: twisted::reactor @param commPort: Port where the server for the cloud engine internal communication is listening for incoming connections. @type commPort: int @param extIF: Name of network interface used for the external communication. @type extIF: str @param extPort: Port where the server for the external communication is listening for websocket connections. @type extPort: int @param loader: Object which is used to load python modules from ROS packages. @type loader: rce.util.loader.Loader @param converter: Converter which takes care of converting the messages from JSON to ROS message and vice versa. @type converter: rce.util.converter.Converter """ Endpoint.__init__(self, reactor, commPort) self._extAddress = "{0}:{1}".format(getIP(extIF), extPort) self._converter = converter self._loader = loader self._robots = set() self._pendingRobots = {} self._deathCandidates = {}