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


asmach_tutorials
Author(s): Jonathan Bohren
autogenerated on Thu Apr 24 2014 15:35:31