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