_InterestPointRos.py
Go to the documentation of this file.
00001 """autogenerated by genpy from flirtlib_ros/InterestPointRos.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import flirtlib_ros.msg
00008 import geometry_msgs.msg
00009 
00010 class InterestPointRos(genpy.Message):
00011   _md5sum = "1246631fd365f90bb16bd48937597987"
00012   _type = "flirtlib_ros/InterestPointRos"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """# Corresponds to the InterestPoint type in flirtlib
00015 # Includes both the point location and optionally a descriptor
00016 
00017 geometry_msgs/Pose2D pose
00018 
00019 geometry_msgs/Point[] support_points
00020 
00021 float32 scale
00022 
00023 uint32 scale_level
00024 
00025 DescriptorRos descriptor
00026 
00027 
00028 ================================================================================
00029 MSG: geometry_msgs/Pose2D
00030 # This expresses a position and orientation on a 2D manifold.
00031 
00032 float64 x
00033 float64 y
00034 float64 theta
00035 ================================================================================
00036 MSG: geometry_msgs/Point
00037 # This contains the position of a point in free space
00038 float64 x
00039 float64 y
00040 float64 z
00041 
00042 ================================================================================
00043 MSG: flirtlib_ros/DescriptorRos
00044 # Confirms to the Descriptor type in flirtlib
00045 # For now, we only allow the beta grid descriptor
00046 
00047 Vector[] hist
00048 Vector[] variance
00049 Vector[] hit
00050 Vector[] miss
00051 
00052 ================================================================================
00053 MSG: flirtlib_ros/Vector
00054 # Vector message type used by a bunch of the flirtlib messages
00055 
00056 float64[] vec
00057 """
00058   __slots__ = ['pose','support_points','scale','scale_level','descriptor']
00059   _slot_types = ['geometry_msgs/Pose2D','geometry_msgs/Point[]','float32','uint32','flirtlib_ros/DescriptorRos']
00060 
00061   def __init__(self, *args, **kwds):
00062     """
00063     Constructor. Any message fields that are implicitly/explicitly
00064     set to None will be assigned a default value. The recommend
00065     use is keyword arguments as this is more robust to future message
00066     changes.  You cannot mix in-order arguments and keyword arguments.
00067 
00068     The available fields are:
00069        pose,support_points,scale,scale_level,descriptor
00070 
00071     :param args: complete set of field values, in .msg order
00072     :param kwds: use keyword arguments corresponding to message field names
00073     to set specific fields.
00074     """
00075     if args or kwds:
00076       super(InterestPointRos, self).__init__(*args, **kwds)
00077       #message fields cannot be None, assign default values for those that are
00078       if self.pose is None:
00079         self.pose = geometry_msgs.msg.Pose2D()
00080       if self.support_points is None:
00081         self.support_points = []
00082       if self.scale is None:
00083         self.scale = 0.
00084       if self.scale_level is None:
00085         self.scale_level = 0
00086       if self.descriptor is None:
00087         self.descriptor = flirtlib_ros.msg.DescriptorRos()
00088     else:
00089       self.pose = geometry_msgs.msg.Pose2D()
00090       self.support_points = []
00091       self.scale = 0.
00092       self.scale_level = 0
00093       self.descriptor = flirtlib_ros.msg.DescriptorRos()
00094 
00095   def _get_types(self):
00096     """
00097     internal API method
00098     """
00099     return self._slot_types
00100 
00101   def serialize(self, buff):
00102     """
00103     serialize message into buffer
00104     :param buff: buffer, ``StringIO``
00105     """
00106     try:
00107       _x = self
00108       buff.write(_struct_3d.pack(_x.pose.x, _x.pose.y, _x.pose.theta))
00109       length = len(self.support_points)
00110       buff.write(_struct_I.pack(length))
00111       for val1 in self.support_points:
00112         _x = val1
00113         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00114       _x = self
00115       buff.write(_struct_fI.pack(_x.scale, _x.scale_level))
00116       length = len(self.descriptor.hist)
00117       buff.write(_struct_I.pack(length))
00118       for val1 in self.descriptor.hist:
00119         length = len(val1.vec)
00120         buff.write(_struct_I.pack(length))
00121         pattern = '<%sd'%length
00122         buff.write(struct.pack(pattern, *val1.vec))
00123       length = len(self.descriptor.variance)
00124       buff.write(_struct_I.pack(length))
00125       for val1 in self.descriptor.variance:
00126         length = len(val1.vec)
00127         buff.write(_struct_I.pack(length))
00128         pattern = '<%sd'%length
00129         buff.write(struct.pack(pattern, *val1.vec))
00130       length = len(self.descriptor.hit)
00131       buff.write(_struct_I.pack(length))
00132       for val1 in self.descriptor.hit:
00133         length = len(val1.vec)
00134         buff.write(_struct_I.pack(length))
00135         pattern = '<%sd'%length
00136         buff.write(struct.pack(pattern, *val1.vec))
00137       length = len(self.descriptor.miss)
00138       buff.write(_struct_I.pack(length))
00139       for val1 in self.descriptor.miss:
00140         length = len(val1.vec)
00141         buff.write(_struct_I.pack(length))
00142         pattern = '<%sd'%length
00143         buff.write(struct.pack(pattern, *val1.vec))
00144     except struct.error as se: self._check_types(se)
00145     except TypeError as te: self._check_types(te)
00146 
00147   def deserialize(self, str):
00148     """
00149     unpack serialized message in str into this message instance
00150     :param str: byte array of serialized message, ``str``
00151     """
00152     try:
00153       if self.pose is None:
00154         self.pose = geometry_msgs.msg.Pose2D()
00155       if self.support_points is None:
00156         self.support_points = None
00157       if self.descriptor is None:
00158         self.descriptor = flirtlib_ros.msg.DescriptorRos()
00159       end = 0
00160       _x = self
00161       start = end
00162       end += 24
00163       (_x.pose.x, _x.pose.y, _x.pose.theta,) = _struct_3d.unpack(str[start:end])
00164       start = end
00165       end += 4
00166       (length,) = _struct_I.unpack(str[start:end])
00167       self.support_points = []
00168       for i in range(0, length):
00169         val1 = geometry_msgs.msg.Point()
00170         _x = val1
00171         start = end
00172         end += 24
00173         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00174         self.support_points.append(val1)
00175       _x = self
00176       start = end
00177       end += 8
00178       (_x.scale, _x.scale_level,) = _struct_fI.unpack(str[start:end])
00179       start = end
00180       end += 4
00181       (length,) = _struct_I.unpack(str[start:end])
00182       self.descriptor.hist = []
00183       for i in range(0, length):
00184         val1 = flirtlib_ros.msg.Vector()
00185         start = end
00186         end += 4
00187         (length,) = _struct_I.unpack(str[start:end])
00188         pattern = '<%sd'%length
00189         start = end
00190         end += struct.calcsize(pattern)
00191         val1.vec = struct.unpack(pattern, str[start:end])
00192         self.descriptor.hist.append(val1)
00193       start = end
00194       end += 4
00195       (length,) = _struct_I.unpack(str[start:end])
00196       self.descriptor.variance = []
00197       for i in range(0, length):
00198         val1 = flirtlib_ros.msg.Vector()
00199         start = end
00200         end += 4
00201         (length,) = _struct_I.unpack(str[start:end])
00202         pattern = '<%sd'%length
00203         start = end
00204         end += struct.calcsize(pattern)
00205         val1.vec = struct.unpack(pattern, str[start:end])
00206         self.descriptor.variance.append(val1)
00207       start = end
00208       end += 4
00209       (length,) = _struct_I.unpack(str[start:end])
00210       self.descriptor.hit = []
00211       for i in range(0, length):
00212         val1 = flirtlib_ros.msg.Vector()
00213         start = end
00214         end += 4
00215         (length,) = _struct_I.unpack(str[start:end])
00216         pattern = '<%sd'%length
00217         start = end
00218         end += struct.calcsize(pattern)
00219         val1.vec = struct.unpack(pattern, str[start:end])
00220         self.descriptor.hit.append(val1)
00221       start = end
00222       end += 4
00223       (length,) = _struct_I.unpack(str[start:end])
00224       self.descriptor.miss = []
00225       for i in range(0, length):
00226         val1 = flirtlib_ros.msg.Vector()
00227         start = end
00228         end += 4
00229         (length,) = _struct_I.unpack(str[start:end])
00230         pattern = '<%sd'%length
00231         start = end
00232         end += struct.calcsize(pattern)
00233         val1.vec = struct.unpack(pattern, str[start:end])
00234         self.descriptor.miss.append(val1)
00235       return self
00236     except struct.error as e:
00237       raise genpy.DeserializationError(e) #most likely buffer underfill
00238 
00239 
00240   def serialize_numpy(self, buff, numpy):
00241     """
00242     serialize message with numpy array types into buffer
00243     :param buff: buffer, ``StringIO``
00244     :param numpy: numpy python 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, ``str``
00291     :param numpy: numpy python module
00292     """
00293     try:
00294       if self.pose is None:
00295         self.pose = geometry_msgs.msg.Pose2D()
00296       if self.support_points is None:
00297         self.support_points = None
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 genpy.DeserializationError(e) #most likely buffer underfill
00379 
00380 _struct_I = genpy.struct_I
00381 _struct_fI = struct.Struct("<fI")
00382 _struct_3d = struct.Struct("<3d")


flirtlib_ros
Author(s): Bhaskara Marthi
autogenerated on Thu Nov 28 2013 11:21:50