$search
00001 """autogenerated by genmsg_py from GetObjectsOnTrayRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class GetObjectsOnTrayRequest(roslib.message.Message): 00007 _md5sum = "aa8aee7f6c8d5b8306117b46af679744" 00008 _type = "srs_knowledge/GetObjectsOnTrayRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """ 00011 00012 00013 string map 00014 00015 00016 """ 00017 __slots__ = ['map'] 00018 _slot_types = ['string'] 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 map 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(GetObjectsOnTrayRequest, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.map is None: 00038 self.map = '' 00039 else: 00040 self.map = '' 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 _x = self.map 00056 length = len(_x) 00057 buff.write(struct.pack('<I%ss'%length, length, _x)) 00058 except struct.error as se: self._check_types(se) 00059 except TypeError as te: self._check_types(te) 00060 00061 def deserialize(self, str): 00062 """ 00063 unpack serialized message in str into this message instance 00064 @param str: byte array of serialized message 00065 @type str: str 00066 """ 00067 try: 00068 end = 0 00069 start = end 00070 end += 4 00071 (length,) = _struct_I.unpack(str[start:end]) 00072 start = end 00073 end += length 00074 self.map = str[start:end] 00075 return self 00076 except struct.error as e: 00077 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00078 00079 00080 def serialize_numpy(self, buff, numpy): 00081 """ 00082 serialize message with numpy array types into buffer 00083 @param buff: buffer 00084 @type buff: StringIO 00085 @param numpy: numpy python module 00086 @type numpy module 00087 """ 00088 try: 00089 _x = self.map 00090 length = len(_x) 00091 buff.write(struct.pack('<I%ss'%length, length, _x)) 00092 except struct.error as se: self._check_types(se) 00093 except TypeError as te: self._check_types(te) 00094 00095 def deserialize_numpy(self, str, numpy): 00096 """ 00097 unpack serialized message in str into this message instance using numpy for array types 00098 @param str: byte array of serialized message 00099 @type str: str 00100 @param numpy: numpy python module 00101 @type numpy: module 00102 """ 00103 try: 00104 end = 0 00105 start = end 00106 end += 4 00107 (length,) = _struct_I.unpack(str[start:end]) 00108 start = end 00109 end += length 00110 self.map = str[start:end] 00111 return self 00112 except struct.error as e: 00113 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00114 00115 _struct_I = roslib.message.struct_I 00116 """autogenerated by genmsg_py from GetObjectsOnTrayResponse.msg. Do not edit.""" 00117 import roslib.message 00118 import struct 00119 00120 00121 class GetObjectsOnTrayResponse(roslib.message.Message): 00122 _md5sum = "8a7d9cb8b7900b713af1072e5d51ae5e" 00123 _type = "srs_knowledge/GetObjectsOnTrayResponse" 00124 _has_header = False #flag to mark the presence of a Header object 00125 _full_text = """ 00126 00127 string[] objects 00128 string[] classesOfObjects 00129 00130 00131 00132 00133 00134 """ 00135 __slots__ = ['objects','classesOfObjects'] 00136 _slot_types = ['string[]','string[]'] 00137 00138 def __init__(self, *args, **kwds): 00139 """ 00140 Constructor. Any message fields that are implicitly/explicitly 00141 set to None will be assigned a default value. The recommend 00142 use is keyword arguments as this is more robust to future message 00143 changes. You cannot mix in-order arguments and keyword arguments. 00144 00145 The available fields are: 00146 objects,classesOfObjects 00147 00148 @param args: complete set of field values, in .msg order 00149 @param kwds: use keyword arguments corresponding to message field names 00150 to set specific fields. 00151 """ 00152 if args or kwds: 00153 super(GetObjectsOnTrayResponse, self).__init__(*args, **kwds) 00154 #message fields cannot be None, assign default values for those that are 00155 if self.objects is None: 00156 self.objects = [] 00157 if self.classesOfObjects is None: 00158 self.classesOfObjects = [] 00159 else: 00160 self.objects = [] 00161 self.classesOfObjects = [] 00162 00163 def _get_types(self): 00164 """ 00165 internal API method 00166 """ 00167 return self._slot_types 00168 00169 def serialize(self, buff): 00170 """ 00171 serialize message into buffer 00172 @param buff: buffer 00173 @type buff: StringIO 00174 """ 00175 try: 00176 length = len(self.objects) 00177 buff.write(_struct_I.pack(length)) 00178 for val1 in self.objects: 00179 length = len(val1) 00180 buff.write(struct.pack('<I%ss'%length, length, val1)) 00181 length = len(self.classesOfObjects) 00182 buff.write(_struct_I.pack(length)) 00183 for val1 in self.classesOfObjects: 00184 length = len(val1) 00185 buff.write(struct.pack('<I%ss'%length, length, val1)) 00186 except struct.error as se: self._check_types(se) 00187 except TypeError as te: self._check_types(te) 00188 00189 def deserialize(self, str): 00190 """ 00191 unpack serialized message in str into this message instance 00192 @param str: byte array of serialized message 00193 @type str: str 00194 """ 00195 try: 00196 end = 0 00197 start = end 00198 end += 4 00199 (length,) = _struct_I.unpack(str[start:end]) 00200 self.objects = [] 00201 for i in range(0, length): 00202 start = end 00203 end += 4 00204 (length,) = _struct_I.unpack(str[start:end]) 00205 start = end 00206 end += length 00207 val1 = str[start:end] 00208 self.objects.append(val1) 00209 start = end 00210 end += 4 00211 (length,) = _struct_I.unpack(str[start:end]) 00212 self.classesOfObjects = [] 00213 for i in range(0, length): 00214 start = end 00215 end += 4 00216 (length,) = _struct_I.unpack(str[start:end]) 00217 start = end 00218 end += length 00219 val1 = str[start:end] 00220 self.classesOfObjects.append(val1) 00221 return self 00222 except struct.error as e: 00223 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00224 00225 00226 def serialize_numpy(self, buff, numpy): 00227 """ 00228 serialize message with numpy array types into buffer 00229 @param buff: buffer 00230 @type buff: StringIO 00231 @param numpy: numpy python module 00232 @type numpy module 00233 """ 00234 try: 00235 length = len(self.objects) 00236 buff.write(_struct_I.pack(length)) 00237 for val1 in self.objects: 00238 length = len(val1) 00239 buff.write(struct.pack('<I%ss'%length, length, val1)) 00240 length = len(self.classesOfObjects) 00241 buff.write(_struct_I.pack(length)) 00242 for val1 in self.classesOfObjects: 00243 length = len(val1) 00244 buff.write(struct.pack('<I%ss'%length, length, val1)) 00245 except struct.error as se: self._check_types(se) 00246 except TypeError as te: self._check_types(te) 00247 00248 def deserialize_numpy(self, str, numpy): 00249 """ 00250 unpack serialized message in str into this message instance using numpy for array types 00251 @param str: byte array of serialized message 00252 @type str: str 00253 @param numpy: numpy python module 00254 @type numpy: module 00255 """ 00256 try: 00257 end = 0 00258 start = end 00259 end += 4 00260 (length,) = _struct_I.unpack(str[start:end]) 00261 self.objects = [] 00262 for i in range(0, length): 00263 start = end 00264 end += 4 00265 (length,) = _struct_I.unpack(str[start:end]) 00266 start = end 00267 end += length 00268 val1 = str[start:end] 00269 self.objects.append(val1) 00270 start = end 00271 end += 4 00272 (length,) = _struct_I.unpack(str[start:end]) 00273 self.classesOfObjects = [] 00274 for i in range(0, length): 00275 start = end 00276 end += 4 00277 (length,) = _struct_I.unpack(str[start:end]) 00278 start = end 00279 end += length 00280 val1 = str[start:end] 00281 self.classesOfObjects.append(val1) 00282 return self 00283 except struct.error as e: 00284 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00285 00286 _struct_I = roslib.message.struct_I 00287 class GetObjectsOnTray(roslib.message.ServiceDefinition): 00288 _type = 'srs_knowledge/GetObjectsOnTray' 00289 _md5sum = 'd1c7206bb704b11ba6287c8557045c46' 00290 _request_class = GetObjectsOnTrayRequest 00291 _response_class = GetObjectsOnTrayResponse