00001 """autogenerated by genpy from srs_object_database_msgs/GetImgRequest.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 GetImgRequest(genpy.Message):
00009 _md5sum = "77cd1e697fb96aaf550cf17b213846ac"
00010 _type = "srs_object_database_msgs/GetImgRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014
00015
00016 int32[] model_ids
00017
00018
00019 string type
00020
00021
00022 """
00023 __slots__ = ['model_ids','type']
00024 _slot_types = ['int32[]','string']
00025
00026 def __init__(self, *args, **kwds):
00027 """
00028 Constructor. Any message fields that are implicitly/explicitly
00029 set to None will be assigned a default value. The recommend
00030 use is keyword arguments as this is more robust to future message
00031 changes. You cannot mix in-order arguments and keyword arguments.
00032
00033 The available fields are:
00034 model_ids,type
00035
00036 :param args: complete set of field values, in .msg order
00037 :param kwds: use keyword arguments corresponding to message field names
00038 to set specific fields.
00039 """
00040 if args or kwds:
00041 super(GetImgRequest, self).__init__(*args, **kwds)
00042
00043 if self.model_ids is None:
00044 self.model_ids = []
00045 if self.type is None:
00046 self.type = ''
00047 else:
00048 self.model_ids = []
00049 self.type = ''
00050
00051 def _get_types(self):
00052 """
00053 internal API method
00054 """
00055 return self._slot_types
00056
00057 def serialize(self, buff):
00058 """
00059 serialize message into buffer
00060 :param buff: buffer, ``StringIO``
00061 """
00062 try:
00063 length = len(self.model_ids)
00064 buff.write(_struct_I.pack(length))
00065 pattern = '<%si'%length
00066 buff.write(struct.pack(pattern, *self.model_ids))
00067 _x = self.type
00068 length = len(_x)
00069 if python3 or type(_x) == unicode:
00070 _x = _x.encode('utf-8')
00071 length = len(_x)
00072 buff.write(struct.pack('<I%ss'%length, length, _x))
00073 except struct.error as se: self._check_types(se)
00074 except TypeError as te: self._check_types(te)
00075
00076 def deserialize(self, str):
00077 """
00078 unpack serialized message in str into this message instance
00079 :param str: byte array of serialized message, ``str``
00080 """
00081 try:
00082 end = 0
00083 start = end
00084 end += 4
00085 (length,) = _struct_I.unpack(str[start:end])
00086 pattern = '<%si'%length
00087 start = end
00088 end += struct.calcsize(pattern)
00089 self.model_ids = struct.unpack(pattern, str[start:end])
00090 start = end
00091 end += 4
00092 (length,) = _struct_I.unpack(str[start:end])
00093 start = end
00094 end += length
00095 if python3:
00096 self.type = str[start:end].decode('utf-8')
00097 else:
00098 self.type = str[start:end]
00099 return self
00100 except struct.error as e:
00101 raise genpy.DeserializationError(e)
00102
00103
00104 def serialize_numpy(self, buff, numpy):
00105 """
00106 serialize message with numpy array types into buffer
00107 :param buff: buffer, ``StringIO``
00108 :param numpy: numpy python module
00109 """
00110 try:
00111 length = len(self.model_ids)
00112 buff.write(_struct_I.pack(length))
00113 pattern = '<%si'%length
00114 buff.write(self.model_ids.tostring())
00115 _x = self.type
00116 length = len(_x)
00117 if python3 or type(_x) == unicode:
00118 _x = _x.encode('utf-8')
00119 length = len(_x)
00120 buff.write(struct.pack('<I%ss'%length, length, _x))
00121 except struct.error as se: self._check_types(se)
00122 except TypeError as te: self._check_types(te)
00123
00124 def deserialize_numpy(self, str, numpy):
00125 """
00126 unpack serialized message in str into this message instance using numpy for array types
00127 :param str: byte array of serialized message, ``str``
00128 :param numpy: numpy python module
00129 """
00130 try:
00131 end = 0
00132 start = end
00133 end += 4
00134 (length,) = _struct_I.unpack(str[start:end])
00135 pattern = '<%si'%length
00136 start = end
00137 end += struct.calcsize(pattern)
00138 self.model_ids = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00139 start = end
00140 end += 4
00141 (length,) = _struct_I.unpack(str[start:end])
00142 start = end
00143 end += length
00144 if python3:
00145 self.type = str[start:end].decode('utf-8')
00146 else:
00147 self.type = str[start:end]
00148 return self
00149 except struct.error as e:
00150 raise genpy.DeserializationError(e)
00151
00152 _struct_I = genpy.struct_I
00153 """autogenerated by genpy from srs_object_database_msgs/GetImgResponse.msg. Do not edit."""
00154 import sys
00155 python3 = True if sys.hexversion > 0x03000000 else False
00156 import genpy
00157 import struct
00158
00159 import srs_object_database_msgs.msg
00160 import std_msgs.msg
00161 import sensor_msgs.msg
00162
00163 class GetImgResponse(genpy.Message):
00164 _md5sum = "f16e1f5f36fac921d1c918ee40af6ecb"
00165 _type = "srs_object_database_msgs/GetImgResponse"
00166 _has_header = False
00167 _full_text = """
00168
00169 string return_response
00170 srs_object_database_msgs/img[] msg
00171
00172
00173
00174 ================================================================================
00175 MSG: srs_object_database_msgs/img
00176 int32 objectId
00177 string description
00178 sensor_msgs/Image image
00179 ================================================================================
00180 MSG: sensor_msgs/Image
00181 # This message contains an uncompressed image
00182 # (0, 0) is at top-left corner of image
00183 #
00184
00185 Header header # Header timestamp should be acquisition time of image
00186 # Header frame_id should be optical frame of camera
00187 # origin of frame should be optical center of cameara
00188 # +x should point to the right in the image
00189 # +y should point down in the image
00190 # +z should point into to plane of the image
00191 # If the frame_id here and the frame_id of the CameraInfo
00192 # message associated with the image conflict
00193 # the behavior is undefined
00194
00195 uint32 height # image height, that is, number of rows
00196 uint32 width # image width, that is, number of columns
00197
00198 # The legal values for encoding are in file src/image_encodings.cpp
00199 # If you want to standardize a new string format, join
00200 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00201
00202 string encoding # Encoding of pixels -- channel meaning, ordering, size
00203 # taken from the list of strings in include/sensor_msgs/image_encodings.h
00204
00205 uint8 is_bigendian # is this data bigendian?
00206 uint32 step # Full row length in bytes
00207 uint8[] data # actual matrix data, size is (step * rows)
00208
00209 ================================================================================
00210 MSG: std_msgs/Header
00211 # Standard metadata for higher-level stamped data types.
00212 # This is generally used to communicate timestamped data
00213 # in a particular coordinate frame.
00214 #
00215 # sequence ID: consecutively increasing ID
00216 uint32 seq
00217 #Two-integer timestamp that is expressed as:
00218 # * stamp.secs: seconds (stamp_secs) since epoch
00219 # * stamp.nsecs: nanoseconds since stamp_secs
00220 # time-handling sugar is provided by the client library
00221 time stamp
00222 #Frame this data is associated with
00223 # 0: no frame
00224 # 1: global frame
00225 string frame_id
00226
00227 """
00228 __slots__ = ['return_response','msg']
00229 _slot_types = ['string','srs_object_database_msgs/img[]']
00230
00231 def __init__(self, *args, **kwds):
00232 """
00233 Constructor. Any message fields that are implicitly/explicitly
00234 set to None will be assigned a default value. The recommend
00235 use is keyword arguments as this is more robust to future message
00236 changes. You cannot mix in-order arguments and keyword arguments.
00237
00238 The available fields are:
00239 return_response,msg
00240
00241 :param args: complete set of field values, in .msg order
00242 :param kwds: use keyword arguments corresponding to message field names
00243 to set specific fields.
00244 """
00245 if args or kwds:
00246 super(GetImgResponse, self).__init__(*args, **kwds)
00247
00248 if self.return_response is None:
00249 self.return_response = ''
00250 if self.msg is None:
00251 self.msg = []
00252 else:
00253 self.return_response = ''
00254 self.msg = []
00255
00256 def _get_types(self):
00257 """
00258 internal API method
00259 """
00260 return self._slot_types
00261
00262 def serialize(self, buff):
00263 """
00264 serialize message into buffer
00265 :param buff: buffer, ``StringIO``
00266 """
00267 try:
00268 _x = self.return_response
00269 length = len(_x)
00270 if python3 or type(_x) == unicode:
00271 _x = _x.encode('utf-8')
00272 length = len(_x)
00273 buff.write(struct.pack('<I%ss'%length, length, _x))
00274 length = len(self.msg)
00275 buff.write(_struct_I.pack(length))
00276 for val1 in self.msg:
00277 buff.write(_struct_i.pack(val1.objectId))
00278 _x = val1.description
00279 length = len(_x)
00280 if python3 or type(_x) == unicode:
00281 _x = _x.encode('utf-8')
00282 length = len(_x)
00283 buff.write(struct.pack('<I%ss'%length, length, _x))
00284 _v1 = val1.image
00285 _v2 = _v1.header
00286 buff.write(_struct_I.pack(_v2.seq))
00287 _v3 = _v2.stamp
00288 _x = _v3
00289 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00290 _x = _v2.frame_id
00291 length = len(_x)
00292 if python3 or type(_x) == unicode:
00293 _x = _x.encode('utf-8')
00294 length = len(_x)
00295 buff.write(struct.pack('<I%ss'%length, length, _x))
00296 _x = _v1
00297 buff.write(_struct_2I.pack(_x.height, _x.width))
00298 _x = _v1.encoding
00299 length = len(_x)
00300 if python3 or type(_x) == unicode:
00301 _x = _x.encode('utf-8')
00302 length = len(_x)
00303 buff.write(struct.pack('<I%ss'%length, length, _x))
00304 _x = _v1
00305 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step))
00306 _x = _v1.data
00307 length = len(_x)
00308
00309 if type(_x) in [list, tuple]:
00310 buff.write(struct.pack('<I%sB'%length, length, *_x))
00311 else:
00312 buff.write(struct.pack('<I%ss'%length, length, _x))
00313 except struct.error as se: self._check_types(se)
00314 except TypeError as te: self._check_types(te)
00315
00316 def deserialize(self, str):
00317 """
00318 unpack serialized message in str into this message instance
00319 :param str: byte array of serialized message, ``str``
00320 """
00321 try:
00322 if self.msg is None:
00323 self.msg = None
00324 end = 0
00325 start = end
00326 end += 4
00327 (length,) = _struct_I.unpack(str[start:end])
00328 start = end
00329 end += length
00330 if python3:
00331 self.return_response = str[start:end].decode('utf-8')
00332 else:
00333 self.return_response = str[start:end]
00334 start = end
00335 end += 4
00336 (length,) = _struct_I.unpack(str[start:end])
00337 self.msg = []
00338 for i in range(0, length):
00339 val1 = srs_object_database_msgs.msg.img()
00340 start = end
00341 end += 4
00342 (val1.objectId,) = _struct_i.unpack(str[start:end])
00343 start = end
00344 end += 4
00345 (length,) = _struct_I.unpack(str[start:end])
00346 start = end
00347 end += length
00348 if python3:
00349 val1.description = str[start:end].decode('utf-8')
00350 else:
00351 val1.description = str[start:end]
00352 _v4 = val1.image
00353 _v5 = _v4.header
00354 start = end
00355 end += 4
00356 (_v5.seq,) = _struct_I.unpack(str[start:end])
00357 _v6 = _v5.stamp
00358 _x = _v6
00359 start = end
00360 end += 8
00361 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00362 start = end
00363 end += 4
00364 (length,) = _struct_I.unpack(str[start:end])
00365 start = end
00366 end += length
00367 if python3:
00368 _v5.frame_id = str[start:end].decode('utf-8')
00369 else:
00370 _v5.frame_id = str[start:end]
00371 _x = _v4
00372 start = end
00373 end += 8
00374 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end])
00375 start = end
00376 end += 4
00377 (length,) = _struct_I.unpack(str[start:end])
00378 start = end
00379 end += length
00380 if python3:
00381 _v4.encoding = str[start:end].decode('utf-8')
00382 else:
00383 _v4.encoding = str[start:end]
00384 _x = _v4
00385 start = end
00386 end += 5
00387 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end])
00388 start = end
00389 end += 4
00390 (length,) = _struct_I.unpack(str[start:end])
00391 start = end
00392 end += length
00393 _v4.data = str[start:end]
00394 self.msg.append(val1)
00395 return self
00396 except struct.error as e:
00397 raise genpy.DeserializationError(e)
00398
00399
00400 def serialize_numpy(self, buff, numpy):
00401 """
00402 serialize message with numpy array types into buffer
00403 :param buff: buffer, ``StringIO``
00404 :param numpy: numpy python module
00405 """
00406 try:
00407 _x = self.return_response
00408 length = len(_x)
00409 if python3 or type(_x) == unicode:
00410 _x = _x.encode('utf-8')
00411 length = len(_x)
00412 buff.write(struct.pack('<I%ss'%length, length, _x))
00413 length = len(self.msg)
00414 buff.write(_struct_I.pack(length))
00415 for val1 in self.msg:
00416 buff.write(_struct_i.pack(val1.objectId))
00417 _x = val1.description
00418 length = len(_x)
00419 if python3 or type(_x) == unicode:
00420 _x = _x.encode('utf-8')
00421 length = len(_x)
00422 buff.write(struct.pack('<I%ss'%length, length, _x))
00423 _v7 = val1.image
00424 _v8 = _v7.header
00425 buff.write(_struct_I.pack(_v8.seq))
00426 _v9 = _v8.stamp
00427 _x = _v9
00428 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00429 _x = _v8.frame_id
00430 length = len(_x)
00431 if python3 or type(_x) == unicode:
00432 _x = _x.encode('utf-8')
00433 length = len(_x)
00434 buff.write(struct.pack('<I%ss'%length, length, _x))
00435 _x = _v7
00436 buff.write(_struct_2I.pack(_x.height, _x.width))
00437 _x = _v7.encoding
00438 length = len(_x)
00439 if python3 or type(_x) == unicode:
00440 _x = _x.encode('utf-8')
00441 length = len(_x)
00442 buff.write(struct.pack('<I%ss'%length, length, _x))
00443 _x = _v7
00444 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step))
00445 _x = _v7.data
00446 length = len(_x)
00447
00448 if type(_x) in [list, tuple]:
00449 buff.write(struct.pack('<I%sB'%length, length, *_x))
00450 else:
00451 buff.write(struct.pack('<I%ss'%length, length, _x))
00452 except struct.error as se: self._check_types(se)
00453 except TypeError as te: self._check_types(te)
00454
00455 def deserialize_numpy(self, str, numpy):
00456 """
00457 unpack serialized message in str into this message instance using numpy for array types
00458 :param str: byte array of serialized message, ``str``
00459 :param numpy: numpy python module
00460 """
00461 try:
00462 if self.msg is None:
00463 self.msg = None
00464 end = 0
00465 start = end
00466 end += 4
00467 (length,) = _struct_I.unpack(str[start:end])
00468 start = end
00469 end += length
00470 if python3:
00471 self.return_response = str[start:end].decode('utf-8')
00472 else:
00473 self.return_response = str[start:end]
00474 start = end
00475 end += 4
00476 (length,) = _struct_I.unpack(str[start:end])
00477 self.msg = []
00478 for i in range(0, length):
00479 val1 = srs_object_database_msgs.msg.img()
00480 start = end
00481 end += 4
00482 (val1.objectId,) = _struct_i.unpack(str[start:end])
00483 start = end
00484 end += 4
00485 (length,) = _struct_I.unpack(str[start:end])
00486 start = end
00487 end += length
00488 if python3:
00489 val1.description = str[start:end].decode('utf-8')
00490 else:
00491 val1.description = str[start:end]
00492 _v10 = val1.image
00493 _v11 = _v10.header
00494 start = end
00495 end += 4
00496 (_v11.seq,) = _struct_I.unpack(str[start:end])
00497 _v12 = _v11.stamp
00498 _x = _v12
00499 start = end
00500 end += 8
00501 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00502 start = end
00503 end += 4
00504 (length,) = _struct_I.unpack(str[start:end])
00505 start = end
00506 end += length
00507 if python3:
00508 _v11.frame_id = str[start:end].decode('utf-8')
00509 else:
00510 _v11.frame_id = str[start:end]
00511 _x = _v10
00512 start = end
00513 end += 8
00514 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end])
00515 start = end
00516 end += 4
00517 (length,) = _struct_I.unpack(str[start:end])
00518 start = end
00519 end += length
00520 if python3:
00521 _v10.encoding = str[start:end].decode('utf-8')
00522 else:
00523 _v10.encoding = str[start:end]
00524 _x = _v10
00525 start = end
00526 end += 5
00527 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end])
00528 start = end
00529 end += 4
00530 (length,) = _struct_I.unpack(str[start:end])
00531 start = end
00532 end += length
00533 _v10.data = str[start:end]
00534 self.msg.append(val1)
00535 return self
00536 except struct.error as e:
00537 raise genpy.DeserializationError(e)
00538
00539 _struct_I = genpy.struct_I
00540 _struct_i = struct.Struct("<i")
00541 _struct_2I = struct.Struct("<2I")
00542 _struct_BI = struct.Struct("<BI")
00543 class GetImg(object):
00544 _type = 'srs_object_database_msgs/GetImg'
00545 _md5sum = '537c22f986e5f0ba96c82f56b48af61b'
00546 _request_class = GetImgRequest
00547 _response_class = GetImgResponse