def __init__(self, owner, uid, clsName, addr): _ROSInterfaceBase.__init__(self, owner, uid, clsName, ('TP', addr)) try: pkg, name = package_resource_name(clsName) except ValueError: raise InvalidResoureName('Message type is not valid. Has to be of ' 'the form pkg/msg, i.e. std_msgs/Int8.') self._msgCls = owner.loader.loadMsg(pkg, name)
def __init__(self, owner, uid, clsName, addr): _ROSInterfaceBase.__init__(self, owner, uid, clsName, ('SC', addr)) try: pkg, name = package_resource_name(clsName) except ValueError: raise InvalidResoureName('Service type is not valid. Has to be of ' 'the form pkg/srv, i.e. std_srvs/Empty.') self._srvCls = owner.loader.loadSrv(pkg, name) self._srvCls._request_class = rospy.AnyMsg self._srvCls._response_class = rospy.AnyMsg
def __init__(self, owner, status, uid, clsName, addr): _ROSInterfaceBase.__init__(self, owner, status, uid, clsName, addr) try: pkg, name = package_resource_name(clsName) except ValueError: raise InvalidRequest('Service type is not valid. Has to be of the ' 'form pkg/srv, i.e. std_srvs/Empty.') self._service = None self._pendingLock = Lock() self._pending = {} self._srvCls = owner.loader.loadSrv(pkg, name) self._srvCls._request_class = rospy.AnyMsg self._srvCls._response_class = rospy.AnyMsg
def addCustomConverter(self, converter): """ Register a new custom Converter. @raise: rce.error.InternalError, rce.util.interfaces.InterfaceError """ verifyClass(IROSConverter, converter) if converter.MESSAGE_TYPE in self._customTypes: raise InternalError('There are multiple Converters given for ' 'message type "{0}".'.format( converter.MESSAGE_TYPE)) try: pkg, name = package_resource_name(converter.MESSAGE_TYPE) except ValueError: raise InternalError('msg type is not valid. Has to be of the from ' 'pkg/msg, i.e. std_msgs/Int8.') self._customTypes[converter.MESSAGE_TYPE] = (converter, self._loader.loadMsg(pkg, name))
def addCustomConverter(self, converter): """ Register a new custom Converter. @raise: rce.error.InternalError, rce.util.interfaces.InterfaceError """ verifyClass(ICustomROSConverter, converter) if converter.MESSAGE_TYPE in self._customTypes: raise InternalError('There are multiple Converters given for ' 'message type "{0}".'.format( converter.MESSAGE_TYPE)) try: pkg, name = package_resource_name(converter.MESSAGE_TYPE) except ValueError: raise InternalError('msg type is not valid. Has to be of the from ' 'pkg/msg, i.e. std_msgs/Int8.') self._customTypes[converter.MESSAGE_TYPE] = (converter, self._loader.loadMsg(pkg, name))