$search
00001 """autogenerated by genmsg_py from CurvedPolygon.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 import cob_3d_mapping_msgs.msg 00007 00008 class CurvedPolygon(roslib.message.Message): 00009 _md5sum = "44b9c6adf55085288b1561faf0dcdb6d" 00010 _type = "cob_3d_mapping_msgs/CurvedPolygon" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """time stamp 00013 uint32 ID 00014 float32[6] parameter 00015 #float32[][3] polyline 00016 simalarity_score[] score 00017 polyline_point[] polyline 00018 feature[] features 00019 string energy 00020 float32 weight 00021 00022 ================================================================================ 00023 MSG: cob_3d_mapping_msgs/simalarity_score 00024 uint32 ID 00025 float32 prob 00026 ================================================================================ 00027 MSG: cob_3d_mapping_msgs/polyline_point 00028 float32 x 00029 float32 y 00030 float32 edge_prob 00031 ================================================================================ 00032 MSG: cob_3d_mapping_msgs/feature 00033 float32 x 00034 float32 y 00035 float32 z 00036 uint32 ID 00037 """ 00038 __slots__ = ['stamp','ID','parameter','score','polyline','features','energy','weight'] 00039 _slot_types = ['time','uint32','float32[6]','cob_3d_mapping_msgs/simalarity_score[]','cob_3d_mapping_msgs/polyline_point[]','cob_3d_mapping_msgs/feature[]','string','float32'] 00040 00041 def __init__(self, *args, **kwds): 00042 """ 00043 Constructor. Any message fields that are implicitly/explicitly 00044 set to None will be assigned a default value. The recommend 00045 use is keyword arguments as this is more robust to future message 00046 changes. You cannot mix in-order arguments and keyword arguments. 00047 00048 The available fields are: 00049 stamp,ID,parameter,score,polyline,features,energy,weight 00050 00051 @param args: complete set of field values, in .msg order 00052 @param kwds: use keyword arguments corresponding to message field names 00053 to set specific fields. 00054 """ 00055 if args or kwds: 00056 super(CurvedPolygon, self).__init__(*args, **kwds) 00057 #message fields cannot be None, assign default values for those that are 00058 if self.stamp is None: 00059 self.stamp = roslib.rostime.Time() 00060 if self.ID is None: 00061 self.ID = 0 00062 if self.parameter is None: 00063 self.parameter = [0.,0.,0.,0.,0.,0.] 00064 if self.score is None: 00065 self.score = [] 00066 if self.polyline is None: 00067 self.polyline = [] 00068 if self.features is None: 00069 self.features = [] 00070 if self.energy is None: 00071 self.energy = '' 00072 if self.weight is None: 00073 self.weight = 0. 00074 else: 00075 self.stamp = roslib.rostime.Time() 00076 self.ID = 0 00077 self.parameter = [0.,0.,0.,0.,0.,0.] 00078 self.score = [] 00079 self.polyline = [] 00080 self.features = [] 00081 self.energy = '' 00082 self.weight = 0. 00083 00084 def _get_types(self): 00085 """ 00086 internal API method 00087 """ 00088 return self._slot_types 00089 00090 def serialize(self, buff): 00091 """ 00092 serialize message into buffer 00093 @param buff: buffer 00094 @type buff: StringIO 00095 """ 00096 try: 00097 _x = self 00098 buff.write(_struct_3I.pack(_x.stamp.secs, _x.stamp.nsecs, _x.ID)) 00099 buff.write(_struct_6f.pack(*self.parameter)) 00100 length = len(self.score) 00101 buff.write(_struct_I.pack(length)) 00102 for val1 in self.score: 00103 _x = val1 00104 buff.write(_struct_If.pack(_x.ID, _x.prob)) 00105 length = len(self.polyline) 00106 buff.write(_struct_I.pack(length)) 00107 for val1 in self.polyline: 00108 _x = val1 00109 buff.write(_struct_3f.pack(_x.x, _x.y, _x.edge_prob)) 00110 length = len(self.features) 00111 buff.write(_struct_I.pack(length)) 00112 for val1 in self.features: 00113 _x = val1 00114 buff.write(_struct_3fI.pack(_x.x, _x.y, _x.z, _x.ID)) 00115 _x = self.energy 00116 length = len(_x) 00117 buff.write(struct.pack('<I%ss'%length, length, _x)) 00118 buff.write(_struct_f.pack(self.weight)) 00119 except struct.error as se: self._check_types(se) 00120 except TypeError as te: self._check_types(te) 00121 00122 def deserialize(self, str): 00123 """ 00124 unpack serialized message in str into this message instance 00125 @param str: byte array of serialized message 00126 @type str: str 00127 """ 00128 try: 00129 if self.stamp is None: 00130 self.stamp = roslib.rostime.Time() 00131 end = 0 00132 _x = self 00133 start = end 00134 end += 12 00135 (_x.stamp.secs, _x.stamp.nsecs, _x.ID,) = _struct_3I.unpack(str[start:end]) 00136 start = end 00137 end += 24 00138 self.parameter = _struct_6f.unpack(str[start:end]) 00139 start = end 00140 end += 4 00141 (length,) = _struct_I.unpack(str[start:end]) 00142 self.score = [] 00143 for i in range(0, length): 00144 val1 = cob_3d_mapping_msgs.msg.simalarity_score() 00145 _x = val1 00146 start = end 00147 end += 8 00148 (_x.ID, _x.prob,) = _struct_If.unpack(str[start:end]) 00149 self.score.append(val1) 00150 start = end 00151 end += 4 00152 (length,) = _struct_I.unpack(str[start:end]) 00153 self.polyline = [] 00154 for i in range(0, length): 00155 val1 = cob_3d_mapping_msgs.msg.polyline_point() 00156 _x = val1 00157 start = end 00158 end += 12 00159 (_x.x, _x.y, _x.edge_prob,) = _struct_3f.unpack(str[start:end]) 00160 self.polyline.append(val1) 00161 start = end 00162 end += 4 00163 (length,) = _struct_I.unpack(str[start:end]) 00164 self.features = [] 00165 for i in range(0, length): 00166 val1 = cob_3d_mapping_msgs.msg.feature() 00167 _x = val1 00168 start = end 00169 end += 16 00170 (_x.x, _x.y, _x.z, _x.ID,) = _struct_3fI.unpack(str[start:end]) 00171 self.features.append(val1) 00172 start = end 00173 end += 4 00174 (length,) = _struct_I.unpack(str[start:end]) 00175 start = end 00176 end += length 00177 self.energy = str[start:end] 00178 start = end 00179 end += 4 00180 (self.weight,) = _struct_f.unpack(str[start:end]) 00181 self.stamp.canon() 00182 return self 00183 except struct.error as e: 00184 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00185 00186 00187 def serialize_numpy(self, buff, numpy): 00188 """ 00189 serialize message with numpy array types into buffer 00190 @param buff: buffer 00191 @type buff: StringIO 00192 @param numpy: numpy python module 00193 @type numpy module 00194 """ 00195 try: 00196 _x = self 00197 buff.write(_struct_3I.pack(_x.stamp.secs, _x.stamp.nsecs, _x.ID)) 00198 buff.write(self.parameter.tostring()) 00199 length = len(self.score) 00200 buff.write(_struct_I.pack(length)) 00201 for val1 in self.score: 00202 _x = val1 00203 buff.write(_struct_If.pack(_x.ID, _x.prob)) 00204 length = len(self.polyline) 00205 buff.write(_struct_I.pack(length)) 00206 for val1 in self.polyline: 00207 _x = val1 00208 buff.write(_struct_3f.pack(_x.x, _x.y, _x.edge_prob)) 00209 length = len(self.features) 00210 buff.write(_struct_I.pack(length)) 00211 for val1 in self.features: 00212 _x = val1 00213 buff.write(_struct_3fI.pack(_x.x, _x.y, _x.z, _x.ID)) 00214 _x = self.energy 00215 length = len(_x) 00216 buff.write(struct.pack('<I%ss'%length, length, _x)) 00217 buff.write(_struct_f.pack(self.weight)) 00218 except struct.error as se: self._check_types(se) 00219 except TypeError as te: self._check_types(te) 00220 00221 def deserialize_numpy(self, str, numpy): 00222 """ 00223 unpack serialized message in str into this message instance using numpy for array types 00224 @param str: byte array of serialized message 00225 @type str: str 00226 @param numpy: numpy python module 00227 @type numpy: module 00228 """ 00229 try: 00230 if self.stamp is None: 00231 self.stamp = roslib.rostime.Time() 00232 end = 0 00233 _x = self 00234 start = end 00235 end += 12 00236 (_x.stamp.secs, _x.stamp.nsecs, _x.ID,) = _struct_3I.unpack(str[start:end]) 00237 start = end 00238 end += 24 00239 self.parameter = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=6) 00240 start = end 00241 end += 4 00242 (length,) = _struct_I.unpack(str[start:end]) 00243 self.score = [] 00244 for i in range(0, length): 00245 val1 = cob_3d_mapping_msgs.msg.simalarity_score() 00246 _x = val1 00247 start = end 00248 end += 8 00249 (_x.ID, _x.prob,) = _struct_If.unpack(str[start:end]) 00250 self.score.append(val1) 00251 start = end 00252 end += 4 00253 (length,) = _struct_I.unpack(str[start:end]) 00254 self.polyline = [] 00255 for i in range(0, length): 00256 val1 = cob_3d_mapping_msgs.msg.polyline_point() 00257 _x = val1 00258 start = end 00259 end += 12 00260 (_x.x, _x.y, _x.edge_prob,) = _struct_3f.unpack(str[start:end]) 00261 self.polyline.append(val1) 00262 start = end 00263 end += 4 00264 (length,) = _struct_I.unpack(str[start:end]) 00265 self.features = [] 00266 for i in range(0, length): 00267 val1 = cob_3d_mapping_msgs.msg.feature() 00268 _x = val1 00269 start = end 00270 end += 16 00271 (_x.x, _x.y, _x.z, _x.ID,) = _struct_3fI.unpack(str[start:end]) 00272 self.features.append(val1) 00273 start = end 00274 end += 4 00275 (length,) = _struct_I.unpack(str[start:end]) 00276 start = end 00277 end += length 00278 self.energy = str[start:end] 00279 start = end 00280 end += 4 00281 (self.weight,) = _struct_f.unpack(str[start:end]) 00282 self.stamp.canon() 00283 return self 00284 except struct.error as e: 00285 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00286 00287 _struct_I = roslib.message.struct_I 00288 _struct_6f = struct.Struct("<6f") 00289 _struct_f = struct.Struct("<f") 00290 _struct_3I = struct.Struct("<3I") 00291 _struct_3fI = struct.Struct("<3fI") 00292 _struct_3f = struct.Struct("<3f") 00293 _struct_If = struct.Struct("<If")