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