_TagPose.py
Go to the documentation of this file.
00001 """autogenerated by genpy from april_msgs/TagPose.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 
00009 class TagPose(genpy.Message):
00010   _md5sum = "b1fc277fac825b913393e44ccf5d240e"
00011   _type = "april_msgs/TagPose"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """int32 id
00014 string family
00015 int32 hamming_distance
00016 geometry_msgs/Point32[] image_coordinates
00017 geometry_msgs/Pose pose
00018 
00019 ================================================================================
00020 MSG: geometry_msgs/Point32
00021 # This contains the position of a point in free space(with 32 bits of precision).
00022 # It is recommeded to use Point wherever possible instead of Point32.  
00023 # 
00024 # This recommendation is to promote interoperability.  
00025 #
00026 # This message is designed to take up less space when sending
00027 # lots of points at once, as in the case of a PointCloud.  
00028 
00029 float32 x
00030 float32 y
00031 float32 z
00032 ================================================================================
00033 MSG: geometry_msgs/Pose
00034 # A representation of pose in free space, composed of postion and orientation. 
00035 Point position
00036 Quaternion orientation
00037 
00038 ================================================================================
00039 MSG: geometry_msgs/Point
00040 # This contains the position of a point in free space
00041 float64 x
00042 float64 y
00043 float64 z
00044 
00045 ================================================================================
00046 MSG: geometry_msgs/Quaternion
00047 # This represents an orientation in free space in quaternion form.
00048 
00049 float64 x
00050 float64 y
00051 float64 z
00052 float64 w
00053 
00054 """
00055   __slots__ = ['id','family','hamming_distance','image_coordinates','pose']
00056   _slot_types = ['int32','string','int32','geometry_msgs/Point32[]','geometry_msgs/Pose']
00057 
00058   def __init__(self, *args, **kwds):
00059     """
00060     Constructor. Any message fields that are implicitly/explicitly
00061     set to None will be assigned a default value. The recommend
00062     use is keyword arguments as this is more robust to future message
00063     changes.  You cannot mix in-order arguments and keyword arguments.
00064 
00065     The available fields are:
00066        id,family,hamming_distance,image_coordinates,pose
00067 
00068     :param args: complete set of field values, in .msg order
00069     :param kwds: use keyword arguments corresponding to message field names
00070     to set specific fields.
00071     """
00072     if args or kwds:
00073       super(TagPose, self).__init__(*args, **kwds)
00074       #message fields cannot be None, assign default values for those that are
00075       if self.id is None:
00076         self.id = 0
00077       if self.family is None:
00078         self.family = ''
00079       if self.hamming_distance is None:
00080         self.hamming_distance = 0
00081       if self.image_coordinates is None:
00082         self.image_coordinates = []
00083       if self.pose is None:
00084         self.pose = geometry_msgs.msg.Pose()
00085     else:
00086       self.id = 0
00087       self.family = ''
00088       self.hamming_distance = 0
00089       self.image_coordinates = []
00090       self.pose = geometry_msgs.msg.Pose()
00091 
00092   def _get_types(self):
00093     """
00094     internal API method
00095     """
00096     return self._slot_types
00097 
00098   def serialize(self, buff):
00099     """
00100     serialize message into buffer
00101     :param buff: buffer, ``StringIO``
00102     """
00103     try:
00104       buff.write(_struct_i.pack(self.id))
00105       _x = self.family
00106       length = len(_x)
00107       if python3 or type(_x) == unicode:
00108         _x = _x.encode('utf-8')
00109         length = len(_x)
00110       buff.write(struct.pack('<I%ss'%length, length, _x))
00111       buff.write(_struct_i.pack(self.hamming_distance))
00112       length = len(self.image_coordinates)
00113       buff.write(_struct_I.pack(length))
00114       for val1 in self.image_coordinates:
00115         _x = val1
00116         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00117       _x = self
00118       buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w))
00119     except struct.error as se: self._check_types(se)
00120     except TypeError as te: self._check_types(te)
00121 
00122   def deserialize(self, str):
00123     """
00124     unpack serialized message in str into this message instance
00125     :param str: byte array of serialized message, ``str``
00126     """
00127     try:
00128       if self.image_coordinates is None:
00129         self.image_coordinates = None
00130       if self.pose is None:
00131         self.pose = geometry_msgs.msg.Pose()
00132       end = 0
00133       start = end
00134       end += 4
00135       (self.id,) = _struct_i.unpack(str[start:end])
00136       start = end
00137       end += 4
00138       (length,) = _struct_I.unpack(str[start:end])
00139       start = end
00140       end += length
00141       if python3:
00142         self.family = str[start:end].decode('utf-8')
00143       else:
00144         self.family = str[start:end]
00145       start = end
00146       end += 4
00147       (self.hamming_distance,) = _struct_i.unpack(str[start:end])
00148       start = end
00149       end += 4
00150       (length,) = _struct_I.unpack(str[start:end])
00151       self.image_coordinates = []
00152       for i in range(0, length):
00153         val1 = geometry_msgs.msg.Point32()
00154         _x = val1
00155         start = end
00156         end += 12
00157         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00158         self.image_coordinates.append(val1)
00159       _x = self
00160       start = end
00161       end += 56
00162       (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00163       return self
00164     except struct.error as e:
00165       raise genpy.DeserializationError(e) #most likely buffer underfill
00166 
00167 
00168   def serialize_numpy(self, buff, numpy):
00169     """
00170     serialize message with numpy array types into buffer
00171     :param buff: buffer, ``StringIO``
00172     :param numpy: numpy python module
00173     """
00174     try:
00175       buff.write(_struct_i.pack(self.id))
00176       _x = self.family
00177       length = len(_x)
00178       if python3 or type(_x) == unicode:
00179         _x = _x.encode('utf-8')
00180         length = len(_x)
00181       buff.write(struct.pack('<I%ss'%length, length, _x))
00182       buff.write(_struct_i.pack(self.hamming_distance))
00183       length = len(self.image_coordinates)
00184       buff.write(_struct_I.pack(length))
00185       for val1 in self.image_coordinates:
00186         _x = val1
00187         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00188       _x = self
00189       buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w))
00190     except struct.error as se: self._check_types(se)
00191     except TypeError as te: self._check_types(te)
00192 
00193   def deserialize_numpy(self, str, numpy):
00194     """
00195     unpack serialized message in str into this message instance using numpy for array types
00196     :param str: byte array of serialized message, ``str``
00197     :param numpy: numpy python module
00198     """
00199     try:
00200       if self.image_coordinates is None:
00201         self.image_coordinates = None
00202       if self.pose is None:
00203         self.pose = geometry_msgs.msg.Pose()
00204       end = 0
00205       start = end
00206       end += 4
00207       (self.id,) = _struct_i.unpack(str[start:end])
00208       start = end
00209       end += 4
00210       (length,) = _struct_I.unpack(str[start:end])
00211       start = end
00212       end += length
00213       if python3:
00214         self.family = str[start:end].decode('utf-8')
00215       else:
00216         self.family = str[start:end]
00217       start = end
00218       end += 4
00219       (self.hamming_distance,) = _struct_i.unpack(str[start:end])
00220       start = end
00221       end += 4
00222       (length,) = _struct_I.unpack(str[start:end])
00223       self.image_coordinates = []
00224       for i in range(0, length):
00225         val1 = geometry_msgs.msg.Point32()
00226         _x = val1
00227         start = end
00228         end += 12
00229         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00230         self.image_coordinates.append(val1)
00231       _x = self
00232       start = end
00233       end += 56
00234       (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00235       return self
00236     except struct.error as e:
00237       raise genpy.DeserializationError(e) #most likely buffer underfill
00238 
00239 _struct_I = genpy.struct_I
00240 _struct_i = struct.Struct("<i")
00241 _struct_7d = struct.Struct("<7d")
00242 _struct_3f = struct.Struct("<3f")


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