_voiceRecognitionActionResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_perception_msgs/voiceRecognitionActionResult.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 iri_perception_msgs.msg
00008 import genpy
00009 import actionlib_msgs.msg
00010 import std_msgs.msg
00011 
00012 class voiceRecognitionActionResult(genpy.Message):
00013   _md5sum = "c5f79cf6eb32bbd79f46b9d43f727915"
00014   _type = "iri_perception_msgs/voiceRecognitionActionResult"
00015   _has_header = True #flag to mark the presence of a Header object
00016   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017 
00018 Header header
00019 actionlib_msgs/GoalStatus status
00020 voiceRecognitionResult 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: iri_perception_msgs/voiceRecognitionResult
00081 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00082 #result definition
00083 string answer
00084 int16 code
00085 
00086 """
00087   __slots__ = ['header','status','result']
00088   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','iri_perception_msgs/voiceRecognitionResult']
00089 
00090   def __init__(self, *args, **kwds):
00091     """
00092     Constructor. Any message fields that are implicitly/explicitly
00093     set to None will be assigned a default value. The recommend
00094     use is keyword arguments as this is more robust to future message
00095     changes.  You cannot mix in-order arguments and keyword arguments.
00096 
00097     The available fields are:
00098        header,status,result
00099 
00100     :param args: complete set of field values, in .msg order
00101     :param kwds: use keyword arguments corresponding to message field names
00102     to set specific fields.
00103     """
00104     if args or kwds:
00105       super(voiceRecognitionActionResult, self).__init__(*args, **kwds)
00106       #message fields cannot be None, assign default values for those that are
00107       if self.header is None:
00108         self.header = std_msgs.msg.Header()
00109       if self.status is None:
00110         self.status = actionlib_msgs.msg.GoalStatus()
00111       if self.result is None:
00112         self.result = iri_perception_msgs.msg.voiceRecognitionResult()
00113     else:
00114       self.header = std_msgs.msg.Header()
00115       self.status = actionlib_msgs.msg.GoalStatus()
00116       self.result = iri_perception_msgs.msg.voiceRecognitionResult()
00117 
00118   def _get_types(self):
00119     """
00120     internal API method
00121     """
00122     return self._slot_types
00123 
00124   def serialize(self, buff):
00125     """
00126     serialize message into buffer
00127     :param buff: buffer, ``StringIO``
00128     """
00129     try:
00130       _x = self
00131       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00132       _x = self.header.frame_id
00133       length = len(_x)
00134       if python3 or type(_x) == unicode:
00135         _x = _x.encode('utf-8')
00136         length = len(_x)
00137       buff.write(struct.pack('<I%ss'%length, length, _x))
00138       _x = self
00139       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00140       _x = self.status.goal_id.id
00141       length = len(_x)
00142       if python3 or type(_x) == unicode:
00143         _x = _x.encode('utf-8')
00144         length = len(_x)
00145       buff.write(struct.pack('<I%ss'%length, length, _x))
00146       buff.write(_struct_B.pack(self.status.status))
00147       _x = self.status.text
00148       length = len(_x)
00149       if python3 or type(_x) == unicode:
00150         _x = _x.encode('utf-8')
00151         length = len(_x)
00152       buff.write(struct.pack('<I%ss'%length, length, _x))
00153       _x = self.result.answer
00154       length = len(_x)
00155       if python3 or type(_x) == unicode:
00156         _x = _x.encode('utf-8')
00157         length = len(_x)
00158       buff.write(struct.pack('<I%ss'%length, length, _x))
00159       buff.write(_struct_h.pack(self.result.code))
00160     except struct.error as se: self._check_types(se)
00161     except TypeError as te: self._check_types(te)
00162 
00163   def deserialize(self, str):
00164     """
00165     unpack serialized message in str into this message instance
00166     :param str: byte array of serialized message, ``str``
00167     """
00168     try:
00169       if self.header is None:
00170         self.header = std_msgs.msg.Header()
00171       if self.status is None:
00172         self.status = actionlib_msgs.msg.GoalStatus()
00173       if self.result is None:
00174         self.result = iri_perception_msgs.msg.voiceRecognitionResult()
00175       end = 0
00176       _x = self
00177       start = end
00178       end += 12
00179       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00180       start = end
00181       end += 4
00182       (length,) = _struct_I.unpack(str[start:end])
00183       start = end
00184       end += length
00185       if python3:
00186         self.header.frame_id = str[start:end].decode('utf-8')
00187       else:
00188         self.header.frame_id = str[start:end]
00189       _x = self
00190       start = end
00191       end += 8
00192       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00193       start = end
00194       end += 4
00195       (length,) = _struct_I.unpack(str[start:end])
00196       start = end
00197       end += length
00198       if python3:
00199         self.status.goal_id.id = str[start:end].decode('utf-8')
00200       else:
00201         self.status.goal_id.id = str[start:end]
00202       start = end
00203       end += 1
00204       (self.status.status,) = _struct_B.unpack(str[start:end])
00205       start = end
00206       end += 4
00207       (length,) = _struct_I.unpack(str[start:end])
00208       start = end
00209       end += length
00210       if python3:
00211         self.status.text = str[start:end].decode('utf-8')
00212       else:
00213         self.status.text = str[start:end]
00214       start = end
00215       end += 4
00216       (length,) = _struct_I.unpack(str[start:end])
00217       start = end
00218       end += length
00219       if python3:
00220         self.result.answer = str[start:end].decode('utf-8')
00221       else:
00222         self.result.answer = str[start:end]
00223       start = end
00224       end += 2
00225       (self.result.code,) = _struct_h.unpack(str[start:end])
00226       return self
00227     except struct.error as e:
00228       raise genpy.DeserializationError(e) #most likely buffer underfill
00229 
00230 
00231   def serialize_numpy(self, buff, numpy):
00232     """
00233     serialize message with numpy array types into buffer
00234     :param buff: buffer, ``StringIO``
00235     :param numpy: numpy python module
00236     """
00237     try:
00238       _x = self
00239       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00240       _x = self.header.frame_id
00241       length = len(_x)
00242       if python3 or type(_x) == unicode:
00243         _x = _x.encode('utf-8')
00244         length = len(_x)
00245       buff.write(struct.pack('<I%ss'%length, length, _x))
00246       _x = self
00247       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00248       _x = self.status.goal_id.id
00249       length = len(_x)
00250       if python3 or type(_x) == unicode:
00251         _x = _x.encode('utf-8')
00252         length = len(_x)
00253       buff.write(struct.pack('<I%ss'%length, length, _x))
00254       buff.write(_struct_B.pack(self.status.status))
00255       _x = self.status.text
00256       length = len(_x)
00257       if python3 or type(_x) == unicode:
00258         _x = _x.encode('utf-8')
00259         length = len(_x)
00260       buff.write(struct.pack('<I%ss'%length, length, _x))
00261       _x = self.result.answer
00262       length = len(_x)
00263       if python3 or type(_x) == unicode:
00264         _x = _x.encode('utf-8')
00265         length = len(_x)
00266       buff.write(struct.pack('<I%ss'%length, length, _x))
00267       buff.write(_struct_h.pack(self.result.code))
00268     except struct.error as se: self._check_types(se)
00269     except TypeError as te: self._check_types(te)
00270 
00271   def deserialize_numpy(self, str, numpy):
00272     """
00273     unpack serialized message in str into this message instance using numpy for array types
00274     :param str: byte array of serialized message, ``str``
00275     :param numpy: numpy python module
00276     """
00277     try:
00278       if self.header is None:
00279         self.header = std_msgs.msg.Header()
00280       if self.status is None:
00281         self.status = actionlib_msgs.msg.GoalStatus()
00282       if self.result is None:
00283         self.result = iri_perception_msgs.msg.voiceRecognitionResult()
00284       end = 0
00285       _x = self
00286       start = end
00287       end += 12
00288       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.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.header.frame_id = str[start:end].decode('utf-8')
00296       else:
00297         self.header.frame_id = str[start:end]
00298       _x = self
00299       start = end
00300       end += 8
00301       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00302       start = end
00303       end += 4
00304       (length,) = _struct_I.unpack(str[start:end])
00305       start = end
00306       end += length
00307       if python3:
00308         self.status.goal_id.id = str[start:end].decode('utf-8')
00309       else:
00310         self.status.goal_id.id = str[start:end]
00311       start = end
00312       end += 1
00313       (self.status.status,) = _struct_B.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.status.text = str[start:end].decode('utf-8')
00321       else:
00322         self.status.text = str[start:end]
00323       start = end
00324       end += 4
00325       (length,) = _struct_I.unpack(str[start:end])
00326       start = end
00327       end += length
00328       if python3:
00329         self.result.answer = str[start:end].decode('utf-8')
00330       else:
00331         self.result.answer = str[start:end]
00332       start = end
00333       end += 2
00334       (self.result.code,) = _struct_h.unpack(str[start:end])
00335       return self
00336     except struct.error as e:
00337       raise genpy.DeserializationError(e) #most likely buffer underfill
00338 
00339 _struct_I = genpy.struct_I
00340 _struct_h = struct.Struct("<h")
00341 _struct_3I = struct.Struct("<3I")
00342 _struct_B = struct.Struct("<B")
00343 _struct_2I = struct.Struct("<2I")


iri_perception_msgs
Author(s):
autogenerated on Fri Dec 6 2013 20:02:15