_StateGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cob_script_server/StateGoal.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 cob_script_server.msg
00008 import std_msgs.msg
00009 
00010 class StateGoal(genpy.Message):
00011   _md5sum = "5d2b1a5f7b8263c9eb024ed31a5dbee9"
00012   _type = "cob_script_server/StateGoal"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015 #goal definition
00016 cob_script_server/ScriptState state
00017 
00018 ================================================================================
00019 MSG: cob_script_server/ScriptState
00020 Header header
00021 int16 number
00022 string function_name
00023 string component_name
00024 string parameter_name
00025 string full_graph_name
00026 
00027 # Possible execution states
00028 byte UNKNOWN=0
00029 byte ACTIVE=1
00030 byte SUCCEEDED=2
00031 byte FAILED=3
00032 byte PAUSED=4
00033 
00034 byte state # state of execution
00035 int16 error_code # current error_code for state
00036 
00037 ================================================================================
00038 MSG: std_msgs/Header
00039 # Standard metadata for higher-level stamped data types.
00040 # This is generally used to communicate timestamped data 
00041 # in a particular coordinate frame.
00042 # 
00043 # sequence ID: consecutively increasing ID 
00044 uint32 seq
00045 #Two-integer timestamp that is expressed as:
00046 # * stamp.secs: seconds (stamp_secs) since epoch
00047 # * stamp.nsecs: nanoseconds since stamp_secs
00048 # time-handling sugar is provided by the client library
00049 time stamp
00050 #Frame this data is associated with
00051 # 0: no frame
00052 # 1: global frame
00053 string frame_id
00054 
00055 """
00056   __slots__ = ['state']
00057   _slot_types = ['cob_script_server/ScriptState']
00058 
00059   def __init__(self, *args, **kwds):
00060     """
00061     Constructor. Any message fields that are implicitly/explicitly
00062     set to None will be assigned a default value. The recommend
00063     use is keyword arguments as this is more robust to future message
00064     changes.  You cannot mix in-order arguments and keyword arguments.
00065 
00066     The available fields are:
00067        state
00068 
00069     :param args: complete set of field values, in .msg order
00070     :param kwds: use keyword arguments corresponding to message field names
00071     to set specific fields.
00072     """
00073     if args or kwds:
00074       super(StateGoal, self).__init__(*args, **kwds)
00075       #message fields cannot be None, assign default values for those that are
00076       if self.state is None:
00077         self.state = cob_script_server.msg.ScriptState()
00078     else:
00079       self.state = cob_script_server.msg.ScriptState()
00080 
00081   def _get_types(self):
00082     """
00083     internal API method
00084     """
00085     return self._slot_types
00086 
00087   def serialize(self, buff):
00088     """
00089     serialize message into buffer
00090     :param buff: buffer, ``StringIO``
00091     """
00092     try:
00093       _x = self
00094       buff.write(_struct_3I.pack(_x.state.header.seq, _x.state.header.stamp.secs, _x.state.header.stamp.nsecs))
00095       _x = self.state.header.frame_id
00096       length = len(_x)
00097       if python3 or type(_x) == unicode:
00098         _x = _x.encode('utf-8')
00099         length = len(_x)
00100       buff.write(struct.pack('<I%ss'%length, length, _x))
00101       buff.write(_struct_h.pack(self.state.number))
00102       _x = self.state.function_name
00103       length = len(_x)
00104       if python3 or type(_x) == unicode:
00105         _x = _x.encode('utf-8')
00106         length = len(_x)
00107       buff.write(struct.pack('<I%ss'%length, length, _x))
00108       _x = self.state.component_name
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self.state.parameter_name
00115       length = len(_x)
00116       if python3 or type(_x) == unicode:
00117         _x = _x.encode('utf-8')
00118         length = len(_x)
00119       buff.write(struct.pack('<I%ss'%length, length, _x))
00120       _x = self.state.full_graph_name
00121       length = len(_x)
00122       if python3 or type(_x) == unicode:
00123         _x = _x.encode('utf-8')
00124         length = len(_x)
00125       buff.write(struct.pack('<I%ss'%length, length, _x))
00126       _x = self
00127       buff.write(_struct_bh.pack(_x.state.state, _x.state.error_code))
00128     except struct.error as se: self._check_types(se)
00129     except TypeError as te: self._check_types(te)
00130 
00131   def deserialize(self, str):
00132     """
00133     unpack serialized message in str into this message instance
00134     :param str: byte array of serialized message, ``str``
00135     """
00136     try:
00137       if self.state is None:
00138         self.state = cob_script_server.msg.ScriptState()
00139       end = 0
00140       _x = self
00141       start = end
00142       end += 12
00143       (_x.state.header.seq, _x.state.header.stamp.secs, _x.state.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00144       start = end
00145       end += 4
00146       (length,) = _struct_I.unpack(str[start:end])
00147       start = end
00148       end += length
00149       if python3:
00150         self.state.header.frame_id = str[start:end].decode('utf-8')
00151       else:
00152         self.state.header.frame_id = str[start:end]
00153       start = end
00154       end += 2
00155       (self.state.number,) = _struct_h.unpack(str[start:end])
00156       start = end
00157       end += 4
00158       (length,) = _struct_I.unpack(str[start:end])
00159       start = end
00160       end += length
00161       if python3:
00162         self.state.function_name = str[start:end].decode('utf-8')
00163       else:
00164         self.state.function_name = str[start:end]
00165       start = end
00166       end += 4
00167       (length,) = _struct_I.unpack(str[start:end])
00168       start = end
00169       end += length
00170       if python3:
00171         self.state.component_name = str[start:end].decode('utf-8')
00172       else:
00173         self.state.component_name = str[start:end]
00174       start = end
00175       end += 4
00176       (length,) = _struct_I.unpack(str[start:end])
00177       start = end
00178       end += length
00179       if python3:
00180         self.state.parameter_name = str[start:end].decode('utf-8')
00181       else:
00182         self.state.parameter_name = str[start:end]
00183       start = end
00184       end += 4
00185       (length,) = _struct_I.unpack(str[start:end])
00186       start = end
00187       end += length
00188       if python3:
00189         self.state.full_graph_name = str[start:end].decode('utf-8')
00190       else:
00191         self.state.full_graph_name = str[start:end]
00192       _x = self
00193       start = end
00194       end += 3
00195       (_x.state.state, _x.state.error_code,) = _struct_bh.unpack(str[start:end])
00196       return self
00197     except struct.error as e:
00198       raise genpy.DeserializationError(e) #most likely buffer underfill
00199 
00200 
00201   def serialize_numpy(self, buff, numpy):
00202     """
00203     serialize message with numpy array types into buffer
00204     :param buff: buffer, ``StringIO``
00205     :param numpy: numpy python module
00206     """
00207     try:
00208       _x = self
00209       buff.write(_struct_3I.pack(_x.state.header.seq, _x.state.header.stamp.secs, _x.state.header.stamp.nsecs))
00210       _x = self.state.header.frame_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_h.pack(self.state.number))
00217       _x = self.state.function_name
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       _x = self.state.component_name
00224       length = len(_x)
00225       if python3 or type(_x) == unicode:
00226         _x = _x.encode('utf-8')
00227         length = len(_x)
00228       buff.write(struct.pack('<I%ss'%length, length, _x))
00229       _x = self.state.parameter_name
00230       length = len(_x)
00231       if python3 or type(_x) == unicode:
00232         _x = _x.encode('utf-8')
00233         length = len(_x)
00234       buff.write(struct.pack('<I%ss'%length, length, _x))
00235       _x = self.state.full_graph_name
00236       length = len(_x)
00237       if python3 or type(_x) == unicode:
00238         _x = _x.encode('utf-8')
00239         length = len(_x)
00240       buff.write(struct.pack('<I%ss'%length, length, _x))
00241       _x = self
00242       buff.write(_struct_bh.pack(_x.state.state, _x.state.error_code))
00243     except struct.error as se: self._check_types(se)
00244     except TypeError as te: self._check_types(te)
00245 
00246   def deserialize_numpy(self, str, numpy):
00247     """
00248     unpack serialized message in str into this message instance using numpy for array types
00249     :param str: byte array of serialized message, ``str``
00250     :param numpy: numpy python module
00251     """
00252     try:
00253       if self.state is None:
00254         self.state = cob_script_server.msg.ScriptState()
00255       end = 0
00256       _x = self
00257       start = end
00258       end += 12
00259       (_x.state.header.seq, _x.state.header.stamp.secs, _x.state.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00260       start = end
00261       end += 4
00262       (length,) = _struct_I.unpack(str[start:end])
00263       start = end
00264       end += length
00265       if python3:
00266         self.state.header.frame_id = str[start:end].decode('utf-8')
00267       else:
00268         self.state.header.frame_id = str[start:end]
00269       start = end
00270       end += 2
00271       (self.state.number,) = _struct_h.unpack(str[start:end])
00272       start = end
00273       end += 4
00274       (length,) = _struct_I.unpack(str[start:end])
00275       start = end
00276       end += length
00277       if python3:
00278         self.state.function_name = str[start:end].decode('utf-8')
00279       else:
00280         self.state.function_name = str[start:end]
00281       start = end
00282       end += 4
00283       (length,) = _struct_I.unpack(str[start:end])
00284       start = end
00285       end += length
00286       if python3:
00287         self.state.component_name = str[start:end].decode('utf-8')
00288       else:
00289         self.state.component_name = str[start:end]
00290       start = end
00291       end += 4
00292       (length,) = _struct_I.unpack(str[start:end])
00293       start = end
00294       end += length
00295       if python3:
00296         self.state.parameter_name = str[start:end].decode('utf-8')
00297       else:
00298         self.state.parameter_name = str[start:end]
00299       start = end
00300       end += 4
00301       (length,) = _struct_I.unpack(str[start:end])
00302       start = end
00303       end += length
00304       if python3:
00305         self.state.full_graph_name = str[start:end].decode('utf-8')
00306       else:
00307         self.state.full_graph_name = str[start:end]
00308       _x = self
00309       start = end
00310       end += 3
00311       (_x.state.state, _x.state.error_code,) = _struct_bh.unpack(str[start:end])
00312       return self
00313     except struct.error as e:
00314       raise genpy.DeserializationError(e) #most likely buffer underfill
00315 
00316 _struct_I = genpy.struct_I
00317 _struct_h = struct.Struct("<h")
00318 _struct_3I = struct.Struct("<3I")
00319 _struct_bh = struct.Struct("<bh")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


cob_script_server
Author(s): Florian Weisshardt
autogenerated on Fri Mar 1 2013 17:45:41