_algorithm_evaluation.py
Go to the documentation of this file.
00001 """autogenerated by genpy from vision_msgs/algorithm_evaluation.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 vision_msgs.msg
00008 
00009 class algorithm_evaluation(genpy.Message):
00010   _md5sum = "e07475feaa79c93a297b4d8386124d13"
00011   _type = "vision_msgs/algorithm_evaluation"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """#Message that contains basic information regarding an algorithm  U. Klank klank@in.tum.de
00014 string                      plugin_name                  # Perception primitive that caused this answer
00015 float64                     basic_evaluation             # A score describing the basic score of this algorithm, should reflect the significance of the results
00016 object_algorithm_relation[] objects                      # All objects that were executed with this algotihm and their results
00017 
00018 ================================================================================
00019 MSG: vision_msgs/object_algorithm_relation
00020 #Message that contains basic information regarding the evaluation of an algorithm and its objects  U. Klank klank@in.tum.de
00021 uint64                      object_id
00022 float64                     basic_evaluation     
00023 
00024 """
00025   __slots__ = ['plugin_name','basic_evaluation','objects']
00026   _slot_types = ['string','float64','vision_msgs/object_algorithm_relation[]']
00027 
00028   def __init__(self, *args, **kwds):
00029     """
00030     Constructor. Any message fields that are implicitly/explicitly
00031     set to None will be assigned a default value. The recommend
00032     use is keyword arguments as this is more robust to future message
00033     changes.  You cannot mix in-order arguments and keyword arguments.
00034 
00035     The available fields are:
00036        plugin_name,basic_evaluation,objects
00037 
00038     :param args: complete set of field values, in .msg order
00039     :param kwds: use keyword arguments corresponding to message field names
00040     to set specific fields.
00041     """
00042     if args or kwds:
00043       super(algorithm_evaluation, self).__init__(*args, **kwds)
00044       #message fields cannot be None, assign default values for those that are
00045       if self.plugin_name is None:
00046         self.plugin_name = ''
00047       if self.basic_evaluation is None:
00048         self.basic_evaluation = 0.
00049       if self.objects is None:
00050         self.objects = []
00051     else:
00052       self.plugin_name = ''
00053       self.basic_evaluation = 0.
00054       self.objects = []
00055 
00056   def _get_types(self):
00057     """
00058     internal API method
00059     """
00060     return self._slot_types
00061 
00062   def serialize(self, buff):
00063     """
00064     serialize message into buffer
00065     :param buff: buffer, ``StringIO``
00066     """
00067     try:
00068       _x = self.plugin_name
00069       length = len(_x)
00070       if python3 or type(_x) == unicode:
00071         _x = _x.encode('utf-8')
00072         length = len(_x)
00073       buff.write(struct.pack('<I%ss'%length, length, _x))
00074       buff.write(_struct_d.pack(self.basic_evaluation))
00075       length = len(self.objects)
00076       buff.write(_struct_I.pack(length))
00077       for val1 in self.objects:
00078         _x = val1
00079         buff.write(_struct_Qd.pack(_x.object_id, _x.basic_evaluation))
00080     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00081     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00082 
00083   def deserialize(self, str):
00084     """
00085     unpack serialized message in str into this message instance
00086     :param str: byte array of serialized message, ``str``
00087     """
00088     try:
00089       if self.objects is None:
00090         self.objects = None
00091       end = 0
00092       start = end
00093       end += 4
00094       (length,) = _struct_I.unpack(str[start:end])
00095       start = end
00096       end += length
00097       if python3:
00098         self.plugin_name = str[start:end].decode('utf-8')
00099       else:
00100         self.plugin_name = str[start:end]
00101       start = end
00102       end += 8
00103       (self.basic_evaluation,) = _struct_d.unpack(str[start:end])
00104       start = end
00105       end += 4
00106       (length,) = _struct_I.unpack(str[start:end])
00107       self.objects = []
00108       for i in range(0, length):
00109         val1 = vision_msgs.msg.object_algorithm_relation()
00110         _x = val1
00111         start = end
00112         end += 16
00113         (_x.object_id, _x.basic_evaluation,) = _struct_Qd.unpack(str[start:end])
00114         self.objects.append(val1)
00115       return self
00116     except struct.error as e:
00117       raise genpy.DeserializationError(e) #most likely buffer underfill
00118 
00119 
00120   def serialize_numpy(self, buff, numpy):
00121     """
00122     serialize message with numpy array types into buffer
00123     :param buff: buffer, ``StringIO``
00124     :param numpy: numpy python module
00125     """
00126     try:
00127       _x = self.plugin_name
00128       length = len(_x)
00129       if python3 or type(_x) == unicode:
00130         _x = _x.encode('utf-8')
00131         length = len(_x)
00132       buff.write(struct.pack('<I%ss'%length, length, _x))
00133       buff.write(_struct_d.pack(self.basic_evaluation))
00134       length = len(self.objects)
00135       buff.write(_struct_I.pack(length))
00136       for val1 in self.objects:
00137         _x = val1
00138         buff.write(_struct_Qd.pack(_x.object_id, _x.basic_evaluation))
00139     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00140     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00141 
00142   def deserialize_numpy(self, str, numpy):
00143     """
00144     unpack serialized message in str into this message instance using numpy for array types
00145     :param str: byte array of serialized message, ``str``
00146     :param numpy: numpy python module
00147     """
00148     try:
00149       if self.objects is None:
00150         self.objects = None
00151       end = 0
00152       start = end
00153       end += 4
00154       (length,) = _struct_I.unpack(str[start:end])
00155       start = end
00156       end += length
00157       if python3:
00158         self.plugin_name = str[start:end].decode('utf-8')
00159       else:
00160         self.plugin_name = str[start:end]
00161       start = end
00162       end += 8
00163       (self.basic_evaluation,) = _struct_d.unpack(str[start:end])
00164       start = end
00165       end += 4
00166       (length,) = _struct_I.unpack(str[start:end])
00167       self.objects = []
00168       for i in range(0, length):
00169         val1 = vision_msgs.msg.object_algorithm_relation()
00170         _x = val1
00171         start = end
00172         end += 16
00173         (_x.object_id, _x.basic_evaluation,) = _struct_Qd.unpack(str[start:end])
00174         self.objects.append(val1)
00175       return self
00176     except struct.error as e:
00177       raise genpy.DeserializationError(e) #most likely buffer underfill
00178 
00179 _struct_I = genpy.struct_I
00180 _struct_d = struct.Struct("<d")
00181 _struct_Qd = struct.Struct("<Qd")


vision_msgs
Author(s): Ulrich F Klank
autogenerated on Mon Oct 6 2014 00:47:36