_ScriptGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cob_script_server/ScriptGoal.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class ScriptGoal(genpy.Message):
00009   _md5sum = "0a40a194b72e6783b1b8bec8d1c28c7f"
00010   _type = "cob_script_server/ScriptGoal"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 #goal definition
00014 string function_name
00015 string component_name
00016 string parameter_name
00017 string mode
00018 string service_name
00019 float32 duration
00020 bool planning
00021 
00022 """
00023   __slots__ = ['function_name','component_name','parameter_name','mode','service_name','duration','planning']
00024   _slot_types = ['string','string','string','string','string','float32','bool']
00025 
00026   def __init__(self, *args, **kwds):
00027     """
00028     Constructor. Any message fields that are implicitly/explicitly
00029     set to None will be assigned a default value. The recommend
00030     use is keyword arguments as this is more robust to future message
00031     changes.  You cannot mix in-order arguments and keyword arguments.
00032 
00033     The available fields are:
00034        function_name,component_name,parameter_name,mode,service_name,duration,planning
00035 
00036     :param args: complete set of field values, in .msg order
00037     :param kwds: use keyword arguments corresponding to message field names
00038     to set specific fields.
00039     """
00040     if args or kwds:
00041       super(ScriptGoal, self).__init__(*args, **kwds)
00042       #message fields cannot be None, assign default values for those that are
00043       if self.function_name is None:
00044         self.function_name = ''
00045       if self.component_name is None:
00046         self.component_name = ''
00047       if self.parameter_name is None:
00048         self.parameter_name = ''
00049       if self.mode is None:
00050         self.mode = ''
00051       if self.service_name is None:
00052         self.service_name = ''
00053       if self.duration is None:
00054         self.duration = 0.
00055       if self.planning is None:
00056         self.planning = False
00057     else:
00058       self.function_name = ''
00059       self.component_name = ''
00060       self.parameter_name = ''
00061       self.mode = ''
00062       self.service_name = ''
00063       self.duration = 0.
00064       self.planning = False
00065 
00066   def _get_types(self):
00067     """
00068     internal API method
00069     """
00070     return self._slot_types
00071 
00072   def serialize(self, buff):
00073     """
00074     serialize message into buffer
00075     :param buff: buffer, ``StringIO``
00076     """
00077     try:
00078       _x = self.function_name
00079       length = len(_x)
00080       if python3 or type(_x) == unicode:
00081         _x = _x.encode('utf-8')
00082         length = len(_x)
00083       buff.write(struct.pack('<I%ss'%length, length, _x))
00084       _x = self.component_name
00085       length = len(_x)
00086       if python3 or type(_x) == unicode:
00087         _x = _x.encode('utf-8')
00088         length = len(_x)
00089       buff.write(struct.pack('<I%ss'%length, length, _x))
00090       _x = self.parameter_name
00091       length = len(_x)
00092       if python3 or type(_x) == unicode:
00093         _x = _x.encode('utf-8')
00094         length = len(_x)
00095       buff.write(struct.pack('<I%ss'%length, length, _x))
00096       _x = self.mode
00097       length = len(_x)
00098       if python3 or type(_x) == unicode:
00099         _x = _x.encode('utf-8')
00100         length = len(_x)
00101       buff.write(struct.pack('<I%ss'%length, length, _x))
00102       _x = self.service_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
00109       buff.write(_struct_fB.pack(_x.duration, _x.planning))
00110     except struct.error as se: self._check_types(se)
00111     except TypeError as te: self._check_types(te)
00112 
00113   def deserialize(self, str):
00114     """
00115     unpack serialized message in str into this message instance
00116     :param str: byte array of serialized message, ``str``
00117     """
00118     try:
00119       end = 0
00120       start = end
00121       end += 4
00122       (length,) = _struct_I.unpack(str[start:end])
00123       start = end
00124       end += length
00125       if python3:
00126         self.function_name = str[start:end].decode('utf-8')
00127       else:
00128         self.function_name = str[start:end]
00129       start = end
00130       end += 4
00131       (length,) = _struct_I.unpack(str[start:end])
00132       start = end
00133       end += length
00134       if python3:
00135         self.component_name = str[start:end].decode('utf-8')
00136       else:
00137         self.component_name = str[start:end]
00138       start = end
00139       end += 4
00140       (length,) = _struct_I.unpack(str[start:end])
00141       start = end
00142       end += length
00143       if python3:
00144         self.parameter_name = str[start:end].decode('utf-8')
00145       else:
00146         self.parameter_name = str[start:end]
00147       start = end
00148       end += 4
00149       (length,) = _struct_I.unpack(str[start:end])
00150       start = end
00151       end += length
00152       if python3:
00153         self.mode = str[start:end].decode('utf-8')
00154       else:
00155         self.mode = 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.service_name = str[start:end].decode('utf-8')
00163       else:
00164         self.service_name = str[start:end]
00165       _x = self
00166       start = end
00167       end += 5
00168       (_x.duration, _x.planning,) = _struct_fB.unpack(str[start:end])
00169       self.planning = bool(self.planning)
00170       return self
00171     except struct.error as e:
00172       raise genpy.DeserializationError(e) #most likely buffer underfill
00173 
00174 
00175   def serialize_numpy(self, buff, numpy):
00176     """
00177     serialize message with numpy array types into buffer
00178     :param buff: buffer, ``StringIO``
00179     :param numpy: numpy python module
00180     """
00181     try:
00182       _x = self.function_name
00183       length = len(_x)
00184       if python3 or type(_x) == unicode:
00185         _x = _x.encode('utf-8')
00186         length = len(_x)
00187       buff.write(struct.pack('<I%ss'%length, length, _x))
00188       _x = self.component_name
00189       length = len(_x)
00190       if python3 or type(_x) == unicode:
00191         _x = _x.encode('utf-8')
00192         length = len(_x)
00193       buff.write(struct.pack('<I%ss'%length, length, _x))
00194       _x = self.parameter_name
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.mode
00201       length = len(_x)
00202       if python3 or type(_x) == unicode:
00203         _x = _x.encode('utf-8')
00204         length = len(_x)
00205       buff.write(struct.pack('<I%ss'%length, length, _x))
00206       _x = self.service_name
00207       length = len(_x)
00208       if python3 or type(_x) == unicode:
00209         _x = _x.encode('utf-8')
00210         length = len(_x)
00211       buff.write(struct.pack('<I%ss'%length, length, _x))
00212       _x = self
00213       buff.write(_struct_fB.pack(_x.duration, _x.planning))
00214     except struct.error as se: self._check_types(se)
00215     except TypeError as te: self._check_types(te)
00216 
00217   def deserialize_numpy(self, str, numpy):
00218     """
00219     unpack serialized message in str into this message instance using numpy for array types
00220     :param str: byte array of serialized message, ``str``
00221     :param numpy: numpy python module
00222     """
00223     try:
00224       end = 0
00225       start = end
00226       end += 4
00227       (length,) = _struct_I.unpack(str[start:end])
00228       start = end
00229       end += length
00230       if python3:
00231         self.function_name = str[start:end].decode('utf-8')
00232       else:
00233         self.function_name = str[start:end]
00234       start = end
00235       end += 4
00236       (length,) = _struct_I.unpack(str[start:end])
00237       start = end
00238       end += length
00239       if python3:
00240         self.component_name = str[start:end].decode('utf-8')
00241       else:
00242         self.component_name = 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.parameter_name = str[start:end].decode('utf-8')
00250       else:
00251         self.parameter_name = str[start:end]
00252       start = end
00253       end += 4
00254       (length,) = _struct_I.unpack(str[start:end])
00255       start = end
00256       end += length
00257       if python3:
00258         self.mode = str[start:end].decode('utf-8')
00259       else:
00260         self.mode = str[start:end]
00261       start = end
00262       end += 4
00263       (length,) = _struct_I.unpack(str[start:end])
00264       start = end
00265       end += length
00266       if python3:
00267         self.service_name = str[start:end].decode('utf-8')
00268       else:
00269         self.service_name = str[start:end]
00270       _x = self
00271       start = end
00272       end += 5
00273       (_x.duration, _x.planning,) = _struct_fB.unpack(str[start:end])
00274       self.planning = bool(self.planning)
00275       return self
00276     except struct.error as e:
00277       raise genpy.DeserializationError(e) #most likely buffer underfill
00278 
00279 _struct_I = genpy.struct_I
00280 _struct_fB = struct.Struct("<fB")
 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