_GetClusteredImage.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_leaf_segmentation/GetClusteredImageRequest.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 GetClusteredImageRequest(genpy.Message):
00011   _md5sum = "d8288ab03c94033ddae07988baace1f7"
00012   _type = "iri_leaf_segmentation/GetClusteredImageRequest"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """
00015 sensor_msgs/PointCloud2 point_cloud
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__ = ['point_cloud']
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        point_cloud
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(GetClusteredImageRequest, self).__init__(*args, **kwds)
00103       #message fields cannot be None, assign default values for those that are
00104       if self.point_cloud is None:
00105         self.point_cloud = sensor_msgs.msg.PointCloud2()
00106     else:
00107       self.point_cloud = 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.point_cloud.header.seq, _x.point_cloud.header.stamp.secs, _x.point_cloud.header.stamp.nsecs))
00123       _x = self.point_cloud.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.point_cloud.height, _x.point_cloud.width))
00131       length = len(self.point_cloud.fields)
00132       buff.write(_struct_I.pack(length))
00133       for val1 in self.point_cloud.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.point_cloud.is_bigendian, _x.point_cloud.point_step, _x.point_cloud.row_step))
00144       _x = self.point_cloud.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.point_cloud.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.point_cloud is None:
00162         self.point_cloud = sensor_msgs.msg.PointCloud2()
00163       end = 0
00164       _x = self
00165       start = end
00166       end += 12
00167       (_x.point_cloud.header.seq, _x.point_cloud.header.stamp.secs, _x.point_cloud.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.point_cloud.header.frame_id = str[start:end].decode('utf-8')
00175       else:
00176         self.point_cloud.header.frame_id = str[start:end]
00177       _x = self
00178       start = end
00179       end += 8
00180       (_x.point_cloud.height, _x.point_cloud.width,) = _struct_2I.unpack(str[start:end])
00181       start = end
00182       end += 4
00183       (length,) = _struct_I.unpack(str[start:end])
00184       self.point_cloud.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.point_cloud.fields.append(val1)
00201       _x = self
00202       start = end
00203       end += 9
00204       (_x.point_cloud.is_bigendian, _x.point_cloud.point_step, _x.point_cloud.row_step,) = _struct_B2I.unpack(str[start:end])
00205       self.point_cloud.is_bigendian = bool(self.point_cloud.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.point_cloud.data = str[start:end].decode('utf-8')
00213       else:
00214         self.point_cloud.data = str[start:end]
00215       start = end
00216       end += 1
00217       (self.point_cloud.is_dense,) = _struct_B.unpack(str[start:end])
00218       self.point_cloud.is_dense = bool(self.point_cloud.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.point_cloud.header.seq, _x.point_cloud.header.stamp.secs, _x.point_cloud.header.stamp.nsecs))
00233       _x = self.point_cloud.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.point_cloud.height, _x.point_cloud.width))
00241       length = len(self.point_cloud.fields)
00242       buff.write(_struct_I.pack(length))
00243       for val1 in self.point_cloud.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.point_cloud.is_bigendian, _x.point_cloud.point_step, _x.point_cloud.row_step))
00254       _x = self.point_cloud.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.point_cloud.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.point_cloud is None:
00273         self.point_cloud = sensor_msgs.msg.PointCloud2()
00274       end = 0
00275       _x = self
00276       start = end
00277       end += 12
00278       (_x.point_cloud.header.seq, _x.point_cloud.header.stamp.secs, _x.point_cloud.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.point_cloud.header.frame_id = str[start:end].decode('utf-8')
00286       else:
00287         self.point_cloud.header.frame_id = str[start:end]
00288       _x = self
00289       start = end
00290       end += 8
00291       (_x.point_cloud.height, _x.point_cloud.width,) = _struct_2I.unpack(str[start:end])
00292       start = end
00293       end += 4
00294       (length,) = _struct_I.unpack(str[start:end])
00295       self.point_cloud.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.point_cloud.fields.append(val1)
00312       _x = self
00313       start = end
00314       end += 9
00315       (_x.point_cloud.is_bigendian, _x.point_cloud.point_step, _x.point_cloud.row_step,) = _struct_B2I.unpack(str[start:end])
00316       self.point_cloud.is_bigendian = bool(self.point_cloud.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.point_cloud.data = str[start:end].decode('utf-8')
00324       else:
00325         self.point_cloud.data = str[start:end]
00326       start = end
00327       end += 1
00328       (self.point_cloud.is_dense,) = _struct_B.unpack(str[start:end])
00329       self.point_cloud.is_dense = bool(self.point_cloud.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 iri_leaf_segmentation/GetClusteredImageResponse.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 
00348 class GetClusteredImageResponse(genpy.Message):
00349   _md5sum = "473c59501c5a8d02d0d0a1bc6ce725b3"
00350   _type = "iri_leaf_segmentation/GetClusteredImageResponse"
00351   _has_header = False #flag to mark the presence of a Header object
00352   _full_text = """
00353 std_msgs/UInt32 num_clusters
00354 std_msgs/UInt32MultiArray cluster_labels
00355 
00356 
00357 ================================================================================
00358 MSG: std_msgs/UInt32
00359 uint32 data
00360 ================================================================================
00361 MSG: std_msgs/UInt32MultiArray
00362 # Please look at the MultiArrayLayout message definition for
00363 # documentation on all multiarrays.
00364 
00365 MultiArrayLayout  layout        # specification of data layout
00366 uint32[]          data          # array of data
00367 
00368 
00369 ================================================================================
00370 MSG: std_msgs/MultiArrayLayout
00371 # The multiarray declares a generic multi-dimensional array of a
00372 # particular data type.  Dimensions are ordered from outer most
00373 # to inner most.
00374 
00375 MultiArrayDimension[] dim # Array of dimension properties
00376 uint32 data_offset        # padding bytes at front of data
00377 
00378 # Accessors should ALWAYS be written in terms of dimension stride
00379 # and specified outer-most dimension first.
00380 # 
00381 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]
00382 #
00383 # A standard, 3-channel 640x480 image with interleaved color channels
00384 # would be specified as:
00385 #
00386 # dim[0].label  = "height"
00387 # dim[0].size   = 480
00388 # dim[0].stride = 3*640*480 = 921600  (note dim[0] stride is just size of image)
00389 # dim[1].label  = "width"
00390 # dim[1].size   = 640
00391 # dim[1].stride = 3*640 = 1920
00392 # dim[2].label  = "channel"
00393 # dim[2].size   = 3
00394 # dim[2].stride = 3
00395 #
00396 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel.
00397 ================================================================================
00398 MSG: std_msgs/MultiArrayDimension
00399 string label   # label of given dimension
00400 uint32 size    # size of given dimension (in type units)
00401 uint32 stride  # stride of given dimension
00402 """
00403   __slots__ = ['num_clusters','cluster_labels']
00404   _slot_types = ['std_msgs/UInt32','std_msgs/UInt32MultiArray']
00405 
00406   def __init__(self, *args, **kwds):
00407     """
00408     Constructor. Any message fields that are implicitly/explicitly
00409     set to None will be assigned a default value. The recommend
00410     use is keyword arguments as this is more robust to future message
00411     changes.  You cannot mix in-order arguments and keyword arguments.
00412 
00413     The available fields are:
00414        num_clusters,cluster_labels
00415 
00416     :param args: complete set of field values, in .msg order
00417     :param kwds: use keyword arguments corresponding to message field names
00418     to set specific fields.
00419     """
00420     if args or kwds:
00421       super(GetClusteredImageResponse, self).__init__(*args, **kwds)
00422       #message fields cannot be None, assign default values for those that are
00423       if self.num_clusters is None:
00424         self.num_clusters = std_msgs.msg.UInt32()
00425       if self.cluster_labels is None:
00426         self.cluster_labels = std_msgs.msg.UInt32MultiArray()
00427     else:
00428       self.num_clusters = std_msgs.msg.UInt32()
00429       self.cluster_labels = std_msgs.msg.UInt32MultiArray()
00430 
00431   def _get_types(self):
00432     """
00433     internal API method
00434     """
00435     return self._slot_types
00436 
00437   def serialize(self, buff):
00438     """
00439     serialize message into buffer
00440     :param buff: buffer, ``StringIO``
00441     """
00442     try:
00443       buff.write(_struct_I.pack(self.num_clusters.data))
00444       length = len(self.cluster_labels.layout.dim)
00445       buff.write(_struct_I.pack(length))
00446       for val1 in self.cluster_labels.layout.dim:
00447         _x = val1.label
00448         length = len(_x)
00449         if python3 or type(_x) == unicode:
00450           _x = _x.encode('utf-8')
00451           length = len(_x)
00452         buff.write(struct.pack('<I%ss'%length, length, _x))
00453         _x = val1
00454         buff.write(_struct_2I.pack(_x.size, _x.stride))
00455       buff.write(_struct_I.pack(self.cluster_labels.layout.data_offset))
00456       length = len(self.cluster_labels.data)
00457       buff.write(_struct_I.pack(length))
00458       pattern = '<%sI'%length
00459       buff.write(struct.pack(pattern, *self.cluster_labels.data))
00460     except struct.error as se: self._check_types(se)
00461     except TypeError as te: self._check_types(te)
00462 
00463   def deserialize(self, str):
00464     """
00465     unpack serialized message in str into this message instance
00466     :param str: byte array of serialized message, ``str``
00467     """
00468     try:
00469       if self.num_clusters is None:
00470         self.num_clusters = std_msgs.msg.UInt32()
00471       if self.cluster_labels is None:
00472         self.cluster_labels = std_msgs.msg.UInt32MultiArray()
00473       end = 0
00474       start = end
00475       end += 4
00476       (self.num_clusters.data,) = _struct_I.unpack(str[start:end])
00477       start = end
00478       end += 4
00479       (length,) = _struct_I.unpack(str[start:end])
00480       self.cluster_labels.layout.dim = []
00481       for i in range(0, length):
00482         val1 = std_msgs.msg.MultiArrayDimension()
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.label = str[start:end].decode('utf-8')
00490         else:
00491           val1.label = str[start:end]
00492         _x = val1
00493         start = end
00494         end += 8
00495         (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00496         self.cluster_labels.layout.dim.append(val1)
00497       start = end
00498       end += 4
00499       (self.cluster_labels.layout.data_offset,) = _struct_I.unpack(str[start:end])
00500       start = end
00501       end += 4
00502       (length,) = _struct_I.unpack(str[start:end])
00503       pattern = '<%sI'%length
00504       start = end
00505       end += struct.calcsize(pattern)
00506       self.cluster_labels.data = struct.unpack(pattern, str[start:end])
00507       return self
00508     except struct.error as e:
00509       raise genpy.DeserializationError(e) #most likely buffer underfill
00510 
00511 
00512   def serialize_numpy(self, buff, numpy):
00513     """
00514     serialize message with numpy array types into buffer
00515     :param buff: buffer, ``StringIO``
00516     :param numpy: numpy python module
00517     """
00518     try:
00519       buff.write(_struct_I.pack(self.num_clusters.data))
00520       length = len(self.cluster_labels.layout.dim)
00521       buff.write(_struct_I.pack(length))
00522       for val1 in self.cluster_labels.layout.dim:
00523         _x = val1.label
00524         length = len(_x)
00525         if python3 or type(_x) == unicode:
00526           _x = _x.encode('utf-8')
00527           length = len(_x)
00528         buff.write(struct.pack('<I%ss'%length, length, _x))
00529         _x = val1
00530         buff.write(_struct_2I.pack(_x.size, _x.stride))
00531       buff.write(_struct_I.pack(self.cluster_labels.layout.data_offset))
00532       length = len(self.cluster_labels.data)
00533       buff.write(_struct_I.pack(length))
00534       pattern = '<%sI'%length
00535       buff.write(self.cluster_labels.data.tostring())
00536     except struct.error as se: self._check_types(se)
00537     except TypeError as te: self._check_types(te)
00538 
00539   def deserialize_numpy(self, str, numpy):
00540     """
00541     unpack serialized message in str into this message instance using numpy for array types
00542     :param str: byte array of serialized message, ``str``
00543     :param numpy: numpy python module
00544     """
00545     try:
00546       if self.num_clusters is None:
00547         self.num_clusters = std_msgs.msg.UInt32()
00548       if self.cluster_labels is None:
00549         self.cluster_labels = std_msgs.msg.UInt32MultiArray()
00550       end = 0
00551       start = end
00552       end += 4
00553       (self.num_clusters.data,) = _struct_I.unpack(str[start:end])
00554       start = end
00555       end += 4
00556       (length,) = _struct_I.unpack(str[start:end])
00557       self.cluster_labels.layout.dim = []
00558       for i in range(0, length):
00559         val1 = std_msgs.msg.MultiArrayDimension()
00560         start = end
00561         end += 4
00562         (length,) = _struct_I.unpack(str[start:end])
00563         start = end
00564         end += length
00565         if python3:
00566           val1.label = str[start:end].decode('utf-8')
00567         else:
00568           val1.label = str[start:end]
00569         _x = val1
00570         start = end
00571         end += 8
00572         (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00573         self.cluster_labels.layout.dim.append(val1)
00574       start = end
00575       end += 4
00576       (self.cluster_labels.layout.data_offset,) = _struct_I.unpack(str[start:end])
00577       start = end
00578       end += 4
00579       (length,) = _struct_I.unpack(str[start:end])
00580       pattern = '<%sI'%length
00581       start = end
00582       end += struct.calcsize(pattern)
00583       self.cluster_labels.data = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00584       return self
00585     except struct.error as e:
00586       raise genpy.DeserializationError(e) #most likely buffer underfill
00587 
00588 _struct_I = genpy.struct_I
00589 _struct_2I = struct.Struct("<2I")
00590 class GetClusteredImage(object):
00591   _type          = 'iri_leaf_segmentation/GetClusteredImage'
00592   _md5sum = 'c50deb273a1d93ca8b34b168c428c102'
00593   _request_class  = GetClusteredImageRequest
00594   _response_class = GetClusteredImageResponse


iri_leaf_segmentation
Author(s): Sergi Foix
autogenerated on Fri Dec 6 2013 20:27:23