_ExtractClusters.py
Go to the documentation of this file.
00001 """autogenerated by genpy from zyonz_obtain_two_clustered_leaves/ExtractClustersRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import std_msgs.msg
00008 import sensor_msgs.msg
00009 
00010 class ExtractClustersRequest(genpy.Message):
00011   _md5sum = "55c5f2a1ba5379341fa496de58e8d437"
00012   _type = "zyonz_obtain_two_clustered_leaves/ExtractClustersRequest"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """
00015 sensor_msgs/PointCloud2 input
00016 
00017 ================================================================================
00018 MSG: sensor_msgs/PointCloud2
00019 # This message holds a collection of N-dimensional points, which may
00020 # contain additional information such as normals, intensity, etc. The
00021 # point data is stored as a binary blob, its layout described by the
00022 # contents of the "fields" array.
00023 
00024 # The point cloud data may be organized 2d (image-like) or 1d
00025 # (unordered). Point clouds organized as 2d images may be produced by
00026 # camera depth sensors such as stereo or time-of-flight.
00027 
00028 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00029 # points).
00030 Header header
00031 
00032 # 2D structure of the point cloud. If the cloud is unordered, height is
00033 # 1 and width is the length of the point cloud.
00034 uint32 height
00035 uint32 width
00036 
00037 # Describes the channels and their layout in the binary data blob.
00038 PointField[] fields
00039 
00040 bool    is_bigendian # Is this data bigendian?
00041 uint32  point_step   # Length of a point in bytes
00042 uint32  row_step     # Length of a row in bytes
00043 uint8[] data         # Actual point data, size is (row_step*height)
00044 
00045 bool is_dense        # True if there are no invalid points
00046 
00047 ================================================================================
00048 MSG: std_msgs/Header
00049 # Standard metadata for higher-level stamped data types.
00050 # This is generally used to communicate timestamped data 
00051 # in a particular coordinate frame.
00052 # 
00053 # sequence ID: consecutively increasing ID 
00054 uint32 seq
00055 #Two-integer timestamp that is expressed as:
00056 # * stamp.secs: seconds (stamp_secs) since epoch
00057 # * stamp.nsecs: nanoseconds since stamp_secs
00058 # time-handling sugar is provided by the client library
00059 time stamp
00060 #Frame this data is associated with
00061 # 0: no frame
00062 # 1: global frame
00063 string frame_id
00064 
00065 ================================================================================
00066 MSG: sensor_msgs/PointField
00067 # This message holds the description of one point entry in the
00068 # PointCloud2 message format.
00069 uint8 INT8    = 1
00070 uint8 UINT8   = 2
00071 uint8 INT16   = 3
00072 uint8 UINT16  = 4
00073 uint8 INT32   = 5
00074 uint8 UINT32  = 6
00075 uint8 FLOAT32 = 7
00076 uint8 FLOAT64 = 8
00077 
00078 string name      # Name of field
00079 uint32 offset    # Offset from start of point struct
00080 uint8  datatype  # Datatype enumeration, see above
00081 uint32 count     # How many elements in the field
00082 
00083 """
00084   __slots__ = ['input']
00085   _slot_types = ['sensor_msgs/PointCloud2']
00086 
00087   def __init__(self, *args, **kwds):
00088     """
00089     Constructor. Any message fields that are implicitly/explicitly
00090     set to None will be assigned a default value. The recommend
00091     use is keyword arguments as this is more robust to future message
00092     changes.  You cannot mix in-order arguments and keyword arguments.
00093 
00094     The available fields are:
00095        input
00096 
00097     :param args: complete set of field values, in .msg order
00098     :param kwds: use keyword arguments corresponding to message field names
00099     to set specific fields.
00100     """
00101     if args or kwds:
00102       super(ExtractClustersRequest, self).__init__(*args, **kwds)
00103       #message fields cannot be None, assign default values for those that are
00104       if self.input is None:
00105         self.input = sensor_msgs.msg.PointCloud2()
00106     else:
00107       self.input = sensor_msgs.msg.PointCloud2()
00108 
00109   def _get_types(self):
00110     """
00111     internal API method
00112     """
00113     return self._slot_types
00114 
00115   def serialize(self, buff):
00116     """
00117     serialize message into buffer
00118     :param buff: buffer, ``StringIO``
00119     """
00120     try:
00121       _x = self
00122       buff.write(_struct_3I.pack(_x.input.header.seq, _x.input.header.stamp.secs, _x.input.header.stamp.nsecs))
00123       _x = self.input.header.frame_id
00124       length = len(_x)
00125       if python3 or type(_x) == unicode:
00126         _x = _x.encode('utf-8')
00127         length = len(_x)
00128       buff.write(struct.pack('<I%ss'%length, length, _x))
00129       _x = self
00130       buff.write(_struct_2I.pack(_x.input.height, _x.input.width))
00131       length = len(self.input.fields)
00132       buff.write(_struct_I.pack(length))
00133       for val1 in self.input.fields:
00134         _x = val1.name
00135         length = len(_x)
00136         if python3 or type(_x) == unicode:
00137           _x = _x.encode('utf-8')
00138           length = len(_x)
00139         buff.write(struct.pack('<I%ss'%length, length, _x))
00140         _x = val1
00141         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00142       _x = self
00143       buff.write(_struct_B2I.pack(_x.input.is_bigendian, _x.input.point_step, _x.input.row_step))
00144       _x = self.input.data
00145       length = len(_x)
00146       # - if encoded as a list instead, serialize as bytes instead of string
00147       if type(_x) in [list, tuple]:
00148         buff.write(struct.pack('<I%sB'%length, length, *_x))
00149       else:
00150         buff.write(struct.pack('<I%ss'%length, length, _x))
00151       buff.write(_struct_B.pack(self.input.is_dense))
00152     except struct.error as se: self._check_types(se)
00153     except TypeError as te: self._check_types(te)
00154 
00155   def deserialize(self, str):
00156     """
00157     unpack serialized message in str into this message instance
00158     :param str: byte array of serialized message, ``str``
00159     """
00160     try:
00161       if self.input is None:
00162         self.input = sensor_msgs.msg.PointCloud2()
00163       end = 0
00164       _x = self
00165       start = end
00166       end += 12
00167       (_x.input.header.seq, _x.input.header.stamp.secs, _x.input.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00168       start = end
00169       end += 4
00170       (length,) = _struct_I.unpack(str[start:end])
00171       start = end
00172       end += length
00173       if python3:
00174         self.input.header.frame_id = str[start:end].decode('utf-8')
00175       else:
00176         self.input.header.frame_id = str[start:end]
00177       _x = self
00178       start = end
00179       end += 8
00180       (_x.input.height, _x.input.width,) = _struct_2I.unpack(str[start:end])
00181       start = end
00182       end += 4
00183       (length,) = _struct_I.unpack(str[start:end])
00184       self.input.fields = []
00185       for i in range(0, length):
00186         val1 = sensor_msgs.msg.PointField()
00187         start = end
00188         end += 4
00189         (length,) = _struct_I.unpack(str[start:end])
00190         start = end
00191         end += length
00192         if python3:
00193           val1.name = str[start:end].decode('utf-8')
00194         else:
00195           val1.name = str[start:end]
00196         _x = val1
00197         start = end
00198         end += 9
00199         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00200         self.input.fields.append(val1)
00201       _x = self
00202       start = end
00203       end += 9
00204       (_x.input.is_bigendian, _x.input.point_step, _x.input.row_step,) = _struct_B2I.unpack(str[start:end])
00205       self.input.is_bigendian = bool(self.input.is_bigendian)
00206       start = end
00207       end += 4
00208       (length,) = _struct_I.unpack(str[start:end])
00209       start = end
00210       end += length
00211       if python3:
00212         self.input.data = str[start:end].decode('utf-8')
00213       else:
00214         self.input.data = str[start:end]
00215       start = end
00216       end += 1
00217       (self.input.is_dense,) = _struct_B.unpack(str[start:end])
00218       self.input.is_dense = bool(self.input.is_dense)
00219       return self
00220     except struct.error as e:
00221       raise genpy.DeserializationError(e) #most likely buffer underfill
00222 
00223 
00224   def serialize_numpy(self, buff, numpy):
00225     """
00226     serialize message with numpy array types into buffer
00227     :param buff: buffer, ``StringIO``
00228     :param numpy: numpy python module
00229     """
00230     try:
00231       _x = self
00232       buff.write(_struct_3I.pack(_x.input.header.seq, _x.input.header.stamp.secs, _x.input.header.stamp.nsecs))
00233       _x = self.input.header.frame_id
00234       length = len(_x)
00235       if python3 or type(_x) == unicode:
00236         _x = _x.encode('utf-8')
00237         length = len(_x)
00238       buff.write(struct.pack('<I%ss'%length, length, _x))
00239       _x = self
00240       buff.write(_struct_2I.pack(_x.input.height, _x.input.width))
00241       length = len(self.input.fields)
00242       buff.write(_struct_I.pack(length))
00243       for val1 in self.input.fields:
00244         _x = val1.name
00245         length = len(_x)
00246         if python3 or type(_x) == unicode:
00247           _x = _x.encode('utf-8')
00248           length = len(_x)
00249         buff.write(struct.pack('<I%ss'%length, length, _x))
00250         _x = val1
00251         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00252       _x = self
00253       buff.write(_struct_B2I.pack(_x.input.is_bigendian, _x.input.point_step, _x.input.row_step))
00254       _x = self.input.data
00255       length = len(_x)
00256       # - if encoded as a list instead, serialize as bytes instead of string
00257       if type(_x) in [list, tuple]:
00258         buff.write(struct.pack('<I%sB'%length, length, *_x))
00259       else:
00260         buff.write(struct.pack('<I%ss'%length, length, _x))
00261       buff.write(_struct_B.pack(self.input.is_dense))
00262     except struct.error as se: self._check_types(se)
00263     except TypeError as te: self._check_types(te)
00264 
00265   def deserialize_numpy(self, str, numpy):
00266     """
00267     unpack serialized message in str into this message instance using numpy for array types
00268     :param str: byte array of serialized message, ``str``
00269     :param numpy: numpy python module
00270     """
00271     try:
00272       if self.input is None:
00273         self.input = sensor_msgs.msg.PointCloud2()
00274       end = 0
00275       _x = self
00276       start = end
00277       end += 12
00278       (_x.input.header.seq, _x.input.header.stamp.secs, _x.input.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00279       start = end
00280       end += 4
00281       (length,) = _struct_I.unpack(str[start:end])
00282       start = end
00283       end += length
00284       if python3:
00285         self.input.header.frame_id = str[start:end].decode('utf-8')
00286       else:
00287         self.input.header.frame_id = str[start:end]
00288       _x = self
00289       start = end
00290       end += 8
00291       (_x.input.height, _x.input.width,) = _struct_2I.unpack(str[start:end])
00292       start = end
00293       end += 4
00294       (length,) = _struct_I.unpack(str[start:end])
00295       self.input.fields = []
00296       for i in range(0, length):
00297         val1 = sensor_msgs.msg.PointField()
00298         start = end
00299         end += 4
00300         (length,) = _struct_I.unpack(str[start:end])
00301         start = end
00302         end += length
00303         if python3:
00304           val1.name = str[start:end].decode('utf-8')
00305         else:
00306           val1.name = str[start:end]
00307         _x = val1
00308         start = end
00309         end += 9
00310         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00311         self.input.fields.append(val1)
00312       _x = self
00313       start = end
00314       end += 9
00315       (_x.input.is_bigendian, _x.input.point_step, _x.input.row_step,) = _struct_B2I.unpack(str[start:end])
00316       self.input.is_bigendian = bool(self.input.is_bigendian)
00317       start = end
00318       end += 4
00319       (length,) = _struct_I.unpack(str[start:end])
00320       start = end
00321       end += length
00322       if python3:
00323         self.input.data = str[start:end].decode('utf-8')
00324       else:
00325         self.input.data = str[start:end]
00326       start = end
00327       end += 1
00328       (self.input.is_dense,) = _struct_B.unpack(str[start:end])
00329       self.input.is_dense = bool(self.input.is_dense)
00330       return self
00331     except struct.error as e:
00332       raise genpy.DeserializationError(e) #most likely buffer underfill
00333 
00334 _struct_I = genpy.struct_I
00335 _struct_IBI = struct.Struct("<IBI")
00336 _struct_3I = struct.Struct("<3I")
00337 _struct_B = struct.Struct("<B")
00338 _struct_2I = struct.Struct("<2I")
00339 _struct_B2I = struct.Struct("<B2I")
00340 """autogenerated by genpy from zyonz_obtain_two_clustered_leaves/ExtractClustersResponse.msg. Do not edit."""
00341 import sys
00342 python3 = True if sys.hexversion > 0x03000000 else False
00343 import genpy
00344 import struct
00345 
00346 import std_msgs.msg
00347 import sensor_msgs.msg
00348 
00349 class ExtractClustersResponse(genpy.Message):
00350   _md5sum = "4975672b30341a204b5311a21c069402"
00351   _type = "zyonz_obtain_two_clustered_leaves/ExtractClustersResponse"
00352   _has_header = False #flag to mark the presence of a Header object
00353   _full_text = """
00354 sensor_msgs/PointCloud2 cluster_a
00355 sensor_msgs/PointCloud2 cluster_b
00356 sensor_msgs/Image cluster_a_img
00357 sensor_msgs/Image cluster_b_img
00358 
00359 
00360 ================================================================================
00361 MSG: sensor_msgs/PointCloud2
00362 # This message holds a collection of N-dimensional points, which may
00363 # contain additional information such as normals, intensity, etc. The
00364 # point data is stored as a binary blob, its layout described by the
00365 # contents of the "fields" array.
00366 
00367 # The point cloud data may be organized 2d (image-like) or 1d
00368 # (unordered). Point clouds organized as 2d images may be produced by
00369 # camera depth sensors such as stereo or time-of-flight.
00370 
00371 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00372 # points).
00373 Header header
00374 
00375 # 2D structure of the point cloud. If the cloud is unordered, height is
00376 # 1 and width is the length of the point cloud.
00377 uint32 height
00378 uint32 width
00379 
00380 # Describes the channels and their layout in the binary data blob.
00381 PointField[] fields
00382 
00383 bool    is_bigendian # Is this data bigendian?
00384 uint32  point_step   # Length of a point in bytes
00385 uint32  row_step     # Length of a row in bytes
00386 uint8[] data         # Actual point data, size is (row_step*height)
00387 
00388 bool is_dense        # True if there are no invalid points
00389 
00390 ================================================================================
00391 MSG: std_msgs/Header
00392 # Standard metadata for higher-level stamped data types.
00393 # This is generally used to communicate timestamped data 
00394 # in a particular coordinate frame.
00395 # 
00396 # sequence ID: consecutively increasing ID 
00397 uint32 seq
00398 #Two-integer timestamp that is expressed as:
00399 # * stamp.secs: seconds (stamp_secs) since epoch
00400 # * stamp.nsecs: nanoseconds since stamp_secs
00401 # time-handling sugar is provided by the client library
00402 time stamp
00403 #Frame this data is associated with
00404 # 0: no frame
00405 # 1: global frame
00406 string frame_id
00407 
00408 ================================================================================
00409 MSG: sensor_msgs/PointField
00410 # This message holds the description of one point entry in the
00411 # PointCloud2 message format.
00412 uint8 INT8    = 1
00413 uint8 UINT8   = 2
00414 uint8 INT16   = 3
00415 uint8 UINT16  = 4
00416 uint8 INT32   = 5
00417 uint8 UINT32  = 6
00418 uint8 FLOAT32 = 7
00419 uint8 FLOAT64 = 8
00420 
00421 string name      # Name of field
00422 uint32 offset    # Offset from start of point struct
00423 uint8  datatype  # Datatype enumeration, see above
00424 uint32 count     # How many elements in the field
00425 
00426 ================================================================================
00427 MSG: sensor_msgs/Image
00428 # This message contains an uncompressed image
00429 # (0, 0) is at top-left corner of image
00430 #
00431 
00432 Header header        # Header timestamp should be acquisition time of image
00433                      # Header frame_id should be optical frame of camera
00434                      # origin of frame should be optical center of cameara
00435                      # +x should point to the right in the image
00436                      # +y should point down in the image
00437                      # +z should point into to plane of the image
00438                      # If the frame_id here and the frame_id of the CameraInfo
00439                      # message associated with the image conflict
00440                      # the behavior is undefined
00441 
00442 uint32 height         # image height, that is, number of rows
00443 uint32 width          # image width, that is, number of columns
00444 
00445 # The legal values for encoding are in file src/image_encodings.cpp
00446 # If you want to standardize a new string format, join
00447 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00448 
00449 string encoding       # Encoding of pixels -- channel meaning, ordering, size
00450                       # taken from the list of strings in src/image_encodings.cpp
00451 
00452 uint8 is_bigendian    # is this data bigendian?
00453 uint32 step           # Full row length in bytes
00454 uint8[] data          # actual matrix data, size is (step * rows)
00455 
00456 """
00457   __slots__ = ['cluster_a','cluster_b','cluster_a_img','cluster_b_img']
00458   _slot_types = ['sensor_msgs/PointCloud2','sensor_msgs/PointCloud2','sensor_msgs/Image','sensor_msgs/Image']
00459 
00460   def __init__(self, *args, **kwds):
00461     """
00462     Constructor. Any message fields that are implicitly/explicitly
00463     set to None will be assigned a default value. The recommend
00464     use is keyword arguments as this is more robust to future message
00465     changes.  You cannot mix in-order arguments and keyword arguments.
00466 
00467     The available fields are:
00468        cluster_a,cluster_b,cluster_a_img,cluster_b_img
00469 
00470     :param args: complete set of field values, in .msg order
00471     :param kwds: use keyword arguments corresponding to message field names
00472     to set specific fields.
00473     """
00474     if args or kwds:
00475       super(ExtractClustersResponse, self).__init__(*args, **kwds)
00476       #message fields cannot be None, assign default values for those that are
00477       if self.cluster_a is None:
00478         self.cluster_a = sensor_msgs.msg.PointCloud2()
00479       if self.cluster_b is None:
00480         self.cluster_b = sensor_msgs.msg.PointCloud2()
00481       if self.cluster_a_img is None:
00482         self.cluster_a_img = sensor_msgs.msg.Image()
00483       if self.cluster_b_img is None:
00484         self.cluster_b_img = sensor_msgs.msg.Image()
00485     else:
00486       self.cluster_a = sensor_msgs.msg.PointCloud2()
00487       self.cluster_b = sensor_msgs.msg.PointCloud2()
00488       self.cluster_a_img = sensor_msgs.msg.Image()
00489       self.cluster_b_img = sensor_msgs.msg.Image()
00490 
00491   def _get_types(self):
00492     """
00493     internal API method
00494     """
00495     return self._slot_types
00496 
00497   def serialize(self, buff):
00498     """
00499     serialize message into buffer
00500     :param buff: buffer, ``StringIO``
00501     """
00502     try:
00503       _x = self
00504       buff.write(_struct_3I.pack(_x.cluster_a.header.seq, _x.cluster_a.header.stamp.secs, _x.cluster_a.header.stamp.nsecs))
00505       _x = self.cluster_a.header.frame_id
00506       length = len(_x)
00507       if python3 or type(_x) == unicode:
00508         _x = _x.encode('utf-8')
00509         length = len(_x)
00510       buff.write(struct.pack('<I%ss'%length, length, _x))
00511       _x = self
00512       buff.write(_struct_2I.pack(_x.cluster_a.height, _x.cluster_a.width))
00513       length = len(self.cluster_a.fields)
00514       buff.write(_struct_I.pack(length))
00515       for val1 in self.cluster_a.fields:
00516         _x = val1.name
00517         length = len(_x)
00518         if python3 or type(_x) == unicode:
00519           _x = _x.encode('utf-8')
00520           length = len(_x)
00521         buff.write(struct.pack('<I%ss'%length, length, _x))
00522         _x = val1
00523         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00524       _x = self
00525       buff.write(_struct_B2I.pack(_x.cluster_a.is_bigendian, _x.cluster_a.point_step, _x.cluster_a.row_step))
00526       _x = self.cluster_a.data
00527       length = len(_x)
00528       # - if encoded as a list instead, serialize as bytes instead of string
00529       if type(_x) in [list, tuple]:
00530         buff.write(struct.pack('<I%sB'%length, length, *_x))
00531       else:
00532         buff.write(struct.pack('<I%ss'%length, length, _x))
00533       _x = self
00534       buff.write(_struct_B3I.pack(_x.cluster_a.is_dense, _x.cluster_b.header.seq, _x.cluster_b.header.stamp.secs, _x.cluster_b.header.stamp.nsecs))
00535       _x = self.cluster_b.header.frame_id
00536       length = len(_x)
00537       if python3 or type(_x) == unicode:
00538         _x = _x.encode('utf-8')
00539         length = len(_x)
00540       buff.write(struct.pack('<I%ss'%length, length, _x))
00541       _x = self
00542       buff.write(_struct_2I.pack(_x.cluster_b.height, _x.cluster_b.width))
00543       length = len(self.cluster_b.fields)
00544       buff.write(_struct_I.pack(length))
00545       for val1 in self.cluster_b.fields:
00546         _x = val1.name
00547         length = len(_x)
00548         if python3 or type(_x) == unicode:
00549           _x = _x.encode('utf-8')
00550           length = len(_x)
00551         buff.write(struct.pack('<I%ss'%length, length, _x))
00552         _x = val1
00553         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00554       _x = self
00555       buff.write(_struct_B2I.pack(_x.cluster_b.is_bigendian, _x.cluster_b.point_step, _x.cluster_b.row_step))
00556       _x = self.cluster_b.data
00557       length = len(_x)
00558       # - if encoded as a list instead, serialize as bytes instead of string
00559       if type(_x) in [list, tuple]:
00560         buff.write(struct.pack('<I%sB'%length, length, *_x))
00561       else:
00562         buff.write(struct.pack('<I%ss'%length, length, _x))
00563       _x = self
00564       buff.write(_struct_B3I.pack(_x.cluster_b.is_dense, _x.cluster_a_img.header.seq, _x.cluster_a_img.header.stamp.secs, _x.cluster_a_img.header.stamp.nsecs))
00565       _x = self.cluster_a_img.header.frame_id
00566       length = len(_x)
00567       if python3 or type(_x) == unicode:
00568         _x = _x.encode('utf-8')
00569         length = len(_x)
00570       buff.write(struct.pack('<I%ss'%length, length, _x))
00571       _x = self
00572       buff.write(_struct_2I.pack(_x.cluster_a_img.height, _x.cluster_a_img.width))
00573       _x = self.cluster_a_img.encoding
00574       length = len(_x)
00575       if python3 or type(_x) == unicode:
00576         _x = _x.encode('utf-8')
00577         length = len(_x)
00578       buff.write(struct.pack('<I%ss'%length, length, _x))
00579       _x = self
00580       buff.write(_struct_BI.pack(_x.cluster_a_img.is_bigendian, _x.cluster_a_img.step))
00581       _x = self.cluster_a_img.data
00582       length = len(_x)
00583       # - if encoded as a list instead, serialize as bytes instead of string
00584       if type(_x) in [list, tuple]:
00585         buff.write(struct.pack('<I%sB'%length, length, *_x))
00586       else:
00587         buff.write(struct.pack('<I%ss'%length, length, _x))
00588       _x = self
00589       buff.write(_struct_3I.pack(_x.cluster_b_img.header.seq, _x.cluster_b_img.header.stamp.secs, _x.cluster_b_img.header.stamp.nsecs))
00590       _x = self.cluster_b_img.header.frame_id
00591       length = len(_x)
00592       if python3 or type(_x) == unicode:
00593         _x = _x.encode('utf-8')
00594         length = len(_x)
00595       buff.write(struct.pack('<I%ss'%length, length, _x))
00596       _x = self
00597       buff.write(_struct_2I.pack(_x.cluster_b_img.height, _x.cluster_b_img.width))
00598       _x = self.cluster_b_img.encoding
00599       length = len(_x)
00600       if python3 or type(_x) == unicode:
00601         _x = _x.encode('utf-8')
00602         length = len(_x)
00603       buff.write(struct.pack('<I%ss'%length, length, _x))
00604       _x = self
00605       buff.write(_struct_BI.pack(_x.cluster_b_img.is_bigendian, _x.cluster_b_img.step))
00606       _x = self.cluster_b_img.data
00607       length = len(_x)
00608       # - if encoded as a list instead, serialize as bytes instead of string
00609       if type(_x) in [list, tuple]:
00610         buff.write(struct.pack('<I%sB'%length, length, *_x))
00611       else:
00612         buff.write(struct.pack('<I%ss'%length, length, _x))
00613     except struct.error as se: self._check_types(se)
00614     except TypeError as te: self._check_types(te)
00615 
00616   def deserialize(self, str):
00617     """
00618     unpack serialized message in str into this message instance
00619     :param str: byte array of serialized message, ``str``
00620     """
00621     try:
00622       if self.cluster_a is None:
00623         self.cluster_a = sensor_msgs.msg.PointCloud2()
00624       if self.cluster_b is None:
00625         self.cluster_b = sensor_msgs.msg.PointCloud2()
00626       if self.cluster_a_img is None:
00627         self.cluster_a_img = sensor_msgs.msg.Image()
00628       if self.cluster_b_img is None:
00629         self.cluster_b_img = sensor_msgs.msg.Image()
00630       end = 0
00631       _x = self
00632       start = end
00633       end += 12
00634       (_x.cluster_a.header.seq, _x.cluster_a.header.stamp.secs, _x.cluster_a.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00635       start = end
00636       end += 4
00637       (length,) = _struct_I.unpack(str[start:end])
00638       start = end
00639       end += length
00640       if python3:
00641         self.cluster_a.header.frame_id = str[start:end].decode('utf-8')
00642       else:
00643         self.cluster_a.header.frame_id = str[start:end]
00644       _x = self
00645       start = end
00646       end += 8
00647       (_x.cluster_a.height, _x.cluster_a.width,) = _struct_2I.unpack(str[start:end])
00648       start = end
00649       end += 4
00650       (length,) = _struct_I.unpack(str[start:end])
00651       self.cluster_a.fields = []
00652       for i in range(0, length):
00653         val1 = sensor_msgs.msg.PointField()
00654         start = end
00655         end += 4
00656         (length,) = _struct_I.unpack(str[start:end])
00657         start = end
00658         end += length
00659         if python3:
00660           val1.name = str[start:end].decode('utf-8')
00661         else:
00662           val1.name = str[start:end]
00663         _x = val1
00664         start = end
00665         end += 9
00666         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00667         self.cluster_a.fields.append(val1)
00668       _x = self
00669       start = end
00670       end += 9
00671       (_x.cluster_a.is_bigendian, _x.cluster_a.point_step, _x.cluster_a.row_step,) = _struct_B2I.unpack(str[start:end])
00672       self.cluster_a.is_bigendian = bool(self.cluster_a.is_bigendian)
00673       start = end
00674       end += 4
00675       (length,) = _struct_I.unpack(str[start:end])
00676       start = end
00677       end += length
00678       if python3:
00679         self.cluster_a.data = str[start:end].decode('utf-8')
00680       else:
00681         self.cluster_a.data = str[start:end]
00682       _x = self
00683       start = end
00684       end += 13
00685       (_x.cluster_a.is_dense, _x.cluster_b.header.seq, _x.cluster_b.header.stamp.secs, _x.cluster_b.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
00686       self.cluster_a.is_dense = bool(self.cluster_a.is_dense)
00687       start = end
00688       end += 4
00689       (length,) = _struct_I.unpack(str[start:end])
00690       start = end
00691       end += length
00692       if python3:
00693         self.cluster_b.header.frame_id = str[start:end].decode('utf-8')
00694       else:
00695         self.cluster_b.header.frame_id = str[start:end]
00696       _x = self
00697       start = end
00698       end += 8
00699       (_x.cluster_b.height, _x.cluster_b.width,) = _struct_2I.unpack(str[start:end])
00700       start = end
00701       end += 4
00702       (length,) = _struct_I.unpack(str[start:end])
00703       self.cluster_b.fields = []
00704       for i in range(0, length):
00705         val1 = sensor_msgs.msg.PointField()
00706         start = end
00707         end += 4
00708         (length,) = _struct_I.unpack(str[start:end])
00709         start = end
00710         end += length
00711         if python3:
00712           val1.name = str[start:end].decode('utf-8')
00713         else:
00714           val1.name = str[start:end]
00715         _x = val1
00716         start = end
00717         end += 9
00718         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00719         self.cluster_b.fields.append(val1)
00720       _x = self
00721       start = end
00722       end += 9
00723       (_x.cluster_b.is_bigendian, _x.cluster_b.point_step, _x.cluster_b.row_step,) = _struct_B2I.unpack(str[start:end])
00724       self.cluster_b.is_bigendian = bool(self.cluster_b.is_bigendian)
00725       start = end
00726       end += 4
00727       (length,) = _struct_I.unpack(str[start:end])
00728       start = end
00729       end += length
00730       if python3:
00731         self.cluster_b.data = str[start:end].decode('utf-8')
00732       else:
00733         self.cluster_b.data = str[start:end]
00734       _x = self
00735       start = end
00736       end += 13
00737       (_x.cluster_b.is_dense, _x.cluster_a_img.header.seq, _x.cluster_a_img.header.stamp.secs, _x.cluster_a_img.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
00738       self.cluster_b.is_dense = bool(self.cluster_b.is_dense)
00739       start = end
00740       end += 4
00741       (length,) = _struct_I.unpack(str[start:end])
00742       start = end
00743       end += length
00744       if python3:
00745         self.cluster_a_img.header.frame_id = str[start:end].decode('utf-8')
00746       else:
00747         self.cluster_a_img.header.frame_id = str[start:end]
00748       _x = self
00749       start = end
00750       end += 8
00751       (_x.cluster_a_img.height, _x.cluster_a_img.width,) = _struct_2I.unpack(str[start:end])
00752       start = end
00753       end += 4
00754       (length,) = _struct_I.unpack(str[start:end])
00755       start = end
00756       end += length
00757       if python3:
00758         self.cluster_a_img.encoding = str[start:end].decode('utf-8')
00759       else:
00760         self.cluster_a_img.encoding = str[start:end]
00761       _x = self
00762       start = end
00763       end += 5
00764       (_x.cluster_a_img.is_bigendian, _x.cluster_a_img.step,) = _struct_BI.unpack(str[start:end])
00765       start = end
00766       end += 4
00767       (length,) = _struct_I.unpack(str[start:end])
00768       start = end
00769       end += length
00770       if python3:
00771         self.cluster_a_img.data = str[start:end].decode('utf-8')
00772       else:
00773         self.cluster_a_img.data = str[start:end]
00774       _x = self
00775       start = end
00776       end += 12
00777       (_x.cluster_b_img.header.seq, _x.cluster_b_img.header.stamp.secs, _x.cluster_b_img.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00778       start = end
00779       end += 4
00780       (length,) = _struct_I.unpack(str[start:end])
00781       start = end
00782       end += length
00783       if python3:
00784         self.cluster_b_img.header.frame_id = str[start:end].decode('utf-8')
00785       else:
00786         self.cluster_b_img.header.frame_id = str[start:end]
00787       _x = self
00788       start = end
00789       end += 8
00790       (_x.cluster_b_img.height, _x.cluster_b_img.width,) = _struct_2I.unpack(str[start:end])
00791       start = end
00792       end += 4
00793       (length,) = _struct_I.unpack(str[start:end])
00794       start = end
00795       end += length
00796       if python3:
00797         self.cluster_b_img.encoding = str[start:end].decode('utf-8')
00798       else:
00799         self.cluster_b_img.encoding = str[start:end]
00800       _x = self
00801       start = end
00802       end += 5
00803       (_x.cluster_b_img.is_bigendian, _x.cluster_b_img.step,) = _struct_BI.unpack(str[start:end])
00804       start = end
00805       end += 4
00806       (length,) = _struct_I.unpack(str[start:end])
00807       start = end
00808       end += length
00809       if python3:
00810         self.cluster_b_img.data = str[start:end].decode('utf-8')
00811       else:
00812         self.cluster_b_img.data = str[start:end]
00813       return self
00814     except struct.error as e:
00815       raise genpy.DeserializationError(e) #most likely buffer underfill
00816 
00817 
00818   def serialize_numpy(self, buff, numpy):
00819     """
00820     serialize message with numpy array types into buffer
00821     :param buff: buffer, ``StringIO``
00822     :param numpy: numpy python module
00823     """
00824     try:
00825       _x = self
00826       buff.write(_struct_3I.pack(_x.cluster_a.header.seq, _x.cluster_a.header.stamp.secs, _x.cluster_a.header.stamp.nsecs))
00827       _x = self.cluster_a.header.frame_id
00828       length = len(_x)
00829       if python3 or type(_x) == unicode:
00830         _x = _x.encode('utf-8')
00831         length = len(_x)
00832       buff.write(struct.pack('<I%ss'%length, length, _x))
00833       _x = self
00834       buff.write(_struct_2I.pack(_x.cluster_a.height, _x.cluster_a.width))
00835       length = len(self.cluster_a.fields)
00836       buff.write(_struct_I.pack(length))
00837       for val1 in self.cluster_a.fields:
00838         _x = val1.name
00839         length = len(_x)
00840         if python3 or type(_x) == unicode:
00841           _x = _x.encode('utf-8')
00842           length = len(_x)
00843         buff.write(struct.pack('<I%ss'%length, length, _x))
00844         _x = val1
00845         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00846       _x = self
00847       buff.write(_struct_B2I.pack(_x.cluster_a.is_bigendian, _x.cluster_a.point_step, _x.cluster_a.row_step))
00848       _x = self.cluster_a.data
00849       length = len(_x)
00850       # - if encoded as a list instead, serialize as bytes instead of string
00851       if type(_x) in [list, tuple]:
00852         buff.write(struct.pack('<I%sB'%length, length, *_x))
00853       else:
00854         buff.write(struct.pack('<I%ss'%length, length, _x))
00855       _x = self
00856       buff.write(_struct_B3I.pack(_x.cluster_a.is_dense, _x.cluster_b.header.seq, _x.cluster_b.header.stamp.secs, _x.cluster_b.header.stamp.nsecs))
00857       _x = self.cluster_b.header.frame_id
00858       length = len(_x)
00859       if python3 or type(_x) == unicode:
00860         _x = _x.encode('utf-8')
00861         length = len(_x)
00862       buff.write(struct.pack('<I%ss'%length, length, _x))
00863       _x = self
00864       buff.write(_struct_2I.pack(_x.cluster_b.height, _x.cluster_b.width))
00865       length = len(self.cluster_b.fields)
00866       buff.write(_struct_I.pack(length))
00867       for val1 in self.cluster_b.fields:
00868         _x = val1.name
00869         length = len(_x)
00870         if python3 or type(_x) == unicode:
00871           _x = _x.encode('utf-8')
00872           length = len(_x)
00873         buff.write(struct.pack('<I%ss'%length, length, _x))
00874         _x = val1
00875         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00876       _x = self
00877       buff.write(_struct_B2I.pack(_x.cluster_b.is_bigendian, _x.cluster_b.point_step, _x.cluster_b.row_step))
00878       _x = self.cluster_b.data
00879       length = len(_x)
00880       # - if encoded as a list instead, serialize as bytes instead of string
00881       if type(_x) in [list, tuple]:
00882         buff.write(struct.pack('<I%sB'%length, length, *_x))
00883       else:
00884         buff.write(struct.pack('<I%ss'%length, length, _x))
00885       _x = self
00886       buff.write(_struct_B3I.pack(_x.cluster_b.is_dense, _x.cluster_a_img.header.seq, _x.cluster_a_img.header.stamp.secs, _x.cluster_a_img.header.stamp.nsecs))
00887       _x = self.cluster_a_img.header.frame_id
00888       length = len(_x)
00889       if python3 or type(_x) == unicode:
00890         _x = _x.encode('utf-8')
00891         length = len(_x)
00892       buff.write(struct.pack('<I%ss'%length, length, _x))
00893       _x = self
00894       buff.write(_struct_2I.pack(_x.cluster_a_img.height, _x.cluster_a_img.width))
00895       _x = self.cluster_a_img.encoding
00896       length = len(_x)
00897       if python3 or type(_x) == unicode:
00898         _x = _x.encode('utf-8')
00899         length = len(_x)
00900       buff.write(struct.pack('<I%ss'%length, length, _x))
00901       _x = self
00902       buff.write(_struct_BI.pack(_x.cluster_a_img.is_bigendian, _x.cluster_a_img.step))
00903       _x = self.cluster_a_img.data
00904       length = len(_x)
00905       # - if encoded as a list instead, serialize as bytes instead of string
00906       if type(_x) in [list, tuple]:
00907         buff.write(struct.pack('<I%sB'%length, length, *_x))
00908       else:
00909         buff.write(struct.pack('<I%ss'%length, length, _x))
00910       _x = self
00911       buff.write(_struct_3I.pack(_x.cluster_b_img.header.seq, _x.cluster_b_img.header.stamp.secs, _x.cluster_b_img.header.stamp.nsecs))
00912       _x = self.cluster_b_img.header.frame_id
00913       length = len(_x)
00914       if python3 or type(_x) == unicode:
00915         _x = _x.encode('utf-8')
00916         length = len(_x)
00917       buff.write(struct.pack('<I%ss'%length, length, _x))
00918       _x = self
00919       buff.write(_struct_2I.pack(_x.cluster_b_img.height, _x.cluster_b_img.width))
00920       _x = self.cluster_b_img.encoding
00921       length = len(_x)
00922       if python3 or type(_x) == unicode:
00923         _x = _x.encode('utf-8')
00924         length = len(_x)
00925       buff.write(struct.pack('<I%ss'%length, length, _x))
00926       _x = self
00927       buff.write(_struct_BI.pack(_x.cluster_b_img.is_bigendian, _x.cluster_b_img.step))
00928       _x = self.cluster_b_img.data
00929       length = len(_x)
00930       # - if encoded as a list instead, serialize as bytes instead of string
00931       if type(_x) in [list, tuple]:
00932         buff.write(struct.pack('<I%sB'%length, length, *_x))
00933       else:
00934         buff.write(struct.pack('<I%ss'%length, length, _x))
00935     except struct.error as se: self._check_types(se)
00936     except TypeError as te: self._check_types(te)
00937 
00938   def deserialize_numpy(self, str, numpy):
00939     """
00940     unpack serialized message in str into this message instance using numpy for array types
00941     :param str: byte array of serialized message, ``str``
00942     :param numpy: numpy python module
00943     """
00944     try:
00945       if self.cluster_a is None:
00946         self.cluster_a = sensor_msgs.msg.PointCloud2()
00947       if self.cluster_b is None:
00948         self.cluster_b = sensor_msgs.msg.PointCloud2()
00949       if self.cluster_a_img is None:
00950         self.cluster_a_img = sensor_msgs.msg.Image()
00951       if self.cluster_b_img is None:
00952         self.cluster_b_img = sensor_msgs.msg.Image()
00953       end = 0
00954       _x = self
00955       start = end
00956       end += 12
00957       (_x.cluster_a.header.seq, _x.cluster_a.header.stamp.secs, _x.cluster_a.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00958       start = end
00959       end += 4
00960       (length,) = _struct_I.unpack(str[start:end])
00961       start = end
00962       end += length
00963       if python3:
00964         self.cluster_a.header.frame_id = str[start:end].decode('utf-8')
00965       else:
00966         self.cluster_a.header.frame_id = str[start:end]
00967       _x = self
00968       start = end
00969       end += 8
00970       (_x.cluster_a.height, _x.cluster_a.width,) = _struct_2I.unpack(str[start:end])
00971       start = end
00972       end += 4
00973       (length,) = _struct_I.unpack(str[start:end])
00974       self.cluster_a.fields = []
00975       for i in range(0, length):
00976         val1 = sensor_msgs.msg.PointField()
00977         start = end
00978         end += 4
00979         (length,) = _struct_I.unpack(str[start:end])
00980         start = end
00981         end += length
00982         if python3:
00983           val1.name = str[start:end].decode('utf-8')
00984         else:
00985           val1.name = str[start:end]
00986         _x = val1
00987         start = end
00988         end += 9
00989         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00990         self.cluster_a.fields.append(val1)
00991       _x = self
00992       start = end
00993       end += 9
00994       (_x.cluster_a.is_bigendian, _x.cluster_a.point_step, _x.cluster_a.row_step,) = _struct_B2I.unpack(str[start:end])
00995       self.cluster_a.is_bigendian = bool(self.cluster_a.is_bigendian)
00996       start = end
00997       end += 4
00998       (length,) = _struct_I.unpack(str[start:end])
00999       start = end
01000       end += length
01001       if python3:
01002         self.cluster_a.data = str[start:end].decode('utf-8')
01003       else:
01004         self.cluster_a.data = str[start:end]
01005       _x = self
01006       start = end
01007       end += 13
01008       (_x.cluster_a.is_dense, _x.cluster_b.header.seq, _x.cluster_b.header.stamp.secs, _x.cluster_b.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
01009       self.cluster_a.is_dense = bool(self.cluster_a.is_dense)
01010       start = end
01011       end += 4
01012       (length,) = _struct_I.unpack(str[start:end])
01013       start = end
01014       end += length
01015       if python3:
01016         self.cluster_b.header.frame_id = str[start:end].decode('utf-8')
01017       else:
01018         self.cluster_b.header.frame_id = str[start:end]
01019       _x = self
01020       start = end
01021       end += 8
01022       (_x.cluster_b.height, _x.cluster_b.width,) = _struct_2I.unpack(str[start:end])
01023       start = end
01024       end += 4
01025       (length,) = _struct_I.unpack(str[start:end])
01026       self.cluster_b.fields = []
01027       for i in range(0, length):
01028         val1 = sensor_msgs.msg.PointField()
01029         start = end
01030         end += 4
01031         (length,) = _struct_I.unpack(str[start:end])
01032         start = end
01033         end += length
01034         if python3:
01035           val1.name = str[start:end].decode('utf-8')
01036         else:
01037           val1.name = str[start:end]
01038         _x = val1
01039         start = end
01040         end += 9
01041         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
01042         self.cluster_b.fields.append(val1)
01043       _x = self
01044       start = end
01045       end += 9
01046       (_x.cluster_b.is_bigendian, _x.cluster_b.point_step, _x.cluster_b.row_step,) = _struct_B2I.unpack(str[start:end])
01047       self.cluster_b.is_bigendian = bool(self.cluster_b.is_bigendian)
01048       start = end
01049       end += 4
01050       (length,) = _struct_I.unpack(str[start:end])
01051       start = end
01052       end += length
01053       if python3:
01054         self.cluster_b.data = str[start:end].decode('utf-8')
01055       else:
01056         self.cluster_b.data = str[start:end]
01057       _x = self
01058       start = end
01059       end += 13
01060       (_x.cluster_b.is_dense, _x.cluster_a_img.header.seq, _x.cluster_a_img.header.stamp.secs, _x.cluster_a_img.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
01061       self.cluster_b.is_dense = bool(self.cluster_b.is_dense)
01062       start = end
01063       end += 4
01064       (length,) = _struct_I.unpack(str[start:end])
01065       start = end
01066       end += length
01067       if python3:
01068         self.cluster_a_img.header.frame_id = str[start:end].decode('utf-8')
01069       else:
01070         self.cluster_a_img.header.frame_id = str[start:end]
01071       _x = self
01072       start = end
01073       end += 8
01074       (_x.cluster_a_img.height, _x.cluster_a_img.width,) = _struct_2I.unpack(str[start:end])
01075       start = end
01076       end += 4
01077       (length,) = _struct_I.unpack(str[start:end])
01078       start = end
01079       end += length
01080       if python3:
01081         self.cluster_a_img.encoding = str[start:end].decode('utf-8')
01082       else:
01083         self.cluster_a_img.encoding = str[start:end]
01084       _x = self
01085       start = end
01086       end += 5
01087       (_x.cluster_a_img.is_bigendian, _x.cluster_a_img.step,) = _struct_BI.unpack(str[start:end])
01088       start = end
01089       end += 4
01090       (length,) = _struct_I.unpack(str[start:end])
01091       start = end
01092       end += length
01093       if python3:
01094         self.cluster_a_img.data = str[start:end].decode('utf-8')
01095       else:
01096         self.cluster_a_img.data = str[start:end]
01097       _x = self
01098       start = end
01099       end += 12
01100       (_x.cluster_b_img.header.seq, _x.cluster_b_img.header.stamp.secs, _x.cluster_b_img.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01101       start = end
01102       end += 4
01103       (length,) = _struct_I.unpack(str[start:end])
01104       start = end
01105       end += length
01106       if python3:
01107         self.cluster_b_img.header.frame_id = str[start:end].decode('utf-8')
01108       else:
01109         self.cluster_b_img.header.frame_id = str[start:end]
01110       _x = self
01111       start = end
01112       end += 8
01113       (_x.cluster_b_img.height, _x.cluster_b_img.width,) = _struct_2I.unpack(str[start:end])
01114       start = end
01115       end += 4
01116       (length,) = _struct_I.unpack(str[start:end])
01117       start = end
01118       end += length
01119       if python3:
01120         self.cluster_b_img.encoding = str[start:end].decode('utf-8')
01121       else:
01122         self.cluster_b_img.encoding = str[start:end]
01123       _x = self
01124       start = end
01125       end += 5
01126       (_x.cluster_b_img.is_bigendian, _x.cluster_b_img.step,) = _struct_BI.unpack(str[start:end])
01127       start = end
01128       end += 4
01129       (length,) = _struct_I.unpack(str[start:end])
01130       start = end
01131       end += length
01132       if python3:
01133         self.cluster_b_img.data = str[start:end].decode('utf-8')
01134       else:
01135         self.cluster_b_img.data = str[start:end]
01136       return self
01137     except struct.error as e:
01138       raise genpy.DeserializationError(e) #most likely buffer underfill
01139 
01140 _struct_I = genpy.struct_I
01141 _struct_IBI = struct.Struct("<IBI")
01142 _struct_BI = struct.Struct("<BI")
01143 _struct_3I = struct.Struct("<3I")
01144 _struct_B3I = struct.Struct("<B3I")
01145 _struct_B2I = struct.Struct("<B2I")
01146 _struct_2I = struct.Struct("<2I")
01147 class ExtractClusters(object):
01148   _type          = 'zyonz_obtain_two_clustered_leaves/ExtractClusters'
01149   _md5sum = '119fae386ed1cae059a2ff29384b0fd8'
01150   _request_class  = ExtractClustersRequest
01151   _response_class = ExtractClustersResponse


zyonz_obtain_two_clustered_leaves
Author(s): sfoix
autogenerated on Fri Dec 6 2013 20:35:16