00001 """autogenerated by genpy from nao_msgs/FollowPathGoal.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 nav_msgs.msg
00009 import std_msgs.msg
00010
00011 class FollowPathGoal(genpy.Message):
00012 _md5sum = "58d6f138c7de7ef47c75d4b7e5df5472"
00013 _type = "nao_msgs/FollowPathGoal"
00014 _has_header = False
00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00016 # goal: a path to follow
00017 nav_msgs/Path path
00018
00019 ================================================================================
00020 MSG: nav_msgs/Path
00021 #An array of poses that represents a Path for a robot to follow
00022 Header header
00023 geometry_msgs/PoseStamped[] poses
00024
00025 ================================================================================
00026 MSG: std_msgs/Header
00027 # Standard metadata for higher-level stamped data types.
00028 # This is generally used to communicate timestamped data
00029 # in a particular coordinate frame.
00030 #
00031 # sequence ID: consecutively increasing ID
00032 uint32 seq
00033 #Two-integer timestamp that is expressed as:
00034 # * stamp.secs: seconds (stamp_secs) since epoch
00035 # * stamp.nsecs: nanoseconds since stamp_secs
00036 # time-handling sugar is provided by the client library
00037 time stamp
00038 #Frame this data is associated with
00039 # 0: no frame
00040 # 1: global frame
00041 string frame_id
00042
00043 ================================================================================
00044 MSG: geometry_msgs/PoseStamped
00045 # A Pose with reference coordinate frame and timestamp
00046 Header header
00047 Pose pose
00048
00049 ================================================================================
00050 MSG: geometry_msgs/Pose
00051 # A representation of pose in free space, composed of postion and orientation.
00052 Point position
00053 Quaternion orientation
00054
00055 ================================================================================
00056 MSG: geometry_msgs/Point
00057 # This contains the position of a point in free space
00058 float64 x
00059 float64 y
00060 float64 z
00061
00062 ================================================================================
00063 MSG: geometry_msgs/Quaternion
00064 # This represents an orientation in free space in quaternion form.
00065
00066 float64 x
00067 float64 y
00068 float64 z
00069 float64 w
00070
00071 """
00072 __slots__ = ['path']
00073 _slot_types = ['nav_msgs/Path']
00074
00075 def __init__(self, *args, **kwds):
00076 """
00077 Constructor. Any message fields that are implicitly/explicitly
00078 set to None will be assigned a default value. The recommend
00079 use is keyword arguments as this is more robust to future message
00080 changes. You cannot mix in-order arguments and keyword arguments.
00081
00082 The available fields are:
00083 path
00084
00085 :param args: complete set of field values, in .msg order
00086 :param kwds: use keyword arguments corresponding to message field names
00087 to set specific fields.
00088 """
00089 if args or kwds:
00090 super(FollowPathGoal, self).__init__(*args, **kwds)
00091
00092 if self.path is None:
00093 self.path = nav_msgs.msg.Path()
00094 else:
00095 self.path = nav_msgs.msg.Path()
00096
00097 def _get_types(self):
00098 """
00099 internal API method
00100 """
00101 return self._slot_types
00102
00103 def serialize(self, buff):
00104 """
00105 serialize message into buffer
00106 :param buff: buffer, ``StringIO``
00107 """
00108 try:
00109 _x = self
00110 buff.write(_struct_3I.pack(_x.path.header.seq, _x.path.header.stamp.secs, _x.path.header.stamp.nsecs))
00111 _x = self.path.header.frame_id
00112 length = len(_x)
00113 if python3 or type(_x) == unicode:
00114 _x = _x.encode('utf-8')
00115 length = len(_x)
00116 buff.write(struct.pack('<I%ss'%length, length, _x))
00117 length = len(self.path.poses)
00118 buff.write(_struct_I.pack(length))
00119 for val1 in self.path.poses:
00120 _v1 = val1.header
00121 buff.write(_struct_I.pack(_v1.seq))
00122 _v2 = _v1.stamp
00123 _x = _v2
00124 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00125 _x = _v1.frame_id
00126 length = len(_x)
00127 if python3 or type(_x) == unicode:
00128 _x = _x.encode('utf-8')
00129 length = len(_x)
00130 buff.write(struct.pack('<I%ss'%length, length, _x))
00131 _v3 = val1.pose
00132 _v4 = _v3.position
00133 _x = _v4
00134 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00135 _v5 = _v3.orientation
00136 _x = _v5
00137 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00138 except struct.error as se: self._check_types(se)
00139 except TypeError as te: self._check_types(te)
00140
00141 def deserialize(self, str):
00142 """
00143 unpack serialized message in str into this message instance
00144 :param str: byte array of serialized message, ``str``
00145 """
00146 try:
00147 if self.path is None:
00148 self.path = nav_msgs.msg.Path()
00149 end = 0
00150 _x = self
00151 start = end
00152 end += 12
00153 (_x.path.header.seq, _x.path.header.stamp.secs, _x.path.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00154 start = end
00155 end += 4
00156 (length,) = _struct_I.unpack(str[start:end])
00157 start = end
00158 end += length
00159 if python3:
00160 self.path.header.frame_id = str[start:end].decode('utf-8')
00161 else:
00162 self.path.header.frame_id = str[start:end]
00163 start = end
00164 end += 4
00165 (length,) = _struct_I.unpack(str[start:end])
00166 self.path.poses = []
00167 for i in range(0, length):
00168 val1 = geometry_msgs.msg.PoseStamped()
00169 _v6 = val1.header
00170 start = end
00171 end += 4
00172 (_v6.seq,) = _struct_I.unpack(str[start:end])
00173 _v7 = _v6.stamp
00174 _x = _v7
00175 start = end
00176 end += 8
00177 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00178 start = end
00179 end += 4
00180 (length,) = _struct_I.unpack(str[start:end])
00181 start = end
00182 end += length
00183 if python3:
00184 _v6.frame_id = str[start:end].decode('utf-8')
00185 else:
00186 _v6.frame_id = str[start:end]
00187 _v8 = val1.pose
00188 _v9 = _v8.position
00189 _x = _v9
00190 start = end
00191 end += 24
00192 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00193 _v10 = _v8.orientation
00194 _x = _v10
00195 start = end
00196 end += 32
00197 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00198 self.path.poses.append(val1)
00199 return self
00200 except struct.error as e:
00201 raise genpy.DeserializationError(e)
00202
00203
00204 def serialize_numpy(self, buff, numpy):
00205 """
00206 serialize message with numpy array types into buffer
00207 :param buff: buffer, ``StringIO``
00208 :param numpy: numpy python module
00209 """
00210 try:
00211 _x = self
00212 buff.write(_struct_3I.pack(_x.path.header.seq, _x.path.header.stamp.secs, _x.path.header.stamp.nsecs))
00213 _x = self.path.header.frame_id
00214 length = len(_x)
00215 if python3 or type(_x) == unicode:
00216 _x = _x.encode('utf-8')
00217 length = len(_x)
00218 buff.write(struct.pack('<I%ss'%length, length, _x))
00219 length = len(self.path.poses)
00220 buff.write(_struct_I.pack(length))
00221 for val1 in self.path.poses:
00222 _v11 = val1.header
00223 buff.write(_struct_I.pack(_v11.seq))
00224 _v12 = _v11.stamp
00225 _x = _v12
00226 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00227 _x = _v11.frame_id
00228 length = len(_x)
00229 if python3 or type(_x) == unicode:
00230 _x = _x.encode('utf-8')
00231 length = len(_x)
00232 buff.write(struct.pack('<I%ss'%length, length, _x))
00233 _v13 = val1.pose
00234 _v14 = _v13.position
00235 _x = _v14
00236 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00237 _v15 = _v13.orientation
00238 _x = _v15
00239 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00240 except struct.error as se: self._check_types(se)
00241 except TypeError as te: self._check_types(te)
00242
00243 def deserialize_numpy(self, str, numpy):
00244 """
00245 unpack serialized message in str into this message instance using numpy for array types
00246 :param str: byte array of serialized message, ``str``
00247 :param numpy: numpy python module
00248 """
00249 try:
00250 if self.path is None:
00251 self.path = nav_msgs.msg.Path()
00252 end = 0
00253 _x = self
00254 start = end
00255 end += 12
00256 (_x.path.header.seq, _x.path.header.stamp.secs, _x.path.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00257 start = end
00258 end += 4
00259 (length,) = _struct_I.unpack(str[start:end])
00260 start = end
00261 end += length
00262 if python3:
00263 self.path.header.frame_id = str[start:end].decode('utf-8')
00264 else:
00265 self.path.header.frame_id = str[start:end]
00266 start = end
00267 end += 4
00268 (length,) = _struct_I.unpack(str[start:end])
00269 self.path.poses = []
00270 for i in range(0, length):
00271 val1 = geometry_msgs.msg.PoseStamped()
00272 _v16 = val1.header
00273 start = end
00274 end += 4
00275 (_v16.seq,) = _struct_I.unpack(str[start:end])
00276 _v17 = _v16.stamp
00277 _x = _v17
00278 start = end
00279 end += 8
00280 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00281 start = end
00282 end += 4
00283 (length,) = _struct_I.unpack(str[start:end])
00284 start = end
00285 end += length
00286 if python3:
00287 _v16.frame_id = str[start:end].decode('utf-8')
00288 else:
00289 _v16.frame_id = str[start:end]
00290 _v18 = val1.pose
00291 _v19 = _v18.position
00292 _x = _v19
00293 start = end
00294 end += 24
00295 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00296 _v20 = _v18.orientation
00297 _x = _v20
00298 start = end
00299 end += 32
00300 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00301 self.path.poses.append(val1)
00302 return self
00303 except struct.error as e:
00304 raise genpy.DeserializationError(e)
00305
00306 _struct_I = genpy.struct_I
00307 _struct_4d = struct.Struct("<4d")
00308 _struct_3I = struct.Struct("<3I")
00309 _struct_2I = struct.Struct("<2I")
00310 _struct_3d = struct.Struct("<3d")