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