_aposteriori_position.py
Go to the documentation of this file.
00001 """autogenerated by genpy from vision_msgs/aposteriori_position.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 aposteriori_position(genpy.Message):
00010   _md5sum = "37ac3556838265f37bdeb19748c025fb"
00011   _type = "vision_msgs/aposteriori_position"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """#objects a posteriori position, U. Klank klank@in.tum.de
00014 uint64 objectId                  #id of an cop object
00015 float64 probability              #approximated a posteriori probability of the object beeing at the position
00016 uint64 position                  #lo id of an position
00017 cop_descriptor[] models           #list of all models assigned to the returned object
00018 ================================================================================
00019 MSG: vision_msgs/cop_descriptor
00020 #Descriptors of models used in cop, U. Klank klank@in.tum.de
00021 uint64  object_id          # unique id that could be used for a query
00022 string  sem_class          # connected semantic concept
00023 string  type               # Class name that was used to generate the corresponding cop descriptor plugin, 
00024                            # example are: ShapeModel, ColorClass, DeformShapeModel
00025 float64 quality            # the current quality assinged to this descriptor
00026 
00027 
00028 
00029 
00030 """
00031   __slots__ = ['objectId','probability','position','models']
00032   _slot_types = ['uint64','float64','uint64','vision_msgs/cop_descriptor[]']
00033 
00034   def __init__(self, *args, **kwds):
00035     """
00036     Constructor. Any message fields that are implicitly/explicitly
00037     set to None will be assigned a default value. The recommend
00038     use is keyword arguments as this is more robust to future message
00039     changes.  You cannot mix in-order arguments and keyword arguments.
00040 
00041     The available fields are:
00042        objectId,probability,position,models
00043 
00044     :param args: complete set of field values, in .msg order
00045     :param kwds: use keyword arguments corresponding to message field names
00046     to set specific fields.
00047     """
00048     if args or kwds:
00049       super(aposteriori_position, self).__init__(*args, **kwds)
00050       #message fields cannot be None, assign default values for those that are
00051       if self.objectId is None:
00052         self.objectId = 0
00053       if self.probability is None:
00054         self.probability = 0.
00055       if self.position is None:
00056         self.position = 0
00057       if self.models is None:
00058         self.models = []
00059     else:
00060       self.objectId = 0
00061       self.probability = 0.
00062       self.position = 0
00063       self.models = []
00064 
00065   def _get_types(self):
00066     """
00067     internal API method
00068     """
00069     return self._slot_types
00070 
00071   def serialize(self, buff):
00072     """
00073     serialize message into buffer
00074     :param buff: buffer, ``StringIO``
00075     """
00076     try:
00077       _x = self
00078       buff.write(_struct_QdQ.pack(_x.objectId, _x.probability, _x.position))
00079       length = len(self.models)
00080       buff.write(_struct_I.pack(length))
00081       for val1 in self.models:
00082         buff.write(_struct_Q.pack(val1.object_id))
00083         _x = val1.sem_class
00084         length = len(_x)
00085         if python3 or type(_x) == unicode:
00086           _x = _x.encode('utf-8')
00087           length = len(_x)
00088         buff.write(struct.pack('<I%ss'%length, length, _x))
00089         _x = val1.type
00090         length = len(_x)
00091         if python3 or type(_x) == unicode:
00092           _x = _x.encode('utf-8')
00093           length = len(_x)
00094         buff.write(struct.pack('<I%ss'%length, length, _x))
00095         buff.write(_struct_d.pack(val1.quality))
00096     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00097     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00098 
00099   def deserialize(self, str):
00100     """
00101     unpack serialized message in str into this message instance
00102     :param str: byte array of serialized message, ``str``
00103     """
00104     try:
00105       if self.models is None:
00106         self.models = None
00107       end = 0
00108       _x = self
00109       start = end
00110       end += 24
00111       (_x.objectId, _x.probability, _x.position,) = _struct_QdQ.unpack(str[start:end])
00112       start = end
00113       end += 4
00114       (length,) = _struct_I.unpack(str[start:end])
00115       self.models = []
00116       for i in range(0, length):
00117         val1 = vision_msgs.msg.cop_descriptor()
00118         start = end
00119         end += 8
00120         (val1.object_id,) = _struct_Q.unpack(str[start:end])
00121         start = end
00122         end += 4
00123         (length,) = _struct_I.unpack(str[start:end])
00124         start = end
00125         end += length
00126         if python3:
00127           val1.sem_class = str[start:end].decode('utf-8')
00128         else:
00129           val1.sem_class = str[start:end]
00130         start = end
00131         end += 4
00132         (length,) = _struct_I.unpack(str[start:end])
00133         start = end
00134         end += length
00135         if python3:
00136           val1.type = str[start:end].decode('utf-8')
00137         else:
00138           val1.type = str[start:end]
00139         start = end
00140         end += 8
00141         (val1.quality,) = _struct_d.unpack(str[start:end])
00142         self.models.append(val1)
00143       return self
00144     except struct.error as e:
00145       raise genpy.DeserializationError(e) #most likely buffer underfill
00146 
00147 
00148   def serialize_numpy(self, buff, numpy):
00149     """
00150     serialize message with numpy array types into buffer
00151     :param buff: buffer, ``StringIO``
00152     :param numpy: numpy python module
00153     """
00154     try:
00155       _x = self
00156       buff.write(_struct_QdQ.pack(_x.objectId, _x.probability, _x.position))
00157       length = len(self.models)
00158       buff.write(_struct_I.pack(length))
00159       for val1 in self.models:
00160         buff.write(_struct_Q.pack(val1.object_id))
00161         _x = val1.sem_class
00162         length = len(_x)
00163         if python3 or type(_x) == unicode:
00164           _x = _x.encode('utf-8')
00165           length = len(_x)
00166         buff.write(struct.pack('<I%ss'%length, length, _x))
00167         _x = val1.type
00168         length = len(_x)
00169         if python3 or type(_x) == unicode:
00170           _x = _x.encode('utf-8')
00171           length = len(_x)
00172         buff.write(struct.pack('<I%ss'%length, length, _x))
00173         buff.write(_struct_d.pack(val1.quality))
00174     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00175     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00176 
00177   def deserialize_numpy(self, str, numpy):
00178     """
00179     unpack serialized message in str into this message instance using numpy for array types
00180     :param str: byte array of serialized message, ``str``
00181     :param numpy: numpy python module
00182     """
00183     try:
00184       if self.models is None:
00185         self.models = None
00186       end = 0
00187       _x = self
00188       start = end
00189       end += 24
00190       (_x.objectId, _x.probability, _x.position,) = _struct_QdQ.unpack(str[start:end])
00191       start = end
00192       end += 4
00193       (length,) = _struct_I.unpack(str[start:end])
00194       self.models = []
00195       for i in range(0, length):
00196         val1 = vision_msgs.msg.cop_descriptor()
00197         start = end
00198         end += 8
00199         (val1.object_id,) = _struct_Q.unpack(str[start:end])
00200         start = end
00201         end += 4
00202         (length,) = _struct_I.unpack(str[start:end])
00203         start = end
00204         end += length
00205         if python3:
00206           val1.sem_class = str[start:end].decode('utf-8')
00207         else:
00208           val1.sem_class = str[start:end]
00209         start = end
00210         end += 4
00211         (length,) = _struct_I.unpack(str[start:end])
00212         start = end
00213         end += length
00214         if python3:
00215           val1.type = str[start:end].decode('utf-8')
00216         else:
00217           val1.type = str[start:end]
00218         start = end
00219         end += 8
00220         (val1.quality,) = _struct_d.unpack(str[start:end])
00221         self.models.append(val1)
00222       return self
00223     except struct.error as e:
00224       raise genpy.DeserializationError(e) #most likely buffer underfill
00225 
00226 _struct_I = genpy.struct_I
00227 _struct_Q = struct.Struct("<Q")
00228 _struct_d = struct.Struct("<d")
00229 _struct_QdQ = struct.Struct("<QdQ")


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