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


turtle_actionlib
Author(s): Melonee Wise
autogenerated on Thu Jan 2 2014 11:09:58