_ScriptState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cob_script_server/ScriptState.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 std_msgs.msg
00008 
00009 class ScriptState(genpy.Message):
00010   _md5sum = "4981a5a5be8dbf926085d25a1acf43ca"
00011   _type = "cob_script_server/ScriptState"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 int16 number
00015 string function_name
00016 string component_name
00017 string parameter_name
00018 string full_graph_name
00019 
00020 # Possible execution states
00021 byte UNKNOWN=0
00022 byte ACTIVE=1
00023 byte SUCCEEDED=2
00024 byte FAILED=3
00025 byte PAUSED=4
00026 
00027 byte state # state of execution
00028 int16 error_code # current error_code for state
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   # Pseudo-constants
00050   UNKNOWN = 0
00051   ACTIVE = 1
00052   SUCCEEDED = 2
00053   FAILED = 3
00054   PAUSED = 4
00055 
00056   __slots__ = ['header','number','function_name','component_name','parameter_name','full_graph_name','state','error_code']
00057   _slot_types = ['std_msgs/Header','int16','string','string','string','string','byte','int16']
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        header,number,function_name,component_name,parameter_name,full_graph_name,state,error_code
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(ScriptState, self).__init__(*args, **kwds)
00075       #message fields cannot be None, assign default values for those that are
00076       if self.header is None:
00077         self.header = std_msgs.msg.Header()
00078       if self.number is None:
00079         self.number = 0
00080       if self.function_name is None:
00081         self.function_name = ''
00082       if self.component_name is None:
00083         self.component_name = ''
00084       if self.parameter_name is None:
00085         self.parameter_name = ''
00086       if self.full_graph_name is None:
00087         self.full_graph_name = ''
00088       if self.state is None:
00089         self.state = 0
00090       if self.error_code is None:
00091         self.error_code = 0
00092     else:
00093       self.header = std_msgs.msg.Header()
00094       self.number = 0
00095       self.function_name = ''
00096       self.component_name = ''
00097       self.parameter_name = ''
00098       self.full_graph_name = ''
00099       self.state = 0
00100       self.error_code = 0
00101 
00102   def _get_types(self):
00103     """
00104     internal API method
00105     """
00106     return self._slot_types
00107 
00108   def serialize(self, buff):
00109     """
00110     serialize message into buffer
00111     :param buff: buffer, ``StringIO``
00112     """
00113     try:
00114       _x = self
00115       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00116       _x = self.header.frame_id
00117       length = len(_x)
00118       if python3 or type(_x) == unicode:
00119         _x = _x.encode('utf-8')
00120         length = len(_x)
00121       buff.write(struct.pack('<I%ss'%length, length, _x))
00122       buff.write(_struct_h.pack(self.number))
00123       _x = self.function_name
00124       length = len(_x)
00125       if python3 or type(_x) == unicode:
00126         _x = _x.encode('utf-8')
00127         length = len(_x)
00128       buff.write(struct.pack('<I%ss'%length, length, _x))
00129       _x = self.component_name
00130       length = len(_x)
00131       if python3 or type(_x) == unicode:
00132         _x = _x.encode('utf-8')
00133         length = len(_x)
00134       buff.write(struct.pack('<I%ss'%length, length, _x))
00135       _x = self.parameter_name
00136       length = len(_x)
00137       if python3 or type(_x) == unicode:
00138         _x = _x.encode('utf-8')
00139         length = len(_x)
00140       buff.write(struct.pack('<I%ss'%length, length, _x))
00141       _x = self.full_graph_name
00142       length = len(_x)
00143       if python3 or type(_x) == unicode:
00144         _x = _x.encode('utf-8')
00145         length = len(_x)
00146       buff.write(struct.pack('<I%ss'%length, length, _x))
00147       _x = self
00148       buff.write(_struct_bh.pack(_x.state, _x.error_code))
00149     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00150     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00151 
00152   def deserialize(self, str):
00153     """
00154     unpack serialized message in str into this message instance
00155     :param str: byte array of serialized message, ``str``
00156     """
00157     try:
00158       if self.header is None:
00159         self.header = std_msgs.msg.Header()
00160       end = 0
00161       _x = self
00162       start = end
00163       end += 12
00164       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(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.header.frame_id = str[start:end].decode('utf-8')
00172       else:
00173         self.header.frame_id = str[start:end]
00174       start = end
00175       end += 2
00176       (self.number,) = _struct_h.unpack(str[start:end])
00177       start = end
00178       end += 4
00179       (length,) = _struct_I.unpack(str[start:end])
00180       start = end
00181       end += length
00182       if python3:
00183         self.function_name = str[start:end].decode('utf-8')
00184       else:
00185         self.function_name = str[start:end]
00186       start = end
00187       end += 4
00188       (length,) = _struct_I.unpack(str[start:end])
00189       start = end
00190       end += length
00191       if python3:
00192         self.component_name = str[start:end].decode('utf-8')
00193       else:
00194         self.component_name = str[start:end]
00195       start = end
00196       end += 4
00197       (length,) = _struct_I.unpack(str[start:end])
00198       start = end
00199       end += length
00200       if python3:
00201         self.parameter_name = str[start:end].decode('utf-8')
00202       else:
00203         self.parameter_name = str[start:end]
00204       start = end
00205       end += 4
00206       (length,) = _struct_I.unpack(str[start:end])
00207       start = end
00208       end += length
00209       if python3:
00210         self.full_graph_name = str[start:end].decode('utf-8')
00211       else:
00212         self.full_graph_name = str[start:end]
00213       _x = self
00214       start = end
00215       end += 3
00216       (_x.state, _x.error_code,) = _struct_bh.unpack(str[start:end])
00217       return self
00218     except struct.error as e:
00219       raise genpy.DeserializationError(e) #most likely buffer underfill
00220 
00221 
00222   def serialize_numpy(self, buff, numpy):
00223     """
00224     serialize message with numpy array types into buffer
00225     :param buff: buffer, ``StringIO``
00226     :param numpy: numpy python module
00227     """
00228     try:
00229       _x = self
00230       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00231       _x = self.header.frame_id
00232       length = len(_x)
00233       if python3 or type(_x) == unicode:
00234         _x = _x.encode('utf-8')
00235         length = len(_x)
00236       buff.write(struct.pack('<I%ss'%length, length, _x))
00237       buff.write(_struct_h.pack(self.number))
00238       _x = self.function_name
00239       length = len(_x)
00240       if python3 or type(_x) == unicode:
00241         _x = _x.encode('utf-8')
00242         length = len(_x)
00243       buff.write(struct.pack('<I%ss'%length, length, _x))
00244       _x = self.component_name
00245       length = len(_x)
00246       if python3 or type(_x) == unicode:
00247         _x = _x.encode('utf-8')
00248         length = len(_x)
00249       buff.write(struct.pack('<I%ss'%length, length, _x))
00250       _x = self.parameter_name
00251       length = len(_x)
00252       if python3 or type(_x) == unicode:
00253         _x = _x.encode('utf-8')
00254         length = len(_x)
00255       buff.write(struct.pack('<I%ss'%length, length, _x))
00256       _x = self.full_graph_name
00257       length = len(_x)
00258       if python3 or type(_x) == unicode:
00259         _x = _x.encode('utf-8')
00260         length = len(_x)
00261       buff.write(struct.pack('<I%ss'%length, length, _x))
00262       _x = self
00263       buff.write(_struct_bh.pack(_x.state, _x.error_code))
00264     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00265     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00266 
00267   def deserialize_numpy(self, str, numpy):
00268     """
00269     unpack serialized message in str into this message instance using numpy for array types
00270     :param str: byte array of serialized message, ``str``
00271     :param numpy: numpy python module
00272     """
00273     try:
00274       if self.header is None:
00275         self.header = std_msgs.msg.Header()
00276       end = 0
00277       _x = self
00278       start = end
00279       end += 12
00280       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(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.header.frame_id = str[start:end].decode('utf-8')
00288       else:
00289         self.header.frame_id = str[start:end]
00290       start = end
00291       end += 2
00292       (self.number,) = _struct_h.unpack(str[start:end])
00293       start = end
00294       end += 4
00295       (length,) = _struct_I.unpack(str[start:end])
00296       start = end
00297       end += length
00298       if python3:
00299         self.function_name = str[start:end].decode('utf-8')
00300       else:
00301         self.function_name = 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.component_name = str[start:end].decode('utf-8')
00309       else:
00310         self.component_name = str[start:end]
00311       start = end
00312       end += 4
00313       (length,) = _struct_I.unpack(str[start:end])
00314       start = end
00315       end += length
00316       if python3:
00317         self.parameter_name = str[start:end].decode('utf-8')
00318       else:
00319         self.parameter_name = 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.full_graph_name = str[start:end].decode('utf-8')
00327       else:
00328         self.full_graph_name = str[start:end]
00329       _x = self
00330       start = end
00331       end += 3
00332       (_x.state, _x.error_code,) = _struct_bh.unpack(str[start:end])
00333       return self
00334     except struct.error as e:
00335       raise genpy.DeserializationError(e) #most likely buffer underfill
00336 
00337 _struct_I = genpy.struct_I
00338 _struct_h = struct.Struct("<h")
00339 _struct_3I = struct.Struct("<3I")
00340 _struct_bh = struct.Struct("<bh")


cob_script_server
Author(s): Florian Weisshardt
autogenerated on Sun Oct 5 2014 22:59:42