$search
00001 """autogenerated by genmsg_py from PathPoint2d.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import walk_msgs.msg 00006 import std_msgs.msg 00007 00008 class PathPoint2d(roslib.message.Message): 00009 _md5sum = "365a75fd6de0c9b9ad6ea474162db164" 00010 _type = "walk_msgs/PathPoint2d" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """Header header 00013 walk_msgs/Point2dStamped[] points 00014 00015 ================================================================================ 00016 MSG: std_msgs/Header 00017 # Standard metadata for higher-level stamped data types. 00018 # This is generally used to communicate timestamped data 00019 # in a particular coordinate frame. 00020 # 00021 # sequence ID: consecutively increasing ID 00022 uint32 seq 00023 #Two-integer timestamp that is expressed as: 00024 # * stamp.secs: seconds (stamp_secs) since epoch 00025 # * stamp.nsecs: nanoseconds since stamp_secs 00026 # time-handling sugar is provided by the client library 00027 time stamp 00028 #Frame this data is associated with 00029 # 0: no frame 00030 # 1: global frame 00031 string frame_id 00032 00033 ================================================================================ 00034 MSG: walk_msgs/Point2dStamped 00035 Header header 00036 Point2d point 00037 00038 ================================================================================ 00039 MSG: walk_msgs/Point2d 00040 float64 x 00041 float64 y 00042 00043 """ 00044 __slots__ = ['header','points'] 00045 _slot_types = ['Header','walk_msgs/Point2dStamped[]'] 00046 00047 def __init__(self, *args, **kwds): 00048 """ 00049 Constructor. Any message fields that are implicitly/explicitly 00050 set to None will be assigned a default value. The recommend 00051 use is keyword arguments as this is more robust to future message 00052 changes. You cannot mix in-order arguments and keyword arguments. 00053 00054 The available fields are: 00055 header,points 00056 00057 @param args: complete set of field values, in .msg order 00058 @param kwds: use keyword arguments corresponding to message field names 00059 to set specific fields. 00060 """ 00061 if args or kwds: 00062 super(PathPoint2d, self).__init__(*args, **kwds) 00063 #message fields cannot be None, assign default values for those that are 00064 if self.header is None: 00065 self.header = std_msgs.msg._Header.Header() 00066 if self.points is None: 00067 self.points = [] 00068 else: 00069 self.header = std_msgs.msg._Header.Header() 00070 self.points = [] 00071 00072 def _get_types(self): 00073 """ 00074 internal API method 00075 """ 00076 return self._slot_types 00077 00078 def serialize(self, buff): 00079 """ 00080 serialize message into buffer 00081 @param buff: buffer 00082 @type buff: StringIO 00083 """ 00084 try: 00085 _x = self 00086 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00087 _x = self.header.frame_id 00088 length = len(_x) 00089 buff.write(struct.pack('<I%ss'%length, length, _x)) 00090 length = len(self.points) 00091 buff.write(_struct_I.pack(length)) 00092 for val1 in self.points: 00093 _v1 = val1.header 00094 buff.write(_struct_I.pack(_v1.seq)) 00095 _v2 = _v1.stamp 00096 _x = _v2 00097 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00098 _x = _v1.frame_id 00099 length = len(_x) 00100 buff.write(struct.pack('<I%ss'%length, length, _x)) 00101 _v3 = val1.point 00102 _x = _v3 00103 buff.write(_struct_2d.pack(_x.x, _x.y)) 00104 except struct.error as se: self._check_types(se) 00105 except TypeError as te: self._check_types(te) 00106 00107 def deserialize(self, str): 00108 """ 00109 unpack serialized message in str into this message instance 00110 @param str: byte array of serialized message 00111 @type str: str 00112 """ 00113 try: 00114 if self.header is None: 00115 self.header = std_msgs.msg._Header.Header() 00116 end = 0 00117 _x = self 00118 start = end 00119 end += 12 00120 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00121 start = end 00122 end += 4 00123 (length,) = _struct_I.unpack(str[start:end]) 00124 start = end 00125 end += length 00126 self.header.frame_id = str[start:end] 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 self.points = [] 00131 for i in range(0, length): 00132 val1 = walk_msgs.msg.Point2dStamped() 00133 _v4 = val1.header 00134 start = end 00135 end += 4 00136 (_v4.seq,) = _struct_I.unpack(str[start:end]) 00137 _v5 = _v4.stamp 00138 _x = _v5 00139 start = end 00140 end += 8 00141 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00142 start = end 00143 end += 4 00144 (length,) = _struct_I.unpack(str[start:end]) 00145 start = end 00146 end += length 00147 _v4.frame_id = str[start:end] 00148 _v6 = val1.point 00149 _x = _v6 00150 start = end 00151 end += 16 00152 (_x.x, _x.y,) = _struct_2d.unpack(str[start:end]) 00153 self.points.append(val1) 00154 return self 00155 except struct.error as e: 00156 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00157 00158 00159 def serialize_numpy(self, buff, numpy): 00160 """ 00161 serialize message with numpy array types into buffer 00162 @param buff: buffer 00163 @type buff: StringIO 00164 @param numpy: numpy python module 00165 @type numpy module 00166 """ 00167 try: 00168 _x = self 00169 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00170 _x = self.header.frame_id 00171 length = len(_x) 00172 buff.write(struct.pack('<I%ss'%length, length, _x)) 00173 length = len(self.points) 00174 buff.write(_struct_I.pack(length)) 00175 for val1 in self.points: 00176 _v7 = val1.header 00177 buff.write(_struct_I.pack(_v7.seq)) 00178 _v8 = _v7.stamp 00179 _x = _v8 00180 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00181 _x = _v7.frame_id 00182 length = len(_x) 00183 buff.write(struct.pack('<I%ss'%length, length, _x)) 00184 _v9 = val1.point 00185 _x = _v9 00186 buff.write(_struct_2d.pack(_x.x, _x.y)) 00187 except struct.error as se: self._check_types(se) 00188 except TypeError as te: self._check_types(te) 00189 00190 def deserialize_numpy(self, str, numpy): 00191 """ 00192 unpack serialized message in str into this message instance using numpy for array types 00193 @param str: byte array of serialized message 00194 @type str: str 00195 @param numpy: numpy python module 00196 @type numpy: module 00197 """ 00198 try: 00199 if self.header is None: 00200 self.header = std_msgs.msg._Header.Header() 00201 end = 0 00202 _x = self 00203 start = end 00204 end += 12 00205 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00206 start = end 00207 end += 4 00208 (length,) = _struct_I.unpack(str[start:end]) 00209 start = end 00210 end += length 00211 self.header.frame_id = str[start:end] 00212 start = end 00213 end += 4 00214 (length,) = _struct_I.unpack(str[start:end]) 00215 self.points = [] 00216 for i in range(0, length): 00217 val1 = walk_msgs.msg.Point2dStamped() 00218 _v10 = val1.header 00219 start = end 00220 end += 4 00221 (_v10.seq,) = _struct_I.unpack(str[start:end]) 00222 _v11 = _v10.stamp 00223 _x = _v11 00224 start = end 00225 end += 8 00226 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00227 start = end 00228 end += 4 00229 (length,) = _struct_I.unpack(str[start:end]) 00230 start = end 00231 end += length 00232 _v10.frame_id = str[start:end] 00233 _v12 = val1.point 00234 _x = _v12 00235 start = end 00236 end += 16 00237 (_x.x, _x.y,) = _struct_2d.unpack(str[start:end]) 00238 self.points.append(val1) 00239 return self 00240 except struct.error as e: 00241 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00242 00243 _struct_I = roslib.message.struct_I 00244 _struct_2d = struct.Struct("<2d") 00245 _struct_3I = struct.Struct("<3I") 00246 _struct_2I = struct.Struct("<2I")