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