$search
00001 """autogenerated by genmsg_py from InterestPointRos.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import flirtlib_ros.msg 00006 import geometry_msgs.msg 00007 00008 class InterestPointRos(roslib.message.Message): 00009 _md5sum = "1246631fd365f90bb16bd48937597987" 00010 _type = "flirtlib_ros/InterestPointRos" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# Corresponds to the InterestPoint type in flirtlib 00013 # Includes both the point location and optionally a descriptor 00014 00015 geometry_msgs/Pose2D pose 00016 00017 geometry_msgs/Point[] support_points 00018 00019 float32 scale 00020 00021 uint32 scale_level 00022 00023 DescriptorRos descriptor 00024 00025 00026 ================================================================================ 00027 MSG: geometry_msgs/Pose2D 00028 # This expresses a position and orientation on a 2D manifold. 00029 00030 float64 x 00031 float64 y 00032 float64 theta 00033 ================================================================================ 00034 MSG: geometry_msgs/Point 00035 # This contains the position of a point in free space 00036 float64 x 00037 float64 y 00038 float64 z 00039 00040 ================================================================================ 00041 MSG: flirtlib_ros/DescriptorRos 00042 # Confirms to the Descriptor type in flirtlib 00043 # For now, we only allow the beta grid descriptor 00044 00045 Vector[] hist 00046 Vector[] variance 00047 Vector[] hit 00048 Vector[] miss 00049 00050 ================================================================================ 00051 MSG: flirtlib_ros/Vector 00052 # Vector message type used by a bunch of the flirtlib messages 00053 00054 float64[] vec 00055 """ 00056 __slots__ = ['pose','support_points','scale','scale_level','descriptor'] 00057 _slot_types = ['geometry_msgs/Pose2D','geometry_msgs/Point[]','float32','uint32','flirtlib_ros/DescriptorRos'] 00058 00059 def __init__(self, *args, **kwds): 00060 """ 00061 Constructor. Any message fields that are implicitly/explicitly 00062 set to None will be assigned a default value. The recommend 00063 use is keyword arguments as this is more robust to future message 00064 changes. You cannot mix in-order arguments and keyword arguments. 00065 00066 The available fields are: 00067 pose,support_points,scale,scale_level,descriptor 00068 00069 @param args: complete set of field values, in .msg order 00070 @param kwds: use keyword arguments corresponding to message field names 00071 to set specific fields. 00072 """ 00073 if args or kwds: 00074 super(InterestPointRos, self).__init__(*args, **kwds) 00075 #message fields cannot be None, assign default values for those that are 00076 if self.pose is None: 00077 self.pose = geometry_msgs.msg.Pose2D() 00078 if self.support_points is None: 00079 self.support_points = [] 00080 if self.scale is None: 00081 self.scale = 0. 00082 if self.scale_level is None: 00083 self.scale_level = 0 00084 if self.descriptor is None: 00085 self.descriptor = flirtlib_ros.msg.DescriptorRos() 00086 else: 00087 self.pose = geometry_msgs.msg.Pose2D() 00088 self.support_points = [] 00089 self.scale = 0. 00090 self.scale_level = 0 00091 self.descriptor = flirtlib_ros.msg.DescriptorRos() 00092 00093 def _get_types(self): 00094 """ 00095 internal API method 00096 """ 00097 return self._slot_types 00098 00099 def serialize(self, buff): 00100 """ 00101 serialize message into buffer 00102 @param buff: buffer 00103 @type buff: StringIO 00104 """ 00105 try: 00106 _x = self 00107 buff.write(_struct_3d.pack(_x.pose.x, _x.pose.y, _x.pose.theta)) 00108 length = len(self.support_points) 00109 buff.write(_struct_I.pack(length)) 00110 for val1 in self.support_points: 00111 _x = val1 00112 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00113 _x = self 00114 buff.write(_struct_fI.pack(_x.scale, _x.scale_level)) 00115 length = len(self.descriptor.hist) 00116 buff.write(_struct_I.pack(length)) 00117 for val1 in self.descriptor.hist: 00118 length = len(val1.vec) 00119 buff.write(_struct_I.pack(length)) 00120 pattern = '<%sd'%length 00121 buff.write(struct.pack(pattern, *val1.vec)) 00122 length = len(self.descriptor.variance) 00123 buff.write(_struct_I.pack(length)) 00124 for val1 in self.descriptor.variance: 00125 length = len(val1.vec) 00126 buff.write(_struct_I.pack(length)) 00127 pattern = '<%sd'%length 00128 buff.write(struct.pack(pattern, *val1.vec)) 00129 length = len(self.descriptor.hit) 00130 buff.write(_struct_I.pack(length)) 00131 for val1 in self.descriptor.hit: 00132 length = len(val1.vec) 00133 buff.write(_struct_I.pack(length)) 00134 pattern = '<%sd'%length 00135 buff.write(struct.pack(pattern, *val1.vec)) 00136 length = len(self.descriptor.miss) 00137 buff.write(_struct_I.pack(length)) 00138 for val1 in self.descriptor.miss: 00139 length = len(val1.vec) 00140 buff.write(_struct_I.pack(length)) 00141 pattern = '<%sd'%length 00142 buff.write(struct.pack(pattern, *val1.vec)) 00143 except struct.error as se: self._check_types(se) 00144 except TypeError as te: self._check_types(te) 00145 00146 def deserialize(self, str): 00147 """ 00148 unpack serialized message in str into this message instance 00149 @param str: byte array of serialized message 00150 @type str: str 00151 """ 00152 try: 00153 if self.pose is None: 00154 self.pose = geometry_msgs.msg.Pose2D() 00155 if self.descriptor is None: 00156 self.descriptor = flirtlib_ros.msg.DescriptorRos() 00157 end = 0 00158 _x = self 00159 start = end 00160 end += 24 00161 (_x.pose.x, _x.pose.y, _x.pose.theta,) = _struct_3d.unpack(str[start:end]) 00162 start = end 00163 end += 4 00164 (length,) = _struct_I.unpack(str[start:end]) 00165 self.support_points = [] 00166 for i in range(0, length): 00167 val1 = geometry_msgs.msg.Point() 00168 _x = val1 00169 start = end 00170 end += 24 00171 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00172 self.support_points.append(val1) 00173 _x = self 00174 start = end 00175 end += 8 00176 (_x.scale, _x.scale_level,) = _struct_fI.unpack(str[start:end]) 00177 start = end 00178 end += 4 00179 (length,) = _struct_I.unpack(str[start:end]) 00180 self.descriptor.hist = [] 00181 for i in range(0, length): 00182 val1 = flirtlib_ros.msg.Vector() 00183 start = end 00184 end += 4 00185 (length,) = _struct_I.unpack(str[start:end]) 00186 pattern = '<%sd'%length 00187 start = end 00188 end += struct.calcsize(pattern) 00189 val1.vec = struct.unpack(pattern, str[start:end]) 00190 self.descriptor.hist.append(val1) 00191 start = end 00192 end += 4 00193 (length,) = _struct_I.unpack(str[start:end]) 00194 self.descriptor.variance = [] 00195 for i in range(0, length): 00196 val1 = flirtlib_ros.msg.Vector() 00197 start = end 00198 end += 4 00199 (length,) = _struct_I.unpack(str[start:end]) 00200 pattern = '<%sd'%length 00201 start = end 00202 end += struct.calcsize(pattern) 00203 val1.vec = struct.unpack(pattern, str[start:end]) 00204 self.descriptor.variance.append(val1) 00205 start = end 00206 end += 4 00207 (length,) = _struct_I.unpack(str[start:end]) 00208 self.descriptor.hit = [] 00209 for i in range(0, length): 00210 val1 = flirtlib_ros.msg.Vector() 00211 start = end 00212 end += 4 00213 (length,) = _struct_I.unpack(str[start:end]) 00214 pattern = '<%sd'%length 00215 start = end 00216 end += struct.calcsize(pattern) 00217 val1.vec = struct.unpack(pattern, str[start:end]) 00218 self.descriptor.hit.append(val1) 00219 start = end 00220 end += 4 00221 (length,) = _struct_I.unpack(str[start:end]) 00222 self.descriptor.miss = [] 00223 for i in range(0, length): 00224 val1 = flirtlib_ros.msg.Vector() 00225 start = end 00226 end += 4 00227 (length,) = _struct_I.unpack(str[start:end]) 00228 pattern = '<%sd'%length 00229 start = end 00230 end += struct.calcsize(pattern) 00231 val1.vec = struct.unpack(pattern, str[start:end]) 00232 self.descriptor.miss.append(val1) 00233 return self 00234 except struct.error as e: 00235 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00236 00237 00238 def serialize_numpy(self, buff, numpy): 00239 """ 00240 serialize message with numpy array types into buffer 00241 @param buff: buffer 00242 @type buff: StringIO 00243 @param numpy: numpy python module 00244 @type numpy module 00245 """ 00246 try: 00247 _x = self 00248 buff.write(_struct_3d.pack(_x.pose.x, _x.pose.y, _x.pose.theta)) 00249 length = len(self.support_points) 00250 buff.write(_struct_I.pack(length)) 00251 for val1 in self.support_points: 00252 _x = val1 00253 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00254 _x = self 00255 buff.write(_struct_fI.pack(_x.scale, _x.scale_level)) 00256 length = len(self.descriptor.hist) 00257 buff.write(_struct_I.pack(length)) 00258 for val1 in self.descriptor.hist: 00259 length = len(val1.vec) 00260 buff.write(_struct_I.pack(length)) 00261 pattern = '<%sd'%length 00262 buff.write(val1.vec.tostring()) 00263 length = len(self.descriptor.variance) 00264 buff.write(_struct_I.pack(length)) 00265 for val1 in self.descriptor.variance: 00266 length = len(val1.vec) 00267 buff.write(_struct_I.pack(length)) 00268 pattern = '<%sd'%length 00269 buff.write(val1.vec.tostring()) 00270 length = len(self.descriptor.hit) 00271 buff.write(_struct_I.pack(length)) 00272 for val1 in self.descriptor.hit: 00273 length = len(val1.vec) 00274 buff.write(_struct_I.pack(length)) 00275 pattern = '<%sd'%length 00276 buff.write(val1.vec.tostring()) 00277 length = len(self.descriptor.miss) 00278 buff.write(_struct_I.pack(length)) 00279 for val1 in self.descriptor.miss: 00280 length = len(val1.vec) 00281 buff.write(_struct_I.pack(length)) 00282 pattern = '<%sd'%length 00283 buff.write(val1.vec.tostring()) 00284 except struct.error as se: self._check_types(se) 00285 except TypeError as te: self._check_types(te) 00286 00287 def deserialize_numpy(self, str, numpy): 00288 """ 00289 unpack serialized message in str into this message instance using numpy for array types 00290 @param str: byte array of serialized message 00291 @type str: str 00292 @param numpy: numpy python module 00293 @type numpy: module 00294 """ 00295 try: 00296 if self.pose is None: 00297 self.pose = geometry_msgs.msg.Pose2D() 00298 if self.descriptor is None: 00299 self.descriptor = flirtlib_ros.msg.DescriptorRos() 00300 end = 0 00301 _x = self 00302 start = end 00303 end += 24 00304 (_x.pose.x, _x.pose.y, _x.pose.theta,) = _struct_3d.unpack(str[start:end]) 00305 start = end 00306 end += 4 00307 (length,) = _struct_I.unpack(str[start:end]) 00308 self.support_points = [] 00309 for i in range(0, length): 00310 val1 = geometry_msgs.msg.Point() 00311 _x = val1 00312 start = end 00313 end += 24 00314 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00315 self.support_points.append(val1) 00316 _x = self 00317 start = end 00318 end += 8 00319 (_x.scale, _x.scale_level,) = _struct_fI.unpack(str[start:end]) 00320 start = end 00321 end += 4 00322 (length,) = _struct_I.unpack(str[start:end]) 00323 self.descriptor.hist = [] 00324 for i in range(0, length): 00325 val1 = flirtlib_ros.msg.Vector() 00326 start = end 00327 end += 4 00328 (length,) = _struct_I.unpack(str[start:end]) 00329 pattern = '<%sd'%length 00330 start = end 00331 end += struct.calcsize(pattern) 00332 val1.vec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00333 self.descriptor.hist.append(val1) 00334 start = end 00335 end += 4 00336 (length,) = _struct_I.unpack(str[start:end]) 00337 self.descriptor.variance = [] 00338 for i in range(0, length): 00339 val1 = flirtlib_ros.msg.Vector() 00340 start = end 00341 end += 4 00342 (length,) = _struct_I.unpack(str[start:end]) 00343 pattern = '<%sd'%length 00344 start = end 00345 end += struct.calcsize(pattern) 00346 val1.vec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00347 self.descriptor.variance.append(val1) 00348 start = end 00349 end += 4 00350 (length,) = _struct_I.unpack(str[start:end]) 00351 self.descriptor.hit = [] 00352 for i in range(0, length): 00353 val1 = flirtlib_ros.msg.Vector() 00354 start = end 00355 end += 4 00356 (length,) = _struct_I.unpack(str[start:end]) 00357 pattern = '<%sd'%length 00358 start = end 00359 end += struct.calcsize(pattern) 00360 val1.vec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00361 self.descriptor.hit.append(val1) 00362 start = end 00363 end += 4 00364 (length,) = _struct_I.unpack(str[start:end]) 00365 self.descriptor.miss = [] 00366 for i in range(0, length): 00367 val1 = flirtlib_ros.msg.Vector() 00368 start = end 00369 end += 4 00370 (length,) = _struct_I.unpack(str[start:end]) 00371 pattern = '<%sd'%length 00372 start = end 00373 end += struct.calcsize(pattern) 00374 val1.vec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00375 self.descriptor.miss.append(val1) 00376 return self 00377 except struct.error as e: 00378 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00379 00380 _struct_I = roslib.message.struct_I 00381 _struct_fI = struct.Struct("<fI") 00382 _struct_3d = struct.Struct("<3d")