_PositionString.py
Go to the documentation of this file.
00001 """autogenerated by genpy from position_string_msgs/PositionString.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 std_msgs.msg
00009 
00010 class PositionString(genpy.Message):
00011   _md5sum = "7adb59260ef1ce9ab7745ed4e7582f92"
00012   _type = "position_string_msgs/PositionString"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 geometry_msgs/Point32 pose
00016 string text
00017 
00018 
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data 
00023 # in a particular coordinate frame.
00024 # 
00025 # sequence ID: consecutively increasing ID 
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036 
00037 ================================================================================
00038 MSG: geometry_msgs/Point32
00039 # This contains the position of a point in free space(with 32 bits of precision).
00040 # It is recommeded to use Point wherever possible instead of Point32.  
00041 # 
00042 # This recommendation is to promote interoperability.  
00043 #
00044 # This message is designed to take up less space when sending
00045 # lots of points at once, as in the case of a PointCloud.  
00046 
00047 float32 x
00048 float32 y
00049 float32 z
00050 """
00051   __slots__ = ['header','pose','text']
00052   _slot_types = ['std_msgs/Header','geometry_msgs/Point32','string']
00053 
00054   def __init__(self, *args, **kwds):
00055     """
00056     Constructor. Any message fields that are implicitly/explicitly
00057     set to None will be assigned a default value. The recommend
00058     use is keyword arguments as this is more robust to future message
00059     changes.  You cannot mix in-order arguments and keyword arguments.
00060 
00061     The available fields are:
00062        header,pose,text
00063 
00064     :param args: complete set of field values, in .msg order
00065     :param kwds: use keyword arguments corresponding to message field names
00066     to set specific fields.
00067     """
00068     if args or kwds:
00069       super(PositionString, self).__init__(*args, **kwds)
00070       #message fields cannot be None, assign default values for those that are
00071       if self.header is None:
00072         self.header = std_msgs.msg.Header()
00073       if self.pose is None:
00074         self.pose = geometry_msgs.msg.Point32()
00075       if self.text is None:
00076         self.text = ''
00077     else:
00078       self.header = std_msgs.msg.Header()
00079       self.pose = geometry_msgs.msg.Point32()
00080       self.text = ''
00081 
00082   def _get_types(self):
00083     """
00084     internal API method
00085     """
00086     return self._slot_types
00087 
00088   def serialize(self, buff):
00089     """
00090     serialize message into buffer
00091     :param buff: buffer, ``StringIO``
00092     """
00093     try:
00094       _x = self
00095       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00096       _x = self.header.frame_id
00097       length = len(_x)
00098       if python3 or type(_x) == unicode:
00099         _x = _x.encode('utf-8')
00100         length = len(_x)
00101       buff.write(struct.pack('<I%ss'%length, length, _x))
00102       _x = self
00103       buff.write(_struct_3f.pack(_x.pose.x, _x.pose.y, _x.pose.z))
00104       _x = self.text
00105       length = len(_x)
00106       if python3 or type(_x) == unicode:
00107         _x = _x.encode('utf-8')
00108         length = len(_x)
00109       buff.write(struct.pack('<I%ss'%length, length, _x))
00110     except struct.error as se: self._check_types(se)
00111     except TypeError as te: self._check_types(te)
00112 
00113   def deserialize(self, str):
00114     """
00115     unpack serialized message in str into this message instance
00116     :param str: byte array of serialized message, ``str``
00117     """
00118     try:
00119       if self.header is None:
00120         self.header = std_msgs.msg.Header()
00121       if self.pose is None:
00122         self.pose = geometry_msgs.msg.Point32()
00123       end = 0
00124       _x = self
00125       start = end
00126       end += 12
00127       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00128       start = end
00129       end += 4
00130       (length,) = _struct_I.unpack(str[start:end])
00131       start = end
00132       end += length
00133       if python3:
00134         self.header.frame_id = str[start:end].decode('utf-8')
00135       else:
00136         self.header.frame_id = str[start:end]
00137       _x = self
00138       start = end
00139       end += 12
00140       (_x.pose.x, _x.pose.y, _x.pose.z,) = _struct_3f.unpack(str[start:end])
00141       start = end
00142       end += 4
00143       (length,) = _struct_I.unpack(str[start:end])
00144       start = end
00145       end += length
00146       if python3:
00147         self.text = str[start:end].decode('utf-8')
00148       else:
00149         self.text = str[start:end]
00150       return self
00151     except struct.error as e:
00152       raise genpy.DeserializationError(e) #most likely buffer underfill
00153 
00154 
00155   def serialize_numpy(self, buff, numpy):
00156     """
00157     serialize message with numpy array types into buffer
00158     :param buff: buffer, ``StringIO``
00159     :param numpy: numpy python module
00160     """
00161     try:
00162       _x = self
00163       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00164       _x = self.header.frame_id
00165       length = len(_x)
00166       if python3 or type(_x) == unicode:
00167         _x = _x.encode('utf-8')
00168         length = len(_x)
00169       buff.write(struct.pack('<I%ss'%length, length, _x))
00170       _x = self
00171       buff.write(_struct_3f.pack(_x.pose.x, _x.pose.y, _x.pose.z))
00172       _x = self.text
00173       length = len(_x)
00174       if python3 or type(_x) == unicode:
00175         _x = _x.encode('utf-8')
00176         length = len(_x)
00177       buff.write(struct.pack('<I%ss'%length, length, _x))
00178     except struct.error as se: self._check_types(se)
00179     except TypeError as te: self._check_types(te)
00180 
00181   def deserialize_numpy(self, str, numpy):
00182     """
00183     unpack serialized message in str into this message instance using numpy for array types
00184     :param str: byte array of serialized message, ``str``
00185     :param numpy: numpy python module
00186     """
00187     try:
00188       if self.header is None:
00189         self.header = std_msgs.msg.Header()
00190       if self.pose is None:
00191         self.pose = geometry_msgs.msg.Point32()
00192       end = 0
00193       _x = self
00194       start = end
00195       end += 12
00196       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00197       start = end
00198       end += 4
00199       (length,) = _struct_I.unpack(str[start:end])
00200       start = end
00201       end += length
00202       if python3:
00203         self.header.frame_id = str[start:end].decode('utf-8')
00204       else:
00205         self.header.frame_id = str[start:end]
00206       _x = self
00207       start = end
00208       end += 12
00209       (_x.pose.x, _x.pose.y, _x.pose.z,) = _struct_3f.unpack(str[start:end])
00210       start = end
00211       end += 4
00212       (length,) = _struct_I.unpack(str[start:end])
00213       start = end
00214       end += length
00215       if python3:
00216         self.text = str[start:end].decode('utf-8')
00217       else:
00218         self.text = str[start:end]
00219       return self
00220     except struct.error as e:
00221       raise genpy.DeserializationError(e) #most likely buffer underfill
00222 
00223 _struct_I = genpy.struct_I
00224 _struct_3I = struct.Struct("<3I")
00225 _struct_3f = struct.Struct("<3f")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


position_string_msgs
Author(s): Nico Blodow
autogenerated on Thu May 23 2013 10:03:25