_GetImg.py
Go to the documentation of this file.
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 #flag to mark the presence of a Header object
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       #message fields cannot be None, assign default values for those that are
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) #most likely buffer underfill
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) #most likely buffer underfill
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 #flag to mark the presence of a Header object
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 src/image_encodings.cpp
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       #message fields cannot be None, assign default values for those that are
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         # - if encoded as a list instead, serialize as bytes instead of string
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         if python3:
00394           _v4.data = str[start:end].decode('utf-8')
00395         else:
00396           _v4.data = str[start:end]
00397         self.msg.append(val1)
00398       return self
00399     except struct.error as e:
00400       raise genpy.DeserializationError(e) #most likely buffer underfill
00401 
00402 
00403   def serialize_numpy(self, buff, numpy):
00404     """
00405     serialize message with numpy array types into buffer
00406     :param buff: buffer, ``StringIO``
00407     :param numpy: numpy python module
00408     """
00409     try:
00410       _x = self.return_response
00411       length = len(_x)
00412       if python3 or type(_x) == unicode:
00413         _x = _x.encode('utf-8')
00414         length = len(_x)
00415       buff.write(struct.pack('<I%ss'%length, length, _x))
00416       length = len(self.msg)
00417       buff.write(_struct_I.pack(length))
00418       for val1 in self.msg:
00419         buff.write(_struct_i.pack(val1.objectId))
00420         _x = val1.description
00421         length = len(_x)
00422         if python3 or type(_x) == unicode:
00423           _x = _x.encode('utf-8')
00424           length = len(_x)
00425         buff.write(struct.pack('<I%ss'%length, length, _x))
00426         _v7 = val1.image
00427         _v8 = _v7.header
00428         buff.write(_struct_I.pack(_v8.seq))
00429         _v9 = _v8.stamp
00430         _x = _v9
00431         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00432         _x = _v8.frame_id
00433         length = len(_x)
00434         if python3 or type(_x) == unicode:
00435           _x = _x.encode('utf-8')
00436           length = len(_x)
00437         buff.write(struct.pack('<I%ss'%length, length, _x))
00438         _x = _v7
00439         buff.write(_struct_2I.pack(_x.height, _x.width))
00440         _x = _v7.encoding
00441         length = len(_x)
00442         if python3 or type(_x) == unicode:
00443           _x = _x.encode('utf-8')
00444           length = len(_x)
00445         buff.write(struct.pack('<I%ss'%length, length, _x))
00446         _x = _v7
00447         buff.write(_struct_BI.pack(_x.is_bigendian, _x.step))
00448         _x = _v7.data
00449         length = len(_x)
00450         # - if encoded as a list instead, serialize as bytes instead of string
00451         if type(_x) in [list, tuple]:
00452           buff.write(struct.pack('<I%sB'%length, length, *_x))
00453         else:
00454           buff.write(struct.pack('<I%ss'%length, length, _x))
00455     except struct.error as se: self._check_types(se)
00456     except TypeError as te: self._check_types(te)
00457 
00458   def deserialize_numpy(self, str, numpy):
00459     """
00460     unpack serialized message in str into this message instance using numpy for array types
00461     :param str: byte array of serialized message, ``str``
00462     :param numpy: numpy python module
00463     """
00464     try:
00465       if self.msg is None:
00466         self.msg = None
00467       end = 0
00468       start = end
00469       end += 4
00470       (length,) = _struct_I.unpack(str[start:end])
00471       start = end
00472       end += length
00473       if python3:
00474         self.return_response = str[start:end].decode('utf-8')
00475       else:
00476         self.return_response = str[start:end]
00477       start = end
00478       end += 4
00479       (length,) = _struct_I.unpack(str[start:end])
00480       self.msg = []
00481       for i in range(0, length):
00482         val1 = srs_object_database_msgs.msg.img()
00483         start = end
00484         end += 4
00485         (val1.objectId,) = _struct_i.unpack(str[start:end])
00486         start = end
00487         end += 4
00488         (length,) = _struct_I.unpack(str[start:end])
00489         start = end
00490         end += length
00491         if python3:
00492           val1.description = str[start:end].decode('utf-8')
00493         else:
00494           val1.description = str[start:end]
00495         _v10 = val1.image
00496         _v11 = _v10.header
00497         start = end
00498         end += 4
00499         (_v11.seq,) = _struct_I.unpack(str[start:end])
00500         _v12 = _v11.stamp
00501         _x = _v12
00502         start = end
00503         end += 8
00504         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00505         start = end
00506         end += 4
00507         (length,) = _struct_I.unpack(str[start:end])
00508         start = end
00509         end += length
00510         if python3:
00511           _v11.frame_id = str[start:end].decode('utf-8')
00512         else:
00513           _v11.frame_id = str[start:end]
00514         _x = _v10
00515         start = end
00516         end += 8
00517         (_x.height, _x.width,) = _struct_2I.unpack(str[start:end])
00518         start = end
00519         end += 4
00520         (length,) = _struct_I.unpack(str[start:end])
00521         start = end
00522         end += length
00523         if python3:
00524           _v10.encoding = str[start:end].decode('utf-8')
00525         else:
00526           _v10.encoding = str[start:end]
00527         _x = _v10
00528         start = end
00529         end += 5
00530         (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end])
00531         start = end
00532         end += 4
00533         (length,) = _struct_I.unpack(str[start:end])
00534         start = end
00535         end += length
00536         if python3:
00537           _v10.data = str[start:end].decode('utf-8')
00538         else:
00539           _v10.data = str[start:end]
00540         self.msg.append(val1)
00541       return self
00542     except struct.error as e:
00543       raise genpy.DeserializationError(e) #most likely buffer underfill
00544 
00545 _struct_I = genpy.struct_I
00546 _struct_i = struct.Struct("<i")
00547 _struct_2I = struct.Struct("<2I")
00548 _struct_BI = struct.Struct("<BI")
00549 class GetImg(object):
00550   _type          = 'srs_object_database_msgs/GetImg'
00551   _md5sum = '537c22f986e5f0ba96c82f56b48af61b'
00552   _request_class  = GetImgRequest
00553   _response_class = GetImgResponse


srs_object_database_msgs
Author(s): Georg Arbeiter
autogenerated on Sun Jan 5 2014 11:36:25