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