00001 """autogenerated by genpy from walk_msgs/PathPoint2d.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 PathPoint2d(genpy.Message):
00011 _md5sum = "365a75fd6de0c9b9ad6ea474162db164"
00012 _type = "walk_msgs/PathPoint2d"
00013 _has_header = True
00014 _full_text = """Header header
00015 walk_msgs/Point2dStamped[] points
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/Point2dStamped
00037 Header header
00038 Point2d point
00039
00040 ================================================================================
00041 MSG: walk_msgs/Point2d
00042 float64 x
00043 float64 y
00044
00045 """
00046 __slots__ = ['header','points']
00047 _slot_types = ['std_msgs/Header','walk_msgs/Point2dStamped[]']
00048
00049 def __init__(self, *args, **kwds):
00050 """
00051 Constructor. Any message fields that are implicitly/explicitly
00052 set to None will be assigned a default value. The recommend
00053 use is keyword arguments as this is more robust to future message
00054 changes. You cannot mix in-order arguments and keyword arguments.
00055
00056 The available fields are:
00057 header,points
00058
00059 :param args: complete set of field values, in .msg order
00060 :param kwds: use keyword arguments corresponding to message field names
00061 to set specific fields.
00062 """
00063 if args or kwds:
00064 super(PathPoint2d, self).__init__(*args, **kwds)
00065
00066 if self.header is None:
00067 self.header = std_msgs.msg.Header()
00068 if self.points is None:
00069 self.points = []
00070 else:
00071 self.header = std_msgs.msg.Header()
00072 self.points = []
00073
00074 def _get_types(self):
00075 """
00076 internal API method
00077 """
00078 return self._slot_types
00079
00080 def serialize(self, buff):
00081 """
00082 serialize message into buffer
00083 :param buff: buffer, ``StringIO``
00084 """
00085 try:
00086 _x = self
00087 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00088 _x = self.header.frame_id
00089 length = len(_x)
00090 if python3 or type(_x) == unicode:
00091 _x = _x.encode('utf-8')
00092 length = len(_x)
00093 buff.write(struct.pack('<I%ss'%length, length, _x))
00094 length = len(self.points)
00095 buff.write(_struct_I.pack(length))
00096 for val1 in self.points:
00097 _v1 = val1.header
00098 buff.write(_struct_I.pack(_v1.seq))
00099 _v2 = _v1.stamp
00100 _x = _v2
00101 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00102 _x = _v1.frame_id
00103 length = len(_x)
00104 if python3 or type(_x) == unicode:
00105 _x = _x.encode('utf-8')
00106 length = len(_x)
00107 buff.write(struct.pack('<I%ss'%length, length, _x))
00108 _v3 = val1.point
00109 _x = _v3
00110 buff.write(_struct_2d.pack(_x.x, _x.y))
00111 except struct.error as se: self._check_types(se)
00112 except TypeError as te: self._check_types(te)
00113
00114 def deserialize(self, str):
00115 """
00116 unpack serialized message in str into this message instance
00117 :param str: byte array of serialized message, ``str``
00118 """
00119 try:
00120 if self.header is None:
00121 self.header = std_msgs.msg.Header()
00122 if self.points is None:
00123 self.points = None
00124 end = 0
00125 _x = self
00126 start = end
00127 end += 12
00128 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00129 start = end
00130 end += 4
00131 (length,) = _struct_I.unpack(str[start:end])
00132 start = end
00133 end += length
00134 if python3:
00135 self.header.frame_id = str[start:end].decode('utf-8')
00136 else:
00137 self.header.frame_id = str[start:end]
00138 start = end
00139 end += 4
00140 (length,) = _struct_I.unpack(str[start:end])
00141 self.points = []
00142 for i in range(0, length):
00143 val1 = walk_msgs.msg.Point2dStamped()
00144 _v4 = val1.header
00145 start = end
00146 end += 4
00147 (_v4.seq,) = _struct_I.unpack(str[start:end])
00148 _v5 = _v4.stamp
00149 _x = _v5
00150 start = end
00151 end += 8
00152 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00153 start = end
00154 end += 4
00155 (length,) = _struct_I.unpack(str[start:end])
00156 start = end
00157 end += length
00158 if python3:
00159 _v4.frame_id = str[start:end].decode('utf-8')
00160 else:
00161 _v4.frame_id = str[start:end]
00162 _v6 = val1.point
00163 _x = _v6
00164 start = end
00165 end += 16
00166 (_x.x, _x.y,) = _struct_2d.unpack(str[start:end])
00167 self.points.append(val1)
00168 return self
00169 except struct.error as e:
00170 raise genpy.DeserializationError(e)
00171
00172
00173 def serialize_numpy(self, buff, numpy):
00174 """
00175 serialize message with numpy array types into buffer
00176 :param buff: buffer, ``StringIO``
00177 :param numpy: numpy python module
00178 """
00179 try:
00180 _x = self
00181 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00182 _x = self.header.frame_id
00183 length = len(_x)
00184 if python3 or type(_x) == unicode:
00185 _x = _x.encode('utf-8')
00186 length = len(_x)
00187 buff.write(struct.pack('<I%ss'%length, length, _x))
00188 length = len(self.points)
00189 buff.write(_struct_I.pack(length))
00190 for val1 in self.points:
00191 _v7 = val1.header
00192 buff.write(_struct_I.pack(_v7.seq))
00193 _v8 = _v7.stamp
00194 _x = _v8
00195 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00196 _x = _v7.frame_id
00197 length = len(_x)
00198 if python3 or type(_x) == unicode:
00199 _x = _x.encode('utf-8')
00200 length = len(_x)
00201 buff.write(struct.pack('<I%ss'%length, length, _x))
00202 _v9 = val1.point
00203 _x = _v9
00204 buff.write(_struct_2d.pack(_x.x, _x.y))
00205 except struct.error as se: self._check_types(se)
00206 except TypeError as te: self._check_types(te)
00207
00208 def deserialize_numpy(self, str, numpy):
00209 """
00210 unpack serialized message in str into this message instance using numpy for array types
00211 :param str: byte array of serialized message, ``str``
00212 :param numpy: numpy python module
00213 """
00214 try:
00215 if self.header is None:
00216 self.header = std_msgs.msg.Header()
00217 if self.points is None:
00218 self.points = None
00219 end = 0
00220 _x = self
00221 start = end
00222 end += 12
00223 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00224 start = end
00225 end += 4
00226 (length,) = _struct_I.unpack(str[start:end])
00227 start = end
00228 end += length
00229 if python3:
00230 self.header.frame_id = str[start:end].decode('utf-8')
00231 else:
00232 self.header.frame_id = str[start:end]
00233 start = end
00234 end += 4
00235 (length,) = _struct_I.unpack(str[start:end])
00236 self.points = []
00237 for i in range(0, length):
00238 val1 = walk_msgs.msg.Point2dStamped()
00239 _v10 = val1.header
00240 start = end
00241 end += 4
00242 (_v10.seq,) = _struct_I.unpack(str[start:end])
00243 _v11 = _v10.stamp
00244 _x = _v11
00245 start = end
00246 end += 8
00247 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00248 start = end
00249 end += 4
00250 (length,) = _struct_I.unpack(str[start:end])
00251 start = end
00252 end += length
00253 if python3:
00254 _v10.frame_id = str[start:end].decode('utf-8')
00255 else:
00256 _v10.frame_id = str[start:end]
00257 _v12 = val1.point
00258 _x = _v12
00259 start = end
00260 end += 16
00261 (_x.x, _x.y,) = _struct_2d.unpack(str[start:end])
00262 self.points.append(val1)
00263 return self
00264 except struct.error as e:
00265 raise genpy.DeserializationError(e)
00266
00267 _struct_I = genpy.struct_I
00268 _struct_2d = struct.Struct("<2d")
00269 _struct_3I = struct.Struct("<3I")
00270 _struct_2I = struct.Struct("<2I")