_TagPoseArray.py
Go to the documentation of this file.
00001 """autogenerated by genpy from april_msgs/TagPoseArray.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 geometry_msgs.msg
00008 import april_msgs.msg
00009 import std_msgs.msg
00010 
00011 class TagPoseArray(genpy.Message):
00012   _md5sum = "f089c6703aa69963fcf25a70fd68b35f"
00013   _type = "april_msgs/TagPoseArray"
00014   _has_header = True #flag to mark the presence of a Header object
00015   _full_text = """Header header
00016 TagPose[] tags
00017 
00018 ================================================================================
00019 MSG: std_msgs/Header
00020 # Standard metadata for higher-level stamped data types.
00021 # This is generally used to communicate timestamped data 
00022 # in a particular coordinate frame.
00023 # 
00024 # sequence ID: consecutively increasing ID 
00025 uint32 seq
00026 #Two-integer timestamp that is expressed as:
00027 # * stamp.secs: seconds (stamp_secs) since epoch
00028 # * stamp.nsecs: nanoseconds since stamp_secs
00029 # time-handling sugar is provided by the client library
00030 time stamp
00031 #Frame this data is associated with
00032 # 0: no frame
00033 # 1: global frame
00034 string frame_id
00035 
00036 ================================================================================
00037 MSG: april_msgs/TagPose
00038 int32 id
00039 string family
00040 int32 hamming_distance
00041 geometry_msgs/Point32[] image_coordinates
00042 geometry_msgs/Pose pose
00043 
00044 ================================================================================
00045 MSG: geometry_msgs/Point32
00046 # This contains the position of a point in free space(with 32 bits of precision).
00047 # It is recommeded to use Point wherever possible instead of Point32.  
00048 # 
00049 # This recommendation is to promote interoperability.  
00050 #
00051 # This message is designed to take up less space when sending
00052 # lots of points at once, as in the case of a PointCloud.  
00053 
00054 float32 x
00055 float32 y
00056 float32 z
00057 ================================================================================
00058 MSG: geometry_msgs/Pose
00059 # A representation of pose in free space, composed of postion and orientation. 
00060 Point position
00061 Quaternion orientation
00062 
00063 ================================================================================
00064 MSG: geometry_msgs/Point
00065 # This contains the position of a point in free space
00066 float64 x
00067 float64 y
00068 float64 z
00069 
00070 ================================================================================
00071 MSG: geometry_msgs/Quaternion
00072 # This represents an orientation in free space in quaternion form.
00073 
00074 float64 x
00075 float64 y
00076 float64 z
00077 float64 w
00078 
00079 """
00080   __slots__ = ['header','tags']
00081   _slot_types = ['std_msgs/Header','april_msgs/TagPose[]']
00082 
00083   def __init__(self, *args, **kwds):
00084     """
00085     Constructor. Any message fields that are implicitly/explicitly
00086     set to None will be assigned a default value. The recommend
00087     use is keyword arguments as this is more robust to future message
00088     changes.  You cannot mix in-order arguments and keyword arguments.
00089 
00090     The available fields are:
00091        header,tags
00092 
00093     :param args: complete set of field values, in .msg order
00094     :param kwds: use keyword arguments corresponding to message field names
00095     to set specific fields.
00096     """
00097     if args or kwds:
00098       super(TagPoseArray, self).__init__(*args, **kwds)
00099       #message fields cannot be None, assign default values for those that are
00100       if self.header is None:
00101         self.header = std_msgs.msg.Header()
00102       if self.tags is None:
00103         self.tags = []
00104     else:
00105       self.header = std_msgs.msg.Header()
00106       self.tags = []
00107 
00108   def _get_types(self):
00109     """
00110     internal API method
00111     """
00112     return self._slot_types
00113 
00114   def serialize(self, buff):
00115     """
00116     serialize message into buffer
00117     :param buff: buffer, ``StringIO``
00118     """
00119     try:
00120       _x = self
00121       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00122       _x = self.header.frame_id
00123       length = len(_x)
00124       if python3 or type(_x) == unicode:
00125         _x = _x.encode('utf-8')
00126         length = len(_x)
00127       buff.write(struct.pack('<I%ss'%length, length, _x))
00128       length = len(self.tags)
00129       buff.write(_struct_I.pack(length))
00130       for val1 in self.tags:
00131         buff.write(_struct_i.pack(val1.id))
00132         _x = val1.family
00133         length = len(_x)
00134         if python3 or type(_x) == unicode:
00135           _x = _x.encode('utf-8')
00136           length = len(_x)
00137         buff.write(struct.pack('<I%ss'%length, length, _x))
00138         buff.write(_struct_i.pack(val1.hamming_distance))
00139         length = len(val1.image_coordinates)
00140         buff.write(_struct_I.pack(length))
00141         for val2 in val1.image_coordinates:
00142           _x = val2
00143           buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00144         _v1 = val1.pose
00145         _v2 = _v1.position
00146         _x = _v2
00147         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00148         _v3 = _v1.orientation
00149         _x = _v3
00150         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00151     except struct.error as se: self._check_types(se)
00152     except TypeError as te: self._check_types(te)
00153 
00154   def deserialize(self, str):
00155     """
00156     unpack serialized message in str into this message instance
00157     :param str: byte array of serialized message, ``str``
00158     """
00159     try:
00160       if self.header is None:
00161         self.header = std_msgs.msg.Header()
00162       if self.tags is None:
00163         self.tags = None
00164       end = 0
00165       _x = self
00166       start = end
00167       end += 12
00168       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00169       start = end
00170       end += 4
00171       (length,) = _struct_I.unpack(str[start:end])
00172       start = end
00173       end += length
00174       if python3:
00175         self.header.frame_id = str[start:end].decode('utf-8')
00176       else:
00177         self.header.frame_id = str[start:end]
00178       start = end
00179       end += 4
00180       (length,) = _struct_I.unpack(str[start:end])
00181       self.tags = []
00182       for i in range(0, length):
00183         val1 = april_msgs.msg.TagPose()
00184         start = end
00185         end += 4
00186         (val1.id,) = _struct_i.unpack(str[start:end])
00187         start = end
00188         end += 4
00189         (length,) = _struct_I.unpack(str[start:end])
00190         start = end
00191         end += length
00192         if python3:
00193           val1.family = str[start:end].decode('utf-8')
00194         else:
00195           val1.family = str[start:end]
00196         start = end
00197         end += 4
00198         (val1.hamming_distance,) = _struct_i.unpack(str[start:end])
00199         start = end
00200         end += 4
00201         (length,) = _struct_I.unpack(str[start:end])
00202         val1.image_coordinates = []
00203         for i in range(0, length):
00204           val2 = geometry_msgs.msg.Point32()
00205           _x = val2
00206           start = end
00207           end += 12
00208           (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00209           val1.image_coordinates.append(val2)
00210         _v4 = val1.pose
00211         _v5 = _v4.position
00212         _x = _v5
00213         start = end
00214         end += 24
00215         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00216         _v6 = _v4.orientation
00217         _x = _v6
00218         start = end
00219         end += 32
00220         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00221         self.tags.append(val1)
00222       return self
00223     except struct.error as e:
00224       raise genpy.DeserializationError(e) #most likely buffer underfill
00225 
00226 
00227   def serialize_numpy(self, buff, numpy):
00228     """
00229     serialize message with numpy array types into buffer
00230     :param buff: buffer, ``StringIO``
00231     :param numpy: numpy python module
00232     """
00233     try:
00234       _x = self
00235       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00236       _x = self.header.frame_id
00237       length = len(_x)
00238       if python3 or type(_x) == unicode:
00239         _x = _x.encode('utf-8')
00240         length = len(_x)
00241       buff.write(struct.pack('<I%ss'%length, length, _x))
00242       length = len(self.tags)
00243       buff.write(_struct_I.pack(length))
00244       for val1 in self.tags:
00245         buff.write(_struct_i.pack(val1.id))
00246         _x = val1.family
00247         length = len(_x)
00248         if python3 or type(_x) == unicode:
00249           _x = _x.encode('utf-8')
00250           length = len(_x)
00251         buff.write(struct.pack('<I%ss'%length, length, _x))
00252         buff.write(_struct_i.pack(val1.hamming_distance))
00253         length = len(val1.image_coordinates)
00254         buff.write(_struct_I.pack(length))
00255         for val2 in val1.image_coordinates:
00256           _x = val2
00257           buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00258         _v7 = val1.pose
00259         _v8 = _v7.position
00260         _x = _v8
00261         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00262         _v9 = _v7.orientation
00263         _x = _v9
00264         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00265     except struct.error as se: self._check_types(se)
00266     except TypeError as te: self._check_types(te)
00267 
00268   def deserialize_numpy(self, str, numpy):
00269     """
00270     unpack serialized message in str into this message instance using numpy for array types
00271     :param str: byte array of serialized message, ``str``
00272     :param numpy: numpy python module
00273     """
00274     try:
00275       if self.header is None:
00276         self.header = std_msgs.msg.Header()
00277       if self.tags is None:
00278         self.tags = None
00279       end = 0
00280       _x = self
00281       start = end
00282       end += 12
00283       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00284       start = end
00285       end += 4
00286       (length,) = _struct_I.unpack(str[start:end])
00287       start = end
00288       end += length
00289       if python3:
00290         self.header.frame_id = str[start:end].decode('utf-8')
00291       else:
00292         self.header.frame_id = str[start:end]
00293       start = end
00294       end += 4
00295       (length,) = _struct_I.unpack(str[start:end])
00296       self.tags = []
00297       for i in range(0, length):
00298         val1 = april_msgs.msg.TagPose()
00299         start = end
00300         end += 4
00301         (val1.id,) = _struct_i.unpack(str[start:end])
00302         start = end
00303         end += 4
00304         (length,) = _struct_I.unpack(str[start:end])
00305         start = end
00306         end += length
00307         if python3:
00308           val1.family = str[start:end].decode('utf-8')
00309         else:
00310           val1.family = str[start:end]
00311         start = end
00312         end += 4
00313         (val1.hamming_distance,) = _struct_i.unpack(str[start:end])
00314         start = end
00315         end += 4
00316         (length,) = _struct_I.unpack(str[start:end])
00317         val1.image_coordinates = []
00318         for i in range(0, length):
00319           val2 = geometry_msgs.msg.Point32()
00320           _x = val2
00321           start = end
00322           end += 12
00323           (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00324           val1.image_coordinates.append(val2)
00325         _v10 = val1.pose
00326         _v11 = _v10.position
00327         _x = _v11
00328         start = end
00329         end += 24
00330         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00331         _v12 = _v10.orientation
00332         _x = _v12
00333         start = end
00334         end += 32
00335         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00336         self.tags.append(val1)
00337       return self
00338     except struct.error as e:
00339       raise genpy.DeserializationError(e) #most likely buffer underfill
00340 
00341 _struct_I = genpy.struct_I
00342 _struct_i = struct.Struct("<i")
00343 _struct_4d = struct.Struct("<4d")
00344 _struct_3I = struct.Struct("<3I")
00345 _struct_3f = struct.Struct("<3f")
00346 _struct_3d = struct.Struct("<3d")


april_msgs
Author(s): Piyush Khandelwal
autogenerated on Mon Jan 6 2014 11:54:20