_GetConfidenceLeafFitting.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_leaf_fitting/GetConfidenceLeafFittingRequest.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 
00009 class GetConfidenceLeafFittingRequest(genpy.Message):
00010   _md5sum = "473c59501c5a8d02d0d0a1bc6ce725b3"
00011   _type = "iri_leaf_fitting/GetConfidenceLeafFittingRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """
00014 std_msgs/UInt32 num_clusters
00015 std_msgs/UInt32MultiArray cluster_labels
00016 
00017 ================================================================================
00018 MSG: std_msgs/UInt32
00019 uint32 data
00020 ================================================================================
00021 MSG: std_msgs/UInt32MultiArray
00022 # Please look at the MultiArrayLayout message definition for
00023 # documentation on all multiarrays.
00024 
00025 MultiArrayLayout  layout        # specification of data layout
00026 uint32[]          data          # array of data
00027 
00028 
00029 ================================================================================
00030 MSG: std_msgs/MultiArrayLayout
00031 # The multiarray declares a generic multi-dimensional array of a
00032 # particular data type.  Dimensions are ordered from outer most
00033 # to inner most.
00034 
00035 MultiArrayDimension[] dim # Array of dimension properties
00036 uint32 data_offset        # padding bytes at front of data
00037 
00038 # Accessors should ALWAYS be written in terms of dimension stride
00039 # and specified outer-most dimension first.
00040 # 
00041 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]
00042 #
00043 # A standard, 3-channel 640x480 image with interleaved color channels
00044 # would be specified as:
00045 #
00046 # dim[0].label  = "height"
00047 # dim[0].size   = 480
00048 # dim[0].stride = 3*640*480 = 921600  (note dim[0] stride is just size of image)
00049 # dim[1].label  = "width"
00050 # dim[1].size   = 640
00051 # dim[1].stride = 3*640 = 1920
00052 # dim[2].label  = "channel"
00053 # dim[2].size   = 3
00054 # dim[2].stride = 3
00055 #
00056 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel.
00057 ================================================================================
00058 MSG: std_msgs/MultiArrayDimension
00059 string label   # label of given dimension
00060 uint32 size    # size of given dimension (in type units)
00061 uint32 stride  # stride of given dimension
00062 """
00063   __slots__ = ['num_clusters','cluster_labels']
00064   _slot_types = ['std_msgs/UInt32','std_msgs/UInt32MultiArray']
00065 
00066   def __init__(self, *args, **kwds):
00067     """
00068     Constructor. Any message fields that are implicitly/explicitly
00069     set to None will be assigned a default value. The recommend
00070     use is keyword arguments as this is more robust to future message
00071     changes.  You cannot mix in-order arguments and keyword arguments.
00072 
00073     The available fields are:
00074        num_clusters,cluster_labels
00075 
00076     :param args: complete set of field values, in .msg order
00077     :param kwds: use keyword arguments corresponding to message field names
00078     to set specific fields.
00079     """
00080     if args or kwds:
00081       super(GetConfidenceLeafFittingRequest, self).__init__(*args, **kwds)
00082       #message fields cannot be None, assign default values for those that are
00083       if self.num_clusters is None:
00084         self.num_clusters = std_msgs.msg.UInt32()
00085       if self.cluster_labels is None:
00086         self.cluster_labels = std_msgs.msg.UInt32MultiArray()
00087     else:
00088       self.num_clusters = std_msgs.msg.UInt32()
00089       self.cluster_labels = std_msgs.msg.UInt32MultiArray()
00090 
00091   def _get_types(self):
00092     """
00093     internal API method
00094     """
00095     return self._slot_types
00096 
00097   def serialize(self, buff):
00098     """
00099     serialize message into buffer
00100     :param buff: buffer, ``StringIO``
00101     """
00102     try:
00103       buff.write(_struct_I.pack(self.num_clusters.data))
00104       length = len(self.cluster_labels.layout.dim)
00105       buff.write(_struct_I.pack(length))
00106       for val1 in self.cluster_labels.layout.dim:
00107         _x = val1.label
00108         length = len(_x)
00109         if python3 or type(_x) == unicode:
00110           _x = _x.encode('utf-8')
00111           length = len(_x)
00112         buff.write(struct.pack('<I%ss'%length, length, _x))
00113         _x = val1
00114         buff.write(_struct_2I.pack(_x.size, _x.stride))
00115       buff.write(_struct_I.pack(self.cluster_labels.layout.data_offset))
00116       length = len(self.cluster_labels.data)
00117       buff.write(_struct_I.pack(length))
00118       pattern = '<%sI'%length
00119       buff.write(struct.pack(pattern, *self.cluster_labels.data))
00120     except struct.error as se: self._check_types(se)
00121     except TypeError as te: self._check_types(te)
00122 
00123   def deserialize(self, str):
00124     """
00125     unpack serialized message in str into this message instance
00126     :param str: byte array of serialized message, ``str``
00127     """
00128     try:
00129       if self.num_clusters is None:
00130         self.num_clusters = std_msgs.msg.UInt32()
00131       if self.cluster_labels is None:
00132         self.cluster_labels = std_msgs.msg.UInt32MultiArray()
00133       end = 0
00134       start = end
00135       end += 4
00136       (self.num_clusters.data,) = _struct_I.unpack(str[start:end])
00137       start = end
00138       end += 4
00139       (length,) = _struct_I.unpack(str[start:end])
00140       self.cluster_labels.layout.dim = []
00141       for i in range(0, length):
00142         val1 = std_msgs.msg.MultiArrayDimension()
00143         start = end
00144         end += 4
00145         (length,) = _struct_I.unpack(str[start:end])
00146         start = end
00147         end += length
00148         if python3:
00149           val1.label = str[start:end].decode('utf-8')
00150         else:
00151           val1.label = str[start:end]
00152         _x = val1
00153         start = end
00154         end += 8
00155         (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00156         self.cluster_labels.layout.dim.append(val1)
00157       start = end
00158       end += 4
00159       (self.cluster_labels.layout.data_offset,) = _struct_I.unpack(str[start:end])
00160       start = end
00161       end += 4
00162       (length,) = _struct_I.unpack(str[start:end])
00163       pattern = '<%sI'%length
00164       start = end
00165       end += struct.calcsize(pattern)
00166       self.cluster_labels.data = struct.unpack(pattern, str[start:end])
00167       return self
00168     except struct.error as e:
00169       raise genpy.DeserializationError(e) #most likely buffer underfill
00170 
00171 
00172   def serialize_numpy(self, buff, numpy):
00173     """
00174     serialize message with numpy array types into buffer
00175     :param buff: buffer, ``StringIO``
00176     :param numpy: numpy python module
00177     """
00178     try:
00179       buff.write(_struct_I.pack(self.num_clusters.data))
00180       length = len(self.cluster_labels.layout.dim)
00181       buff.write(_struct_I.pack(length))
00182       for val1 in self.cluster_labels.layout.dim:
00183         _x = val1.label
00184         length = len(_x)
00185         if python3 or type(_x) == unicode:
00186           _x = _x.encode('utf-8')
00187           length = len(_x)
00188         buff.write(struct.pack('<I%ss'%length, length, _x))
00189         _x = val1
00190         buff.write(_struct_2I.pack(_x.size, _x.stride))
00191       buff.write(_struct_I.pack(self.cluster_labels.layout.data_offset))
00192       length = len(self.cluster_labels.data)
00193       buff.write(_struct_I.pack(length))
00194       pattern = '<%sI'%length
00195       buff.write(self.cluster_labels.data.tostring())
00196     except struct.error as se: self._check_types(se)
00197     except TypeError as te: self._check_types(te)
00198 
00199   def deserialize_numpy(self, str, numpy):
00200     """
00201     unpack serialized message in str into this message instance using numpy for array types
00202     :param str: byte array of serialized message, ``str``
00203     :param numpy: numpy python module
00204     """
00205     try:
00206       if self.num_clusters is None:
00207         self.num_clusters = std_msgs.msg.UInt32()
00208       if self.cluster_labels is None:
00209         self.cluster_labels = std_msgs.msg.UInt32MultiArray()
00210       end = 0
00211       start = end
00212       end += 4
00213       (self.num_clusters.data,) = _struct_I.unpack(str[start:end])
00214       start = end
00215       end += 4
00216       (length,) = _struct_I.unpack(str[start:end])
00217       self.cluster_labels.layout.dim = []
00218       for i in range(0, length):
00219         val1 = std_msgs.msg.MultiArrayDimension()
00220         start = end
00221         end += 4
00222         (length,) = _struct_I.unpack(str[start:end])
00223         start = end
00224         end += length
00225         if python3:
00226           val1.label = str[start:end].decode('utf-8')
00227         else:
00228           val1.label = str[start:end]
00229         _x = val1
00230         start = end
00231         end += 8
00232         (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00233         self.cluster_labels.layout.dim.append(val1)
00234       start = end
00235       end += 4
00236       (self.cluster_labels.layout.data_offset,) = _struct_I.unpack(str[start:end])
00237       start = end
00238       end += 4
00239       (length,) = _struct_I.unpack(str[start:end])
00240       pattern = '<%sI'%length
00241       start = end
00242       end += struct.calcsize(pattern)
00243       self.cluster_labels.data = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00244       return self
00245     except struct.error as e:
00246       raise genpy.DeserializationError(e) #most likely buffer underfill
00247 
00248 _struct_I = genpy.struct_I
00249 _struct_2I = struct.Struct("<2I")
00250 """autogenerated by genpy from iri_leaf_fitting/GetConfidenceLeafFittingResponse.msg. Do not edit."""
00251 import sys
00252 python3 = True if sys.hexversion > 0x03000000 else False
00253 import genpy
00254 import struct
00255 
00256 import std_msgs.msg
00257 
00258 class GetConfidenceLeafFittingResponse(genpy.Message):
00259   _md5sum = "41201d22b68db0e3152abe1a8e7c9281"
00260   _type = "iri_leaf_fitting/GetConfidenceLeafFittingResponse"
00261   _has_header = False #flag to mark the presence of a Header object
00262   _full_text = """
00263 std_msgs/UInt32MultiArray fit_score_list
00264 
00265 
00266 ================================================================================
00267 MSG: std_msgs/UInt32MultiArray
00268 # Please look at the MultiArrayLayout message definition for
00269 # documentation on all multiarrays.
00270 
00271 MultiArrayLayout  layout        # specification of data layout
00272 uint32[]          data          # array of data
00273 
00274 
00275 ================================================================================
00276 MSG: std_msgs/MultiArrayLayout
00277 # The multiarray declares a generic multi-dimensional array of a
00278 # particular data type.  Dimensions are ordered from outer most
00279 # to inner most.
00280 
00281 MultiArrayDimension[] dim # Array of dimension properties
00282 uint32 data_offset        # padding bytes at front of data
00283 
00284 # Accessors should ALWAYS be written in terms of dimension stride
00285 # and specified outer-most dimension first.
00286 # 
00287 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]
00288 #
00289 # A standard, 3-channel 640x480 image with interleaved color channels
00290 # would be specified as:
00291 #
00292 # dim[0].label  = "height"
00293 # dim[0].size   = 480
00294 # dim[0].stride = 3*640*480 = 921600  (note dim[0] stride is just size of image)
00295 # dim[1].label  = "width"
00296 # dim[1].size   = 640
00297 # dim[1].stride = 3*640 = 1920
00298 # dim[2].label  = "channel"
00299 # dim[2].size   = 3
00300 # dim[2].stride = 3
00301 #
00302 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel.
00303 ================================================================================
00304 MSG: std_msgs/MultiArrayDimension
00305 string label   # label of given dimension
00306 uint32 size    # size of given dimension (in type units)
00307 uint32 stride  # stride of given dimension
00308 """
00309   __slots__ = ['fit_score_list']
00310   _slot_types = ['std_msgs/UInt32MultiArray']
00311 
00312   def __init__(self, *args, **kwds):
00313     """
00314     Constructor. Any message fields that are implicitly/explicitly
00315     set to None will be assigned a default value. The recommend
00316     use is keyword arguments as this is more robust to future message
00317     changes.  You cannot mix in-order arguments and keyword arguments.
00318 
00319     The available fields are:
00320        fit_score_list
00321 
00322     :param args: complete set of field values, in .msg order
00323     :param kwds: use keyword arguments corresponding to message field names
00324     to set specific fields.
00325     """
00326     if args or kwds:
00327       super(GetConfidenceLeafFittingResponse, self).__init__(*args, **kwds)
00328       #message fields cannot be None, assign default values for those that are
00329       if self.fit_score_list is None:
00330         self.fit_score_list = std_msgs.msg.UInt32MultiArray()
00331     else:
00332       self.fit_score_list = std_msgs.msg.UInt32MultiArray()
00333 
00334   def _get_types(self):
00335     """
00336     internal API method
00337     """
00338     return self._slot_types
00339 
00340   def serialize(self, buff):
00341     """
00342     serialize message into buffer
00343     :param buff: buffer, ``StringIO``
00344     """
00345     try:
00346       length = len(self.fit_score_list.layout.dim)
00347       buff.write(_struct_I.pack(length))
00348       for val1 in self.fit_score_list.layout.dim:
00349         _x = val1.label
00350         length = len(_x)
00351         if python3 or type(_x) == unicode:
00352           _x = _x.encode('utf-8')
00353           length = len(_x)
00354         buff.write(struct.pack('<I%ss'%length, length, _x))
00355         _x = val1
00356         buff.write(_struct_2I.pack(_x.size, _x.stride))
00357       buff.write(_struct_I.pack(self.fit_score_list.layout.data_offset))
00358       length = len(self.fit_score_list.data)
00359       buff.write(_struct_I.pack(length))
00360       pattern = '<%sI'%length
00361       buff.write(struct.pack(pattern, *self.fit_score_list.data))
00362     except struct.error as se: self._check_types(se)
00363     except TypeError as te: self._check_types(te)
00364 
00365   def deserialize(self, str):
00366     """
00367     unpack serialized message in str into this message instance
00368     :param str: byte array of serialized message, ``str``
00369     """
00370     try:
00371       if self.fit_score_list is None:
00372         self.fit_score_list = std_msgs.msg.UInt32MultiArray()
00373       end = 0
00374       start = end
00375       end += 4
00376       (length,) = _struct_I.unpack(str[start:end])
00377       self.fit_score_list.layout.dim = []
00378       for i in range(0, length):
00379         val1 = std_msgs.msg.MultiArrayDimension()
00380         start = end
00381         end += 4
00382         (length,) = _struct_I.unpack(str[start:end])
00383         start = end
00384         end += length
00385         if python3:
00386           val1.label = str[start:end].decode('utf-8')
00387         else:
00388           val1.label = str[start:end]
00389         _x = val1
00390         start = end
00391         end += 8
00392         (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00393         self.fit_score_list.layout.dim.append(val1)
00394       start = end
00395       end += 4
00396       (self.fit_score_list.layout.data_offset,) = _struct_I.unpack(str[start:end])
00397       start = end
00398       end += 4
00399       (length,) = _struct_I.unpack(str[start:end])
00400       pattern = '<%sI'%length
00401       start = end
00402       end += struct.calcsize(pattern)
00403       self.fit_score_list.data = struct.unpack(pattern, str[start:end])
00404       return self
00405     except struct.error as e:
00406       raise genpy.DeserializationError(e) #most likely buffer underfill
00407 
00408 
00409   def serialize_numpy(self, buff, numpy):
00410     """
00411     serialize message with numpy array types into buffer
00412     :param buff: buffer, ``StringIO``
00413     :param numpy: numpy python module
00414     """
00415     try:
00416       length = len(self.fit_score_list.layout.dim)
00417       buff.write(_struct_I.pack(length))
00418       for val1 in self.fit_score_list.layout.dim:
00419         _x = val1.label
00420         length = len(_x)
00421         if python3 or type(_x) == unicode:
00422           _x = _x.encode('utf-8')
00423           length = len(_x)
00424         buff.write(struct.pack('<I%ss'%length, length, _x))
00425         _x = val1
00426         buff.write(_struct_2I.pack(_x.size, _x.stride))
00427       buff.write(_struct_I.pack(self.fit_score_list.layout.data_offset))
00428       length = len(self.fit_score_list.data)
00429       buff.write(_struct_I.pack(length))
00430       pattern = '<%sI'%length
00431       buff.write(self.fit_score_list.data.tostring())
00432     except struct.error as se: self._check_types(se)
00433     except TypeError as te: self._check_types(te)
00434 
00435   def deserialize_numpy(self, str, numpy):
00436     """
00437     unpack serialized message in str into this message instance using numpy for array types
00438     :param str: byte array of serialized message, ``str``
00439     :param numpy: numpy python module
00440     """
00441     try:
00442       if self.fit_score_list is None:
00443         self.fit_score_list = std_msgs.msg.UInt32MultiArray()
00444       end = 0
00445       start = end
00446       end += 4
00447       (length,) = _struct_I.unpack(str[start:end])
00448       self.fit_score_list.layout.dim = []
00449       for i in range(0, length):
00450         val1 = std_msgs.msg.MultiArrayDimension()
00451         start = end
00452         end += 4
00453         (length,) = _struct_I.unpack(str[start:end])
00454         start = end
00455         end += length
00456         if python3:
00457           val1.label = str[start:end].decode('utf-8')
00458         else:
00459           val1.label = str[start:end]
00460         _x = val1
00461         start = end
00462         end += 8
00463         (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00464         self.fit_score_list.layout.dim.append(val1)
00465       start = end
00466       end += 4
00467       (self.fit_score_list.layout.data_offset,) = _struct_I.unpack(str[start:end])
00468       start = end
00469       end += 4
00470       (length,) = _struct_I.unpack(str[start:end])
00471       pattern = '<%sI'%length
00472       start = end
00473       end += struct.calcsize(pattern)
00474       self.fit_score_list.data = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00475       return self
00476     except struct.error as e:
00477       raise genpy.DeserializationError(e) #most likely buffer underfill
00478 
00479 _struct_I = genpy.struct_I
00480 _struct_2I = struct.Struct("<2I")
00481 class GetConfidenceLeafFitting(object):
00482   _type          = 'iri_leaf_fitting/GetConfidenceLeafFitting'
00483   _md5sum = '0d9578dd9e7a1c5d9ad219f185d38c6d'
00484   _request_class  = GetConfidenceLeafFittingRequest
00485   _response_class = GetConfidenceLeafFittingResponse


iri_leaf_fitting
Author(s): Sergi Foix
autogenerated on Fri Dec 6 2013 20:28:17