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