_ActionMsgMapperGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from turtlebot_actions/ActionMsgMapperGoal.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 ActionMsgMapperGoal(genpy.Message):
00009   _md5sum = "9c97ba579bcd822e978741dfc338d44b"
00010   _type = "turtlebot_actions/ActionMsgMapperGoal"
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    input_topic      
00015 string    output_topic      
00016 string    input_type      
00017 string    output_type      
00018 string[]   input_list
00019 string[]   output_list
00020 
00021 
00022 
00023 """
00024   __slots__ = ['input_topic','output_topic','input_type','output_type','input_list','output_list']
00025   _slot_types = ['string','string','string','string','string[]','string[]']
00026 
00027   def __init__(self, *args, **kwds):
00028     """
00029     Constructor. Any message fields that are implicitly/explicitly
00030     set to None will be assigned a default value. The recommend
00031     use is keyword arguments as this is more robust to future message
00032     changes.  You cannot mix in-order arguments and keyword arguments.
00033 
00034     The available fields are:
00035        input_topic,output_topic,input_type,output_type,input_list,output_list
00036 
00037     :param args: complete set of field values, in .msg order
00038     :param kwds: use keyword arguments corresponding to message field names
00039     to set specific fields.
00040     """
00041     if args or kwds:
00042       super(ActionMsgMapperGoal, self).__init__(*args, **kwds)
00043       #message fields cannot be None, assign default values for those that are
00044       if self.input_topic is None:
00045         self.input_topic = ''
00046       if self.output_topic is None:
00047         self.output_topic = ''
00048       if self.input_type is None:
00049         self.input_type = ''
00050       if self.output_type is None:
00051         self.output_type = ''
00052       if self.input_list is None:
00053         self.input_list = []
00054       if self.output_list is None:
00055         self.output_list = []
00056     else:
00057       self.input_topic = ''
00058       self.output_topic = ''
00059       self.input_type = ''
00060       self.output_type = ''
00061       self.input_list = []
00062       self.output_list = []
00063 
00064   def _get_types(self):
00065     """
00066     internal API method
00067     """
00068     return self._slot_types
00069 
00070   def serialize(self, buff):
00071     """
00072     serialize message into buffer
00073     :param buff: buffer, ``StringIO``
00074     """
00075     try:
00076       _x = self.input_topic
00077       length = len(_x)
00078       if python3 or type(_x) == unicode:
00079         _x = _x.encode('utf-8')
00080         length = len(_x)
00081       buff.write(struct.pack('<I%ss'%length, length, _x))
00082       _x = self.output_topic
00083       length = len(_x)
00084       if python3 or type(_x) == unicode:
00085         _x = _x.encode('utf-8')
00086         length = len(_x)
00087       buff.write(struct.pack('<I%ss'%length, length, _x))
00088       _x = self.input_type
00089       length = len(_x)
00090       if python3 or type(_x) == unicode:
00091         _x = _x.encode('utf-8')
00092         length = len(_x)
00093       buff.write(struct.pack('<I%ss'%length, length, _x))
00094       _x = self.output_type
00095       length = len(_x)
00096       if python3 or type(_x) == unicode:
00097         _x = _x.encode('utf-8')
00098         length = len(_x)
00099       buff.write(struct.pack('<I%ss'%length, length, _x))
00100       length = len(self.input_list)
00101       buff.write(_struct_I.pack(length))
00102       for val1 in self.input_list:
00103         length = len(val1)
00104         if python3 or type(val1) == unicode:
00105           val1 = val1.encode('utf-8')
00106           length = len(val1)
00107         buff.write(struct.pack('<I%ss'%length, length, val1))
00108       length = len(self.output_list)
00109       buff.write(_struct_I.pack(length))
00110       for val1 in self.output_list:
00111         length = len(val1)
00112         if python3 or type(val1) == unicode:
00113           val1 = val1.encode('utf-8')
00114           length = len(val1)
00115         buff.write(struct.pack('<I%ss'%length, length, val1))
00116     except struct.error as se: self._check_types(se)
00117     except TypeError as te: self._check_types(te)
00118 
00119   def deserialize(self, str):
00120     """
00121     unpack serialized message in str into this message instance
00122     :param str: byte array of serialized message, ``str``
00123     """
00124     try:
00125       end = 0
00126       start = end
00127       end += 4
00128       (length,) = _struct_I.unpack(str[start:end])
00129       start = end
00130       end += length
00131       if python3:
00132         self.input_topic = str[start:end].decode('utf-8')
00133       else:
00134         self.input_topic = str[start:end]
00135       start = end
00136       end += 4
00137       (length,) = _struct_I.unpack(str[start:end])
00138       start = end
00139       end += length
00140       if python3:
00141         self.output_topic = str[start:end].decode('utf-8')
00142       else:
00143         self.output_topic = 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.input_type = str[start:end].decode('utf-8')
00151       else:
00152         self.input_type = str[start:end]
00153       start = end
00154       end += 4
00155       (length,) = _struct_I.unpack(str[start:end])
00156       start = end
00157       end += length
00158       if python3:
00159         self.output_type = str[start:end].decode('utf-8')
00160       else:
00161         self.output_type = str[start:end]
00162       start = end
00163       end += 4
00164       (length,) = _struct_I.unpack(str[start:end])
00165       self.input_list = []
00166       for i in range(0, length):
00167         start = end
00168         end += 4
00169         (length,) = _struct_I.unpack(str[start:end])
00170         start = end
00171         end += length
00172         if python3:
00173           val1 = str[start:end].decode('utf-8')
00174         else:
00175           val1 = str[start:end]
00176         self.input_list.append(val1)
00177       start = end
00178       end += 4
00179       (length,) = _struct_I.unpack(str[start:end])
00180       self.output_list = []
00181       for i in range(0, length):
00182         start = end
00183         end += 4
00184         (length,) = _struct_I.unpack(str[start:end])
00185         start = end
00186         end += length
00187         if python3:
00188           val1 = str[start:end].decode('utf-8')
00189         else:
00190           val1 = str[start:end]
00191         self.output_list.append(val1)
00192       return self
00193     except struct.error as e:
00194       raise genpy.DeserializationError(e) #most likely buffer underfill
00195 
00196 
00197   def serialize_numpy(self, buff, numpy):
00198     """
00199     serialize message with numpy array types into buffer
00200     :param buff: buffer, ``StringIO``
00201     :param numpy: numpy python module
00202     """
00203     try:
00204       _x = self.input_topic
00205       length = len(_x)
00206       if python3 or type(_x) == unicode:
00207         _x = _x.encode('utf-8')
00208         length = len(_x)
00209       buff.write(struct.pack('<I%ss'%length, length, _x))
00210       _x = self.output_topic
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       _x = self.input_type
00217       length = len(_x)
00218       if python3 or type(_x) == unicode:
00219         _x = _x.encode('utf-8')
00220         length = len(_x)
00221       buff.write(struct.pack('<I%ss'%length, length, _x))
00222       _x = self.output_type
00223       length = len(_x)
00224       if python3 or type(_x) == unicode:
00225         _x = _x.encode('utf-8')
00226         length = len(_x)
00227       buff.write(struct.pack('<I%ss'%length, length, _x))
00228       length = len(self.input_list)
00229       buff.write(_struct_I.pack(length))
00230       for val1 in self.input_list:
00231         length = len(val1)
00232         if python3 or type(val1) == unicode:
00233           val1 = val1.encode('utf-8')
00234           length = len(val1)
00235         buff.write(struct.pack('<I%ss'%length, length, val1))
00236       length = len(self.output_list)
00237       buff.write(_struct_I.pack(length))
00238       for val1 in self.output_list:
00239         length = len(val1)
00240         if python3 or type(val1) == unicode:
00241           val1 = val1.encode('utf-8')
00242           length = len(val1)
00243         buff.write(struct.pack('<I%ss'%length, length, val1))
00244     except struct.error as se: self._check_types(se)
00245     except TypeError as te: self._check_types(te)
00246 
00247   def deserialize_numpy(self, str, numpy):
00248     """
00249     unpack serialized message in str into this message instance using numpy for array types
00250     :param str: byte array of serialized message, ``str``
00251     :param numpy: numpy python module
00252     """
00253     try:
00254       end = 0
00255       start = end
00256       end += 4
00257       (length,) = _struct_I.unpack(str[start:end])
00258       start = end
00259       end += length
00260       if python3:
00261         self.input_topic = str[start:end].decode('utf-8')
00262       else:
00263         self.input_topic = str[start:end]
00264       start = end
00265       end += 4
00266       (length,) = _struct_I.unpack(str[start:end])
00267       start = end
00268       end += length
00269       if python3:
00270         self.output_topic = str[start:end].decode('utf-8')
00271       else:
00272         self.output_topic = str[start:end]
00273       start = end
00274       end += 4
00275       (length,) = _struct_I.unpack(str[start:end])
00276       start = end
00277       end += length
00278       if python3:
00279         self.input_type = str[start:end].decode('utf-8')
00280       else:
00281         self.input_type = str[start:end]
00282       start = end
00283       end += 4
00284       (length,) = _struct_I.unpack(str[start:end])
00285       start = end
00286       end += length
00287       if python3:
00288         self.output_type = str[start:end].decode('utf-8')
00289       else:
00290         self.output_type = str[start:end]
00291       start = end
00292       end += 4
00293       (length,) = _struct_I.unpack(str[start:end])
00294       self.input_list = []
00295       for i in range(0, length):
00296         start = end
00297         end += 4
00298         (length,) = _struct_I.unpack(str[start:end])
00299         start = end
00300         end += length
00301         if python3:
00302           val1 = str[start:end].decode('utf-8')
00303         else:
00304           val1 = str[start:end]
00305         self.input_list.append(val1)
00306       start = end
00307       end += 4
00308       (length,) = _struct_I.unpack(str[start:end])
00309       self.output_list = []
00310       for i in range(0, length):
00311         start = end
00312         end += 4
00313         (length,) = _struct_I.unpack(str[start:end])
00314         start = end
00315         end += length
00316         if python3:
00317           val1 = str[start:end].decode('utf-8')
00318         else:
00319           val1 = str[start:end]
00320         self.output_list.append(val1)
00321       return self
00322     except struct.error as e:
00323       raise genpy.DeserializationError(e) #most likely buffer underfill
00324 
00325 _struct_I = genpy.struct_I


turtlebot_actions
Author(s): Helen Oleynikova, Melonee Wise
autogenerated on Fri Dec 6 2013 20:51:35