_AlvarMarkers.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ar_track_alvar/AlvarMarkers.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 ar_track_alvar.msg
00009 import std_msgs.msg
00010 
00011 class AlvarMarkers(genpy.Message):
00012   _md5sum = "943fe17bfb0b4ea7890368d0b25ad0ad"
00013   _type = "ar_track_alvar/AlvarMarkers"
00014   _has_header = True #flag to mark the presence of a Header object
00015   _full_text = """Header header
00016 AlvarMarker[] markers
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: ar_track_alvar/AlvarMarker
00038 Header header
00039 uint32 id
00040 uint32 confidence
00041 geometry_msgs/PoseStamped pose
00042 
00043 
00044 ================================================================================
00045 MSG: geometry_msgs/PoseStamped
00046 # A Pose with reference coordinate frame and timestamp
00047 Header header
00048 Pose pose
00049 
00050 ================================================================================
00051 MSG: geometry_msgs/Pose
00052 # A representation of pose in free space, composed of postion and orientation. 
00053 Point position
00054 Quaternion orientation
00055 
00056 ================================================================================
00057 MSG: geometry_msgs/Point
00058 # This contains the position of a point in free space
00059 float64 x
00060 float64 y
00061 float64 z
00062 
00063 ================================================================================
00064 MSG: geometry_msgs/Quaternion
00065 # This represents an orientation in free space in quaternion form.
00066 
00067 float64 x
00068 float64 y
00069 float64 z
00070 float64 w
00071 
00072 """
00073   __slots__ = ['header','markers']
00074   _slot_types = ['std_msgs/Header','ar_track_alvar/AlvarMarker[]']
00075 
00076   def __init__(self, *args, **kwds):
00077     """
00078     Constructor. Any message fields that are implicitly/explicitly
00079     set to None will be assigned a default value. The recommend
00080     use is keyword arguments as this is more robust to future message
00081     changes.  You cannot mix in-order arguments and keyword arguments.
00082 
00083     The available fields are:
00084        header,markers
00085 
00086     :param args: complete set of field values, in .msg order
00087     :param kwds: use keyword arguments corresponding to message field names
00088     to set specific fields.
00089     """
00090     if args or kwds:
00091       super(AlvarMarkers, self).__init__(*args, **kwds)
00092       #message fields cannot be None, assign default values for those that are
00093       if self.header is None:
00094         self.header = std_msgs.msg.Header()
00095       if self.markers is None:
00096         self.markers = []
00097     else:
00098       self.header = std_msgs.msg.Header()
00099       self.markers = []
00100 
00101   def _get_types(self):
00102     """
00103     internal API method
00104     """
00105     return self._slot_types
00106 
00107   def serialize(self, buff):
00108     """
00109     serialize message into buffer
00110     :param buff: buffer, ``StringIO``
00111     """
00112     try:
00113       _x = self
00114       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00115       _x = self.header.frame_id
00116       length = len(_x)
00117       if python3 or type(_x) == unicode:
00118         _x = _x.encode('utf-8')
00119         length = len(_x)
00120       buff.write(struct.pack('<I%ss'%length, length, _x))
00121       length = len(self.markers)
00122       buff.write(_struct_I.pack(length))
00123       for val1 in self.markers:
00124         _v1 = val1.header
00125         buff.write(_struct_I.pack(_v1.seq))
00126         _v2 = _v1.stamp
00127         _x = _v2
00128         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00129         _x = _v1.frame_id
00130         length = len(_x)
00131         if python3 or type(_x) == unicode:
00132           _x = _x.encode('utf-8')
00133           length = len(_x)
00134         buff.write(struct.pack('<I%ss'%length, length, _x))
00135         _x = val1
00136         buff.write(_struct_2I.pack(_x.id, _x.confidence))
00137         _v3 = val1.pose
00138         _v4 = _v3.header
00139         buff.write(_struct_I.pack(_v4.seq))
00140         _v5 = _v4.stamp
00141         _x = _v5
00142         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00143         _x = _v4.frame_id
00144         length = len(_x)
00145         if python3 or type(_x) == unicode:
00146           _x = _x.encode('utf-8')
00147           length = len(_x)
00148         buff.write(struct.pack('<I%ss'%length, length, _x))
00149         _v6 = _v3.pose
00150         _v7 = _v6.position
00151         _x = _v7
00152         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00153         _v8 = _v6.orientation
00154         _x = _v8
00155         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00156     except struct.error as se: self._check_types(se)
00157     except TypeError as te: self._check_types(te)
00158 
00159   def deserialize(self, str):
00160     """
00161     unpack serialized message in str into this message instance
00162     :param str: byte array of serialized message, ``str``
00163     """
00164     try:
00165       if self.header is None:
00166         self.header = std_msgs.msg.Header()
00167       if self.markers is None:
00168         self.markers = None
00169       end = 0
00170       _x = self
00171       start = end
00172       end += 12
00173       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00174       start = end
00175       end += 4
00176       (length,) = _struct_I.unpack(str[start:end])
00177       start = end
00178       end += length
00179       if python3:
00180         self.header.frame_id = str[start:end].decode('utf-8')
00181       else:
00182         self.header.frame_id = str[start:end]
00183       start = end
00184       end += 4
00185       (length,) = _struct_I.unpack(str[start:end])
00186       self.markers = []
00187       for i in range(0, length):
00188         val1 = ar_track_alvar.msg.AlvarMarker()
00189         _v9 = val1.header
00190         start = end
00191         end += 4
00192         (_v9.seq,) = _struct_I.unpack(str[start:end])
00193         _v10 = _v9.stamp
00194         _x = _v10
00195         start = end
00196         end += 8
00197         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00198         start = end
00199         end += 4
00200         (length,) = _struct_I.unpack(str[start:end])
00201         start = end
00202         end += length
00203         if python3:
00204           _v9.frame_id = str[start:end].decode('utf-8')
00205         else:
00206           _v9.frame_id = str[start:end]
00207         _x = val1
00208         start = end
00209         end += 8
00210         (_x.id, _x.confidence,) = _struct_2I.unpack(str[start:end])
00211         _v11 = val1.pose
00212         _v12 = _v11.header
00213         start = end
00214         end += 4
00215         (_v12.seq,) = _struct_I.unpack(str[start:end])
00216         _v13 = _v12.stamp
00217         _x = _v13
00218         start = end
00219         end += 8
00220         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00221         start = end
00222         end += 4
00223         (length,) = _struct_I.unpack(str[start:end])
00224         start = end
00225         end += length
00226         if python3:
00227           _v12.frame_id = str[start:end].decode('utf-8')
00228         else:
00229           _v12.frame_id = str[start:end]
00230         _v14 = _v11.pose
00231         _v15 = _v14.position
00232         _x = _v15
00233         start = end
00234         end += 24
00235         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00236         _v16 = _v14.orientation
00237         _x = _v16
00238         start = end
00239         end += 32
00240         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00241         self.markers.append(val1)
00242       return self
00243     except struct.error as e:
00244       raise genpy.DeserializationError(e) #most likely buffer underfill
00245 
00246 
00247   def serialize_numpy(self, buff, numpy):
00248     """
00249     serialize message with numpy array types into buffer
00250     :param buff: buffer, ``StringIO``
00251     :param numpy: numpy python module
00252     """
00253     try:
00254       _x = self
00255       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00256       _x = self.header.frame_id
00257       length = len(_x)
00258       if python3 or type(_x) == unicode:
00259         _x = _x.encode('utf-8')
00260         length = len(_x)
00261       buff.write(struct.pack('<I%ss'%length, length, _x))
00262       length = len(self.markers)
00263       buff.write(_struct_I.pack(length))
00264       for val1 in self.markers:
00265         _v17 = val1.header
00266         buff.write(_struct_I.pack(_v17.seq))
00267         _v18 = _v17.stamp
00268         _x = _v18
00269         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00270         _x = _v17.frame_id
00271         length = len(_x)
00272         if python3 or type(_x) == unicode:
00273           _x = _x.encode('utf-8')
00274           length = len(_x)
00275         buff.write(struct.pack('<I%ss'%length, length, _x))
00276         _x = val1
00277         buff.write(_struct_2I.pack(_x.id, _x.confidence))
00278         _v19 = val1.pose
00279         _v20 = _v19.header
00280         buff.write(_struct_I.pack(_v20.seq))
00281         _v21 = _v20.stamp
00282         _x = _v21
00283         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00284         _x = _v20.frame_id
00285         length = len(_x)
00286         if python3 or type(_x) == unicode:
00287           _x = _x.encode('utf-8')
00288           length = len(_x)
00289         buff.write(struct.pack('<I%ss'%length, length, _x))
00290         _v22 = _v19.pose
00291         _v23 = _v22.position
00292         _x = _v23
00293         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00294         _v24 = _v22.orientation
00295         _x = _v24
00296         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00297     except struct.error as se: self._check_types(se)
00298     except TypeError as te: self._check_types(te)
00299 
00300   def deserialize_numpy(self, str, numpy):
00301     """
00302     unpack serialized message in str into this message instance using numpy for array types
00303     :param str: byte array of serialized message, ``str``
00304     :param numpy: numpy python module
00305     """
00306     try:
00307       if self.header is None:
00308         self.header = std_msgs.msg.Header()
00309       if self.markers is None:
00310         self.markers = None
00311       end = 0
00312       _x = self
00313       start = end
00314       end += 12
00315       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00316       start = end
00317       end += 4
00318       (length,) = _struct_I.unpack(str[start:end])
00319       start = end
00320       end += length
00321       if python3:
00322         self.header.frame_id = str[start:end].decode('utf-8')
00323       else:
00324         self.header.frame_id = str[start:end]
00325       start = end
00326       end += 4
00327       (length,) = _struct_I.unpack(str[start:end])
00328       self.markers = []
00329       for i in range(0, length):
00330         val1 = ar_track_alvar.msg.AlvarMarker()
00331         _v25 = val1.header
00332         start = end
00333         end += 4
00334         (_v25.seq,) = _struct_I.unpack(str[start:end])
00335         _v26 = _v25.stamp
00336         _x = _v26
00337         start = end
00338         end += 8
00339         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00340         start = end
00341         end += 4
00342         (length,) = _struct_I.unpack(str[start:end])
00343         start = end
00344         end += length
00345         if python3:
00346           _v25.frame_id = str[start:end].decode('utf-8')
00347         else:
00348           _v25.frame_id = str[start:end]
00349         _x = val1
00350         start = end
00351         end += 8
00352         (_x.id, _x.confidence,) = _struct_2I.unpack(str[start:end])
00353         _v27 = val1.pose
00354         _v28 = _v27.header
00355         start = end
00356         end += 4
00357         (_v28.seq,) = _struct_I.unpack(str[start:end])
00358         _v29 = _v28.stamp
00359         _x = _v29
00360         start = end
00361         end += 8
00362         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00363         start = end
00364         end += 4
00365         (length,) = _struct_I.unpack(str[start:end])
00366         start = end
00367         end += length
00368         if python3:
00369           _v28.frame_id = str[start:end].decode('utf-8')
00370         else:
00371           _v28.frame_id = str[start:end]
00372         _v30 = _v27.pose
00373         _v31 = _v30.position
00374         _x = _v31
00375         start = end
00376         end += 24
00377         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00378         _v32 = _v30.orientation
00379         _x = _v32
00380         start = end
00381         end += 32
00382         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00383         self.markers.append(val1)
00384       return self
00385     except struct.error as e:
00386       raise genpy.DeserializationError(e) #most likely buffer underfill
00387 
00388 _struct_I = genpy.struct_I
00389 _struct_4d = struct.Struct("<4d")
00390 _struct_3I = struct.Struct("<3I")
00391 _struct_2I = struct.Struct("<2I")
00392 _struct_3d = struct.Struct("<3d")


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Sat Dec 28 2013 16:46:15