00001 """autogenerated by genpy from household_objects_database_msgs/GetModelDescriptionRequest.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 GetModelDescriptionRequest(genpy.Message):
00009 _md5sum = "28cb0598daf3b969068a38cd07aaa9f6"
00010 _type = "household_objects_database_msgs/GetModelDescriptionRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014
00015 int32 model_id
00016
00017
00018 """
00019 __slots__ = ['model_id']
00020 _slot_types = ['int32']
00021
00022 def __init__(self, *args, **kwds):
00023 """
00024 Constructor. Any message fields that are implicitly/explicitly
00025 set to None will be assigned a default value. The recommend
00026 use is keyword arguments as this is more robust to future message
00027 changes. You cannot mix in-order arguments and keyword arguments.
00028
00029 The available fields are:
00030 model_id
00031
00032 :param args: complete set of field values, in .msg order
00033 :param kwds: use keyword arguments corresponding to message field names
00034 to set specific fields.
00035 """
00036 if args or kwds:
00037 super(GetModelDescriptionRequest, self).__init__(*args, **kwds)
00038
00039 if self.model_id is None:
00040 self.model_id = 0
00041 else:
00042 self.model_id = 0
00043
00044 def _get_types(self):
00045 """
00046 internal API method
00047 """
00048 return self._slot_types
00049
00050 def serialize(self, buff):
00051 """
00052 serialize message into buffer
00053 :param buff: buffer, ``StringIO``
00054 """
00055 try:
00056 buff.write(_struct_i.pack(self.model_id))
00057 except struct.error as se: self._check_types(se)
00058 except TypeError as te: self._check_types(te)
00059
00060 def deserialize(self, str):
00061 """
00062 unpack serialized message in str into this message instance
00063 :param str: byte array of serialized message, ``str``
00064 """
00065 try:
00066 end = 0
00067 start = end
00068 end += 4
00069 (self.model_id,) = _struct_i.unpack(str[start:end])
00070 return self
00071 except struct.error as e:
00072 raise genpy.DeserializationError(e)
00073
00074
00075 def serialize_numpy(self, buff, numpy):
00076 """
00077 serialize message with numpy array types into buffer
00078 :param buff: buffer, ``StringIO``
00079 :param numpy: numpy python module
00080 """
00081 try:
00082 buff.write(_struct_i.pack(self.model_id))
00083 except struct.error as se: self._check_types(se)
00084 except TypeError as te: self._check_types(te)
00085
00086 def deserialize_numpy(self, str, numpy):
00087 """
00088 unpack serialized message in str into this message instance using numpy for array types
00089 :param str: byte array of serialized message, ``str``
00090 :param numpy: numpy python module
00091 """
00092 try:
00093 end = 0
00094 start = end
00095 end += 4
00096 (self.model_id,) = _struct_i.unpack(str[start:end])
00097 return self
00098 except struct.error as e:
00099 raise genpy.DeserializationError(e)
00100
00101 _struct_I = genpy.struct_I
00102 _struct_i = struct.Struct("<i")
00103 """autogenerated by genpy from household_objects_database_msgs/GetModelDescriptionResponse.msg. Do not edit."""
00104 import sys
00105 python3 = True if sys.hexversion > 0x03000000 else False
00106 import genpy
00107 import struct
00108
00109 import household_objects_database_msgs.msg
00110
00111 class GetModelDescriptionResponse(genpy.Message):
00112 _md5sum = "e6c55e34b143695104d37ad9b33c72c0"
00113 _type = "household_objects_database_msgs/GetModelDescriptionResponse"
00114 _has_header = False
00115 _full_text = """
00116
00117 DatabaseReturnCode return_code
00118
00119
00120 string[] tags
00121
00122
00123 string name
00124
00125
00126 string maker
00127
00128
00129
00130 ================================================================================
00131 MSG: household_objects_database_msgs/DatabaseReturnCode
00132 # return codes for database-related services
00133
00134 int32 UNKNOWN_ERROR = 1
00135 int32 DATABASE_NOT_CONNECTED = 2
00136 int32 DATABASE_QUERY_ERROR = 3
00137 int32 SUCCESS = -1
00138
00139 int32 code
00140 """
00141 __slots__ = ['return_code','tags','name','maker']
00142 _slot_types = ['household_objects_database_msgs/DatabaseReturnCode','string[]','string','string']
00143
00144 def __init__(self, *args, **kwds):
00145 """
00146 Constructor. Any message fields that are implicitly/explicitly
00147 set to None will be assigned a default value. The recommend
00148 use is keyword arguments as this is more robust to future message
00149 changes. You cannot mix in-order arguments and keyword arguments.
00150
00151 The available fields are:
00152 return_code,tags,name,maker
00153
00154 :param args: complete set of field values, in .msg order
00155 :param kwds: use keyword arguments corresponding to message field names
00156 to set specific fields.
00157 """
00158 if args or kwds:
00159 super(GetModelDescriptionResponse, self).__init__(*args, **kwds)
00160
00161 if self.return_code is None:
00162 self.return_code = household_objects_database_msgs.msg.DatabaseReturnCode()
00163 if self.tags is None:
00164 self.tags = []
00165 if self.name is None:
00166 self.name = ''
00167 if self.maker is None:
00168 self.maker = ''
00169 else:
00170 self.return_code = household_objects_database_msgs.msg.DatabaseReturnCode()
00171 self.tags = []
00172 self.name = ''
00173 self.maker = ''
00174
00175 def _get_types(self):
00176 """
00177 internal API method
00178 """
00179 return self._slot_types
00180
00181 def serialize(self, buff):
00182 """
00183 serialize message into buffer
00184 :param buff: buffer, ``StringIO``
00185 """
00186 try:
00187 buff.write(_struct_i.pack(self.return_code.code))
00188 length = len(self.tags)
00189 buff.write(_struct_I.pack(length))
00190 for val1 in self.tags:
00191 length = len(val1)
00192 if python3 or type(val1) == unicode:
00193 val1 = val1.encode('utf-8')
00194 length = len(val1)
00195 buff.write(struct.pack('<I%ss'%length, length, val1))
00196 _x = self.name
00197 length = len(_x)
00198 if python3 or type(_x) == unicode:
00199 _x = _x.encode('utf-8')
00200 length = len(_x)
00201 buff.write(struct.pack('<I%ss'%length, length, _x))
00202 _x = self.maker
00203 length = len(_x)
00204 if python3 or type(_x) == unicode:
00205 _x = _x.encode('utf-8')
00206 length = len(_x)
00207 buff.write(struct.pack('<I%ss'%length, length, _x))
00208 except struct.error as se: self._check_types(se)
00209 except TypeError as te: self._check_types(te)
00210
00211 def deserialize(self, str):
00212 """
00213 unpack serialized message in str into this message instance
00214 :param str: byte array of serialized message, ``str``
00215 """
00216 try:
00217 if self.return_code is None:
00218 self.return_code = household_objects_database_msgs.msg.DatabaseReturnCode()
00219 end = 0
00220 start = end
00221 end += 4
00222 (self.return_code.code,) = _struct_i.unpack(str[start:end])
00223 start = end
00224 end += 4
00225 (length,) = _struct_I.unpack(str[start:end])
00226 self.tags = []
00227 for i in range(0, length):
00228 start = end
00229 end += 4
00230 (length,) = _struct_I.unpack(str[start:end])
00231 start = end
00232 end += length
00233 if python3:
00234 val1 = str[start:end].decode('utf-8')
00235 else:
00236 val1 = str[start:end]
00237 self.tags.append(val1)
00238 start = end
00239 end += 4
00240 (length,) = _struct_I.unpack(str[start:end])
00241 start = end
00242 end += length
00243 if python3:
00244 self.name = str[start:end].decode('utf-8')
00245 else:
00246 self.name = str[start:end]
00247 start = end
00248 end += 4
00249 (length,) = _struct_I.unpack(str[start:end])
00250 start = end
00251 end += length
00252 if python3:
00253 self.maker = str[start:end].decode('utf-8')
00254 else:
00255 self.maker = str[start:end]
00256 return self
00257 except struct.error as e:
00258 raise genpy.DeserializationError(e)
00259
00260
00261 def serialize_numpy(self, buff, numpy):
00262 """
00263 serialize message with numpy array types into buffer
00264 :param buff: buffer, ``StringIO``
00265 :param numpy: numpy python module
00266 """
00267 try:
00268 buff.write(_struct_i.pack(self.return_code.code))
00269 length = len(self.tags)
00270 buff.write(_struct_I.pack(length))
00271 for val1 in self.tags:
00272 length = len(val1)
00273 if python3 or type(val1) == unicode:
00274 val1 = val1.encode('utf-8')
00275 length = len(val1)
00276 buff.write(struct.pack('<I%ss'%length, length, val1))
00277 _x = self.name
00278 length = len(_x)
00279 if python3 or type(_x) == unicode:
00280 _x = _x.encode('utf-8')
00281 length = len(_x)
00282 buff.write(struct.pack('<I%ss'%length, length, _x))
00283 _x = self.maker
00284 length = len(_x)
00285 if python3 or type(_x) == unicode:
00286 _x = _x.encode('utf-8')
00287 length = len(_x)
00288 buff.write(struct.pack('<I%ss'%length, length, _x))
00289 except struct.error as se: self._check_types(se)
00290 except TypeError as te: self._check_types(te)
00291
00292 def deserialize_numpy(self, str, numpy):
00293 """
00294 unpack serialized message in str into this message instance using numpy for array types
00295 :param str: byte array of serialized message, ``str``
00296 :param numpy: numpy python module
00297 """
00298 try:
00299 if self.return_code is None:
00300 self.return_code = household_objects_database_msgs.msg.DatabaseReturnCode()
00301 end = 0
00302 start = end
00303 end += 4
00304 (self.return_code.code,) = _struct_i.unpack(str[start:end])
00305 start = end
00306 end += 4
00307 (length,) = _struct_I.unpack(str[start:end])
00308 self.tags = []
00309 for i in range(0, length):
00310 start = end
00311 end += 4
00312 (length,) = _struct_I.unpack(str[start:end])
00313 start = end
00314 end += length
00315 if python3:
00316 val1 = str[start:end].decode('utf-8')
00317 else:
00318 val1 = str[start:end]
00319 self.tags.append(val1)
00320 start = end
00321 end += 4
00322 (length,) = _struct_I.unpack(str[start:end])
00323 start = end
00324 end += length
00325 if python3:
00326 self.name = str[start:end].decode('utf-8')
00327 else:
00328 self.name = str[start:end]
00329 start = end
00330 end += 4
00331 (length,) = _struct_I.unpack(str[start:end])
00332 start = end
00333 end += length
00334 if python3:
00335 self.maker = str[start:end].decode('utf-8')
00336 else:
00337 self.maker = str[start:end]
00338 return self
00339 except struct.error as e:
00340 raise genpy.DeserializationError(e)
00341
00342 _struct_I = genpy.struct_I
00343 _struct_i = struct.Struct("<i")
00344 class GetModelDescription(object):
00345 _type = 'household_objects_database_msgs/GetModelDescription'
00346 _md5sum = '1fee77e674730723af04cd39a4e3e0b1'
00347 _request_class = GetModelDescriptionRequest
00348 _response_class = GetModelDescriptionResponse