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