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