00001 """autogenerated by genpy from lfd_common/conf_classificationRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import lfd_common.msg
00008
00009 class conf_classificationRequest(genpy.Message):
00010 _md5sum = "811e2bf3307e0acab2b7b6ca059a24c9"
00011 _type = "lfd_common/conf_classificationRequest"
00012 _has_header = False
00013 _full_text = """
00014 state s
00015
00016 ================================================================================
00017 MSG: lfd_common/state
00018 # The state vector
00019 float32[] state_vector
00020
00021 """
00022 __slots__ = ['s']
00023 _slot_types = ['lfd_common/state']
00024
00025 def __init__(self, *args, **kwds):
00026 """
00027 Constructor. Any message fields that are implicitly/explicitly
00028 set to None will be assigned a default value. The recommend
00029 use is keyword arguments as this is more robust to future message
00030 changes. You cannot mix in-order arguments and keyword arguments.
00031
00032 The available fields are:
00033 s
00034
00035 :param args: complete set of field values, in .msg order
00036 :param kwds: use keyword arguments corresponding to message field names
00037 to set specific fields.
00038 """
00039 if args or kwds:
00040 super(conf_classificationRequest, self).__init__(*args, **kwds)
00041
00042 if self.s is None:
00043 self.s = lfd_common.msg.state()
00044 else:
00045 self.s = lfd_common.msg.state()
00046
00047 def _get_types(self):
00048 """
00049 internal API method
00050 """
00051 return self._slot_types
00052
00053 def serialize(self, buff):
00054 """
00055 serialize message into buffer
00056 :param buff: buffer, ``StringIO``
00057 """
00058 try:
00059 length = len(self.s.state_vector)
00060 buff.write(_struct_I.pack(length))
00061 pattern = '<%sf'%length
00062 buff.write(struct.pack(pattern, *self.s.state_vector))
00063 except struct.error as se: self._check_types(se)
00064 except TypeError as te: self._check_types(te)
00065
00066 def deserialize(self, str):
00067 """
00068 unpack serialized message in str into this message instance
00069 :param str: byte array of serialized message, ``str``
00070 """
00071 try:
00072 if self.s is None:
00073 self.s = lfd_common.msg.state()
00074 end = 0
00075 start = end
00076 end += 4
00077 (length,) = _struct_I.unpack(str[start:end])
00078 pattern = '<%sf'%length
00079 start = end
00080 end += struct.calcsize(pattern)
00081 self.s.state_vector = struct.unpack(pattern, str[start:end])
00082 return self
00083 except struct.error as e:
00084 raise genpy.DeserializationError(e)
00085
00086
00087 def serialize_numpy(self, buff, numpy):
00088 """
00089 serialize message with numpy array types into buffer
00090 :param buff: buffer, ``StringIO``
00091 :param numpy: numpy python module
00092 """
00093 try:
00094 length = len(self.s.state_vector)
00095 buff.write(_struct_I.pack(length))
00096 pattern = '<%sf'%length
00097 buff.write(self.s.state_vector.tostring())
00098 except struct.error as se: self._check_types(se)
00099 except TypeError as te: self._check_types(te)
00100
00101 def deserialize_numpy(self, str, numpy):
00102 """
00103 unpack serialized message in str into this message instance using numpy for array types
00104 :param str: byte array of serialized message, ``str``
00105 :param numpy: numpy python module
00106 """
00107 try:
00108 if self.s is None:
00109 self.s = lfd_common.msg.state()
00110 end = 0
00111 start = end
00112 end += 4
00113 (length,) = _struct_I.unpack(str[start:end])
00114 pattern = '<%sf'%length
00115 start = end
00116 end += struct.calcsize(pattern)
00117 self.s.state_vector = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00118 return self
00119 except struct.error as e:
00120 raise genpy.DeserializationError(e)
00121
00122 _struct_I = genpy.struct_I
00123 """autogenerated by genpy from lfd_common/conf_classificationResponse.msg. Do not edit."""
00124 import sys
00125 python3 = True if sys.hexversion > 0x03000000 else False
00126 import genpy
00127 import struct
00128
00129
00130 class conf_classificationResponse(genpy.Message):
00131 _md5sum = "477266dd73ab4e9185e440ed8f395480"
00132 _type = "lfd_common/conf_classificationResponse"
00133 _has_header = False
00134 _full_text = """
00135 float32 c
00136
00137 int32 l
00138
00139 int32 db
00140
00141
00142 """
00143 __slots__ = ['c','l','db']
00144 _slot_types = ['float32','int32','int32']
00145
00146 def __init__(self, *args, **kwds):
00147 """
00148 Constructor. Any message fields that are implicitly/explicitly
00149 set to None will be assigned a default value. The recommend
00150 use is keyword arguments as this is more robust to future message
00151 changes. You cannot mix in-order arguments and keyword arguments.
00152
00153 The available fields are:
00154 c,l,db
00155
00156 :param args: complete set of field values, in .msg order
00157 :param kwds: use keyword arguments corresponding to message field names
00158 to set specific fields.
00159 """
00160 if args or kwds:
00161 super(conf_classificationResponse, self).__init__(*args, **kwds)
00162
00163 if self.c is None:
00164 self.c = 0.
00165 if self.l is None:
00166 self.l = 0
00167 if self.db is None:
00168 self.db = 0
00169 else:
00170 self.c = 0.
00171 self.l = 0
00172 self.db = 0
00173
00174 def _get_types(self):
00175 """
00176 internal API method
00177 """
00178 return self._slot_types
00179
00180 def serialize(self, buff):
00181 """
00182 serialize message into buffer
00183 :param buff: buffer, ``StringIO``
00184 """
00185 try:
00186 _x = self
00187 buff.write(_struct_f2i.pack(_x.c, _x.l, _x.db))
00188 except struct.error as se: self._check_types(se)
00189 except TypeError as te: self._check_types(te)
00190
00191 def deserialize(self, str):
00192 """
00193 unpack serialized message in str into this message instance
00194 :param str: byte array of serialized message, ``str``
00195 """
00196 try:
00197 end = 0
00198 _x = self
00199 start = end
00200 end += 12
00201 (_x.c, _x.l, _x.db,) = _struct_f2i.unpack(str[start:end])
00202 return self
00203 except struct.error as e:
00204 raise genpy.DeserializationError(e)
00205
00206
00207 def serialize_numpy(self, buff, numpy):
00208 """
00209 serialize message with numpy array types into buffer
00210 :param buff: buffer, ``StringIO``
00211 :param numpy: numpy python module
00212 """
00213 try:
00214 _x = self
00215 buff.write(_struct_f2i.pack(_x.c, _x.l, _x.db))
00216 except struct.error as se: self._check_types(se)
00217 except TypeError as te: self._check_types(te)
00218
00219 def deserialize_numpy(self, str, numpy):
00220 """
00221 unpack serialized message in str into this message instance using numpy for array types
00222 :param str: byte array of serialized message, ``str``
00223 :param numpy: numpy python module
00224 """
00225 try:
00226 end = 0
00227 _x = self
00228 start = end
00229 end += 12
00230 (_x.c, _x.l, _x.db,) = _struct_f2i.unpack(str[start:end])
00231 return self
00232 except struct.error as e:
00233 raise genpy.DeserializationError(e)
00234
00235 _struct_I = genpy.struct_I
00236 _struct_f2i = struct.Struct("<f2i")
00237 class conf_classification(object):
00238 _type = 'lfd_common/conf_classification'
00239 _md5sum = 'ff19364d954530b6b4d8e455aa4b7187'
00240 _request_class = conf_classificationRequest
00241 _response_class = conf_classificationResponse