_Point2dStamped.py
Go to the documentation of this file.
00001 """autogenerated by genpy from walk_msgs/Point2dStamped.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 walk_msgs.msg
00008 import std_msgs.msg
00009 
00010 class Point2dStamped(genpy.Message):
00011   _md5sum = "9f7db918fde9989a73131d0d083d049d"
00012   _type = "walk_msgs/Point2dStamped"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 Point2d point
00016 
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data 
00021 # in a particular coordinate frame.
00022 # 
00023 # sequence ID: consecutively increasing ID 
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034 
00035 ================================================================================
00036 MSG: walk_msgs/Point2d
00037 float64 x
00038 float64 y
00039 
00040 """
00041   __slots__ = ['header','point']
00042   _slot_types = ['std_msgs/Header','walk_msgs/Point2d']
00043 
00044   def __init__(self, *args, **kwds):
00045     """
00046     Constructor. Any message fields that are implicitly/explicitly
00047     set to None will be assigned a default value. The recommend
00048     use is keyword arguments as this is more robust to future message
00049     changes.  You cannot mix in-order arguments and keyword arguments.
00050 
00051     The available fields are:
00052        header,point
00053 
00054     :param args: complete set of field values, in .msg order
00055     :param kwds: use keyword arguments corresponding to message field names
00056     to set specific fields.
00057     """
00058     if args or kwds:
00059       super(Point2dStamped, self).__init__(*args, **kwds)
00060       #message fields cannot be None, assign default values for those that are
00061       if self.header is None:
00062         self.header = std_msgs.msg.Header()
00063       if self.point is None:
00064         self.point = walk_msgs.msg.Point2d()
00065     else:
00066       self.header = std_msgs.msg.Header()
00067       self.point = walk_msgs.msg.Point2d()
00068 
00069   def _get_types(self):
00070     """
00071     internal API method
00072     """
00073     return self._slot_types
00074 
00075   def serialize(self, buff):
00076     """
00077     serialize message into buffer
00078     :param buff: buffer, ``StringIO``
00079     """
00080     try:
00081       _x = self
00082       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00083       _x = self.header.frame_id
00084       length = len(_x)
00085       if python3 or type(_x) == unicode:
00086         _x = _x.encode('utf-8')
00087         length = len(_x)
00088       buff.write(struct.pack('<I%ss'%length, length, _x))
00089       _x = self
00090       buff.write(_struct_2d.pack(_x.point.x, _x.point.y))
00091     except struct.error as se: self._check_types(se)
00092     except TypeError as te: self._check_types(te)
00093 
00094   def deserialize(self, str):
00095     """
00096     unpack serialized message in str into this message instance
00097     :param str: byte array of serialized message, ``str``
00098     """
00099     try:
00100       if self.header is None:
00101         self.header = std_msgs.msg.Header()
00102       if self.point is None:
00103         self.point = walk_msgs.msg.Point2d()
00104       end = 0
00105       _x = self
00106       start = end
00107       end += 12
00108       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00109       start = end
00110       end += 4
00111       (length,) = _struct_I.unpack(str[start:end])
00112       start = end
00113       end += length
00114       if python3:
00115         self.header.frame_id = str[start:end].decode('utf-8')
00116       else:
00117         self.header.frame_id = str[start:end]
00118       _x = self
00119       start = end
00120       end += 16
00121       (_x.point.x, _x.point.y,) = _struct_2d.unpack(str[start:end])
00122       return self
00123     except struct.error as e:
00124       raise genpy.DeserializationError(e) #most likely buffer underfill
00125 
00126 
00127   def serialize_numpy(self, buff, numpy):
00128     """
00129     serialize message with numpy array types into buffer
00130     :param buff: buffer, ``StringIO``
00131     :param numpy: numpy python module
00132     """
00133     try:
00134       _x = self
00135       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00136       _x = self.header.frame_id
00137       length = len(_x)
00138       if python3 or type(_x) == unicode:
00139         _x = _x.encode('utf-8')
00140         length = len(_x)
00141       buff.write(struct.pack('<I%ss'%length, length, _x))
00142       _x = self
00143       buff.write(_struct_2d.pack(_x.point.x, _x.point.y))
00144     except struct.error as se: self._check_types(se)
00145     except TypeError as te: self._check_types(te)
00146 
00147   def deserialize_numpy(self, str, numpy):
00148     """
00149     unpack serialized message in str into this message instance using numpy for array types
00150     :param str: byte array of serialized message, ``str``
00151     :param numpy: numpy python module
00152     """
00153     try:
00154       if self.header is None:
00155         self.header = std_msgs.msg.Header()
00156       if self.point is None:
00157         self.point = walk_msgs.msg.Point2d()
00158       end = 0
00159       _x = self
00160       start = end
00161       end += 12
00162       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00163       start = end
00164       end += 4
00165       (length,) = _struct_I.unpack(str[start:end])
00166       start = end
00167       end += length
00168       if python3:
00169         self.header.frame_id = str[start:end].decode('utf-8')
00170       else:
00171         self.header.frame_id = str[start:end]
00172       _x = self
00173       start = end
00174       end += 16
00175       (_x.point.x, _x.point.y,) = _struct_2d.unpack(str[start:end])
00176       return self
00177     except struct.error as e:
00178       raise genpy.DeserializationError(e) #most likely buffer underfill
00179 
00180 _struct_I = genpy.struct_I
00181 _struct_2d = struct.Struct("<2d")
00182 _struct_3I = struct.Struct("<3I")


walk_msgs
Author(s): Thomas Moulard
autogenerated on Sat Dec 28 2013 17:05:25