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