_Footprint2d.py
Go to the documentation of this file.
00001 """autogenerated by genpy from walk_msgs/Footprint2d.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 genpy
00008 
00009 class Footprint2d(genpy.Message):
00010   _md5sum = "eec7ee92e130c0823cfdeee9490b0167"
00011   _type = "walk_msgs/Footprint2d"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """time beginTime
00014 duration duration
00015 float64 x
00016 float64 y
00017 float64 theta
00018 
00019 """
00020   __slots__ = ['beginTime','duration','x','y','theta']
00021   _slot_types = ['time','duration','float64','float64','float64']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        beginTime,duration,x,y,theta
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(Footprint2d, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.beginTime is None:
00041         self.beginTime = genpy.Time()
00042       if self.duration is None:
00043         self.duration = genpy.Duration()
00044       if self.x is None:
00045         self.x = 0.
00046       if self.y is None:
00047         self.y = 0.
00048       if self.theta is None:
00049         self.theta = 0.
00050     else:
00051       self.beginTime = genpy.Time()
00052       self.duration = genpy.Duration()
00053       self.x = 0.
00054       self.y = 0.
00055       self.theta = 0.
00056 
00057   def _get_types(self):
00058     """
00059     internal API method
00060     """
00061     return self._slot_types
00062 
00063   def serialize(self, buff):
00064     """
00065     serialize message into buffer
00066     :param buff: buffer, ``StringIO``
00067     """
00068     try:
00069       _x = self
00070       buff.write(_struct_2I2i3d.pack(_x.beginTime.secs, _x.beginTime.nsecs, _x.duration.secs, _x.duration.nsecs, _x.x, _x.y, _x.theta))
00071     except struct.error as se: self._check_types(se)
00072     except TypeError as te: self._check_types(te)
00073 
00074   def deserialize(self, str):
00075     """
00076     unpack serialized message in str into this message instance
00077     :param str: byte array of serialized message, ``str``
00078     """
00079     try:
00080       if self.beginTime is None:
00081         self.beginTime = genpy.Time()
00082       if self.duration is None:
00083         self.duration = genpy.Duration()
00084       end = 0
00085       _x = self
00086       start = end
00087       end += 40
00088       (_x.beginTime.secs, _x.beginTime.nsecs, _x.duration.secs, _x.duration.nsecs, _x.x, _x.y, _x.theta,) = _struct_2I2i3d.unpack(str[start:end])
00089       self.beginTime.canon()
00090       self.duration.canon()
00091       return self
00092     except struct.error as e:
00093       raise genpy.DeserializationError(e) #most likely buffer underfill
00094 
00095 
00096   def serialize_numpy(self, buff, numpy):
00097     """
00098     serialize message with numpy array types into buffer
00099     :param buff: buffer, ``StringIO``
00100     :param numpy: numpy python module
00101     """
00102     try:
00103       _x = self
00104       buff.write(_struct_2I2i3d.pack(_x.beginTime.secs, _x.beginTime.nsecs, _x.duration.secs, _x.duration.nsecs, _x.x, _x.y, _x.theta))
00105     except struct.error as se: self._check_types(se)
00106     except TypeError as te: self._check_types(te)
00107 
00108   def deserialize_numpy(self, str, numpy):
00109     """
00110     unpack serialized message in str into this message instance using numpy for array types
00111     :param str: byte array of serialized message, ``str``
00112     :param numpy: numpy python module
00113     """
00114     try:
00115       if self.beginTime is None:
00116         self.beginTime = genpy.Time()
00117       if self.duration is None:
00118         self.duration = genpy.Duration()
00119       end = 0
00120       _x = self
00121       start = end
00122       end += 40
00123       (_x.beginTime.secs, _x.beginTime.nsecs, _x.duration.secs, _x.duration.nsecs, _x.x, _x.y, _x.theta,) = _struct_2I2i3d.unpack(str[start:end])
00124       self.beginTime.canon()
00125       self.duration.canon()
00126       return self
00127     except struct.error as e:
00128       raise genpy.DeserializationError(e) #most likely buffer underfill
00129 
00130 _struct_I = genpy.struct_I
00131 _struct_2I2i3d = struct.Struct("<2I2i3d")


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