00001 """autogenerated by genpy from pddl_msgs/PDDLPlannerActionResult.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 pddl_msgs.msg
00008 import genpy
00009 import actionlib_msgs.msg
00010 import std_msgs.msg
00011
00012 class PDDLPlannerActionResult(genpy.Message):
00013 _md5sum = "6812dc78140f8e7ee00a5611d6929709"
00014 _type = "pddl_msgs/PDDLPlannerActionResult"
00015 _has_header = True
00016 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017
00018 Header header
00019 actionlib_msgs/GoalStatus status
00020 PDDLPlannerResult result
00021
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data
00026 # in a particular coordinate frame.
00027 #
00028 # sequence ID: consecutively increasing ID
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039
00040 ================================================================================
00041 MSG: actionlib_msgs/GoalStatus
00042 GoalID goal_id
00043 uint8 status
00044 uint8 PENDING = 0 # The goal has yet to be processed by the action server
00045 uint8 ACTIVE = 1 # The goal is currently being processed by the action server
00046 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing
00047 # and has since completed its execution (Terminal State)
00048 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State)
00049 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due
00050 # to some failure (Terminal State)
00051 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed,
00052 # because the goal was unattainable or invalid (Terminal State)
00053 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing
00054 # and has not yet completed execution
00055 uint8 RECALLING = 7 # The goal received a cancel request before it started executing,
00056 # but the action server has not yet confirmed that the goal is canceled
00057 uint8 RECALLED = 8 # The goal received a cancel request before it started executing
00058 # and was successfully cancelled (Terminal State)
00059 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be
00060 # sent over the wire by an action server
00061
00062 #Allow for the user to associate a string with GoalStatus for debugging
00063 string text
00064
00065
00066 ================================================================================
00067 MSG: actionlib_msgs/GoalID
00068 # The stamp should store the time at which this goal was requested.
00069 # It is used by an action server when it tries to preempt all
00070 # goals that were requested before a certain time
00071 time stamp
00072
00073 # The id provides a way to associate feedback and
00074 # result message with specific goal requests. The id
00075 # specified must be unique.
00076 string id
00077
00078
00079 ================================================================================
00080 MSG: pddl_msgs/PDDLPlannerResult
00081 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00082 #result
00083 string[] data
00084 pddl_msgs/PDDLStep[] sequence
00085
00086 ================================================================================
00087 MSG: pddl_msgs/PDDLStep
00088 string action
00089 string[] args
00090
00091 """
00092 __slots__ = ['header','status','result']
00093 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','pddl_msgs/PDDLPlannerResult']
00094
00095 def __init__(self, *args, **kwds):
00096 """
00097 Constructor. Any message fields that are implicitly/explicitly
00098 set to None will be assigned a default value. The recommend
00099 use is keyword arguments as this is more robust to future message
00100 changes. You cannot mix in-order arguments and keyword arguments.
00101
00102 The available fields are:
00103 header,status,result
00104
00105 :param args: complete set of field values, in .msg order
00106 :param kwds: use keyword arguments corresponding to message field names
00107 to set specific fields.
00108 """
00109 if args or kwds:
00110 super(PDDLPlannerActionResult, self).__init__(*args, **kwds)
00111
00112 if self.header is None:
00113 self.header = std_msgs.msg.Header()
00114 if self.status is None:
00115 self.status = actionlib_msgs.msg.GoalStatus()
00116 if self.result is None:
00117 self.result = pddl_msgs.msg.PDDLPlannerResult()
00118 else:
00119 self.header = std_msgs.msg.Header()
00120 self.status = actionlib_msgs.msg.GoalStatus()
00121 self.result = pddl_msgs.msg.PDDLPlannerResult()
00122
00123 def _get_types(self):
00124 """
00125 internal API method
00126 """
00127 return self._slot_types
00128
00129 def serialize(self, buff):
00130 """
00131 serialize message into buffer
00132 :param buff: buffer, ``StringIO``
00133 """
00134 try:
00135 _x = self
00136 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00137 _x = self.header.frame_id
00138 length = len(_x)
00139 if python3 or type(_x) == unicode:
00140 _x = _x.encode('utf-8')
00141 length = len(_x)
00142 buff.write(struct.pack('<I%ss'%length, length, _x))
00143 _x = self
00144 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00145 _x = self.status.goal_id.id
00146 length = len(_x)
00147 if python3 or type(_x) == unicode:
00148 _x = _x.encode('utf-8')
00149 length = len(_x)
00150 buff.write(struct.pack('<I%ss'%length, length, _x))
00151 buff.write(_struct_B.pack(self.status.status))
00152 _x = self.status.text
00153 length = len(_x)
00154 if python3 or type(_x) == unicode:
00155 _x = _x.encode('utf-8')
00156 length = len(_x)
00157 buff.write(struct.pack('<I%ss'%length, length, _x))
00158 length = len(self.result.data)
00159 buff.write(_struct_I.pack(length))
00160 for val1 in self.result.data:
00161 length = len(val1)
00162 if python3 or type(val1) == unicode:
00163 val1 = val1.encode('utf-8')
00164 length = len(val1)
00165 buff.write(struct.pack('<I%ss'%length, length, val1))
00166 length = len(self.result.sequence)
00167 buff.write(_struct_I.pack(length))
00168 for val1 in self.result.sequence:
00169 _x = val1.action
00170 length = len(_x)
00171 if python3 or type(_x) == unicode:
00172 _x = _x.encode('utf-8')
00173 length = len(_x)
00174 buff.write(struct.pack('<I%ss'%length, length, _x))
00175 length = len(val1.args)
00176 buff.write(_struct_I.pack(length))
00177 for val2 in val1.args:
00178 length = len(val2)
00179 if python3 or type(val2) == unicode:
00180 val2 = val2.encode('utf-8')
00181 length = len(val2)
00182 buff.write(struct.pack('<I%ss'%length, length, val2))
00183 except struct.error as se: self._check_types(se)
00184 except TypeError as te: self._check_types(te)
00185
00186 def deserialize(self, str):
00187 """
00188 unpack serialized message in str into this message instance
00189 :param str: byte array of serialized message, ``str``
00190 """
00191 try:
00192 if self.header is None:
00193 self.header = std_msgs.msg.Header()
00194 if self.status is None:
00195 self.status = actionlib_msgs.msg.GoalStatus()
00196 if self.result is None:
00197 self.result = pddl_msgs.msg.PDDLPlannerResult()
00198 end = 0
00199 _x = self
00200 start = end
00201 end += 12
00202 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00203 start = end
00204 end += 4
00205 (length,) = _struct_I.unpack(str[start:end])
00206 start = end
00207 end += length
00208 if python3:
00209 self.header.frame_id = str[start:end].decode('utf-8')
00210 else:
00211 self.header.frame_id = str[start:end]
00212 _x = self
00213 start = end
00214 end += 8
00215 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00216 start = end
00217 end += 4
00218 (length,) = _struct_I.unpack(str[start:end])
00219 start = end
00220 end += length
00221 if python3:
00222 self.status.goal_id.id = str[start:end].decode('utf-8')
00223 else:
00224 self.status.goal_id.id = str[start:end]
00225 start = end
00226 end += 1
00227 (self.status.status,) = _struct_B.unpack(str[start:end])
00228 start = end
00229 end += 4
00230 (length,) = _struct_I.unpack(str[start:end])
00231 start = end
00232 end += length
00233 if python3:
00234 self.status.text = str[start:end].decode('utf-8')
00235 else:
00236 self.status.text = str[start:end]
00237 start = end
00238 end += 4
00239 (length,) = _struct_I.unpack(str[start:end])
00240 self.result.data = []
00241 for i in range(0, length):
00242 start = end
00243 end += 4
00244 (length,) = _struct_I.unpack(str[start:end])
00245 start = end
00246 end += length
00247 if python3:
00248 val1 = str[start:end].decode('utf-8')
00249 else:
00250 val1 = str[start:end]
00251 self.result.data.append(val1)
00252 start = end
00253 end += 4
00254 (length,) = _struct_I.unpack(str[start:end])
00255 self.result.sequence = []
00256 for i in range(0, length):
00257 val1 = pddl_msgs.msg.PDDLStep()
00258 start = end
00259 end += 4
00260 (length,) = _struct_I.unpack(str[start:end])
00261 start = end
00262 end += length
00263 if python3:
00264 val1.action = str[start:end].decode('utf-8')
00265 else:
00266 val1.action = str[start:end]
00267 start = end
00268 end += 4
00269 (length,) = _struct_I.unpack(str[start:end])
00270 val1.args = []
00271 for i in range(0, length):
00272 start = end
00273 end += 4
00274 (length,) = _struct_I.unpack(str[start:end])
00275 start = end
00276 end += length
00277 if python3:
00278 val2 = str[start:end].decode('utf-8')
00279 else:
00280 val2 = str[start:end]
00281 val1.args.append(val2)
00282 self.result.sequence.append(val1)
00283 return self
00284 except struct.error as e:
00285 raise genpy.DeserializationError(e)
00286
00287
00288 def serialize_numpy(self, buff, numpy):
00289 """
00290 serialize message with numpy array types into buffer
00291 :param buff: buffer, ``StringIO``
00292 :param numpy: numpy python module
00293 """
00294 try:
00295 _x = self
00296 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00297 _x = self.header.frame_id
00298 length = len(_x)
00299 if python3 or type(_x) == unicode:
00300 _x = _x.encode('utf-8')
00301 length = len(_x)
00302 buff.write(struct.pack('<I%ss'%length, length, _x))
00303 _x = self
00304 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00305 _x = self.status.goal_id.id
00306 length = len(_x)
00307 if python3 or type(_x) == unicode:
00308 _x = _x.encode('utf-8')
00309 length = len(_x)
00310 buff.write(struct.pack('<I%ss'%length, length, _x))
00311 buff.write(_struct_B.pack(self.status.status))
00312 _x = self.status.text
00313 length = len(_x)
00314 if python3 or type(_x) == unicode:
00315 _x = _x.encode('utf-8')
00316 length = len(_x)
00317 buff.write(struct.pack('<I%ss'%length, length, _x))
00318 length = len(self.result.data)
00319 buff.write(_struct_I.pack(length))
00320 for val1 in self.result.data:
00321 length = len(val1)
00322 if python3 or type(val1) == unicode:
00323 val1 = val1.encode('utf-8')
00324 length = len(val1)
00325 buff.write(struct.pack('<I%ss'%length, length, val1))
00326 length = len(self.result.sequence)
00327 buff.write(_struct_I.pack(length))
00328 for val1 in self.result.sequence:
00329 _x = val1.action
00330 length = len(_x)
00331 if python3 or type(_x) == unicode:
00332 _x = _x.encode('utf-8')
00333 length = len(_x)
00334 buff.write(struct.pack('<I%ss'%length, length, _x))
00335 length = len(val1.args)
00336 buff.write(_struct_I.pack(length))
00337 for val2 in val1.args:
00338 length = len(val2)
00339 if python3 or type(val2) == unicode:
00340 val2 = val2.encode('utf-8')
00341 length = len(val2)
00342 buff.write(struct.pack('<I%ss'%length, length, val2))
00343 except struct.error as se: self._check_types(se)
00344 except TypeError as te: self._check_types(te)
00345
00346 def deserialize_numpy(self, str, numpy):
00347 """
00348 unpack serialized message in str into this message instance using numpy for array types
00349 :param str: byte array of serialized message, ``str``
00350 :param numpy: numpy python module
00351 """
00352 try:
00353 if self.header is None:
00354 self.header = std_msgs.msg.Header()
00355 if self.status is None:
00356 self.status = actionlib_msgs.msg.GoalStatus()
00357 if self.result is None:
00358 self.result = pddl_msgs.msg.PDDLPlannerResult()
00359 end = 0
00360 _x = self
00361 start = end
00362 end += 12
00363 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00364 start = end
00365 end += 4
00366 (length,) = _struct_I.unpack(str[start:end])
00367 start = end
00368 end += length
00369 if python3:
00370 self.header.frame_id = str[start:end].decode('utf-8')
00371 else:
00372 self.header.frame_id = str[start:end]
00373 _x = self
00374 start = end
00375 end += 8
00376 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00377 start = end
00378 end += 4
00379 (length,) = _struct_I.unpack(str[start:end])
00380 start = end
00381 end += length
00382 if python3:
00383 self.status.goal_id.id = str[start:end].decode('utf-8')
00384 else:
00385 self.status.goal_id.id = str[start:end]
00386 start = end
00387 end += 1
00388 (self.status.status,) = _struct_B.unpack(str[start:end])
00389 start = end
00390 end += 4
00391 (length,) = _struct_I.unpack(str[start:end])
00392 start = end
00393 end += length
00394 if python3:
00395 self.status.text = str[start:end].decode('utf-8')
00396 else:
00397 self.status.text = str[start:end]
00398 start = end
00399 end += 4
00400 (length,) = _struct_I.unpack(str[start:end])
00401 self.result.data = []
00402 for i in range(0, length):
00403 start = end
00404 end += 4
00405 (length,) = _struct_I.unpack(str[start:end])
00406 start = end
00407 end += length
00408 if python3:
00409 val1 = str[start:end].decode('utf-8')
00410 else:
00411 val1 = str[start:end]
00412 self.result.data.append(val1)
00413 start = end
00414 end += 4
00415 (length,) = _struct_I.unpack(str[start:end])
00416 self.result.sequence = []
00417 for i in range(0, length):
00418 val1 = pddl_msgs.msg.PDDLStep()
00419 start = end
00420 end += 4
00421 (length,) = _struct_I.unpack(str[start:end])
00422 start = end
00423 end += length
00424 if python3:
00425 val1.action = str[start:end].decode('utf-8')
00426 else:
00427 val1.action = str[start:end]
00428 start = end
00429 end += 4
00430 (length,) = _struct_I.unpack(str[start:end])
00431 val1.args = []
00432 for i in range(0, length):
00433 start = end
00434 end += 4
00435 (length,) = _struct_I.unpack(str[start:end])
00436 start = end
00437 end += length
00438 if python3:
00439 val2 = str[start:end].decode('utf-8')
00440 else:
00441 val2 = str[start:end]
00442 val1.args.append(val2)
00443 self.result.sequence.append(val1)
00444 return self
00445 except struct.error as e:
00446 raise genpy.DeserializationError(e)
00447
00448 _struct_I = genpy.struct_I
00449 _struct_3I = struct.Struct("<3I")
00450 _struct_B = struct.Struct("<B")
00451 _struct_2I = struct.Struct("<2I")