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