_guiFeedback.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tibi_dabo_msgs/guiFeedback.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 guiFeedback(genpy.Message):
00009   _md5sum = "97c7c7af54f4060c659197bd333b125c"
00010   _type = "tibi_dabo_msgs/guiFeedback"
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 #feedback
00014 float64[] num_feedback
00015 string[] string_feedback
00016 
00017 
00018 
00019 """
00020   __slots__ = ['num_feedback','string_feedback']
00021   _slot_types = ['float64[]','string[]']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        num_feedback,string_feedback
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(guiFeedback, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.num_feedback is None:
00041         self.num_feedback = []
00042       if self.string_feedback is None:
00043         self.string_feedback = []
00044     else:
00045       self.num_feedback = []
00046       self.string_feedback = []
00047 
00048   def _get_types(self):
00049     """
00050     internal API method
00051     """
00052     return self._slot_types
00053 
00054   def serialize(self, buff):
00055     """
00056     serialize message into buffer
00057     :param buff: buffer, ``StringIO``
00058     """
00059     try:
00060       length = len(self.num_feedback)
00061       buff.write(_struct_I.pack(length))
00062       pattern = '<%sd'%length
00063       buff.write(struct.pack(pattern, *self.num_feedback))
00064       length = len(self.string_feedback)
00065       buff.write(_struct_I.pack(length))
00066       for val1 in self.string_feedback:
00067         length = len(val1)
00068         if python3 or type(val1) == unicode:
00069           val1 = val1.encode('utf-8')
00070           length = len(val1)
00071         buff.write(struct.pack('<I%ss'%length, length, val1))
00072     except struct.error as se: self._check_types(se)
00073     except TypeError as te: self._check_types(te)
00074 
00075   def deserialize(self, str):
00076     """
00077     unpack serialized message in str into this message instance
00078     :param str: byte array of serialized message, ``str``
00079     """
00080     try:
00081       end = 0
00082       start = end
00083       end += 4
00084       (length,) = _struct_I.unpack(str[start:end])
00085       pattern = '<%sd'%length
00086       start = end
00087       end += struct.calcsize(pattern)
00088       self.num_feedback = struct.unpack(pattern, str[start:end])
00089       start = end
00090       end += 4
00091       (length,) = _struct_I.unpack(str[start:end])
00092       self.string_feedback = []
00093       for i in range(0, length):
00094         start = end
00095         end += 4
00096         (length,) = _struct_I.unpack(str[start:end])
00097         start = end
00098         end += length
00099         if python3:
00100           val1 = str[start:end].decode('utf-8')
00101         else:
00102           val1 = str[start:end]
00103         self.string_feedback.append(val1)
00104       return self
00105     except struct.error as e:
00106       raise genpy.DeserializationError(e) #most likely buffer underfill
00107 
00108 
00109   def serialize_numpy(self, buff, numpy):
00110     """
00111     serialize message with numpy array types into buffer
00112     :param buff: buffer, ``StringIO``
00113     :param numpy: numpy python module
00114     """
00115     try:
00116       length = len(self.num_feedback)
00117       buff.write(_struct_I.pack(length))
00118       pattern = '<%sd'%length
00119       buff.write(self.num_feedback.tostring())
00120       length = len(self.string_feedback)
00121       buff.write(_struct_I.pack(length))
00122       for val1 in self.string_feedback:
00123         length = len(val1)
00124         if python3 or type(val1) == unicode:
00125           val1 = val1.encode('utf-8')
00126           length = len(val1)
00127         buff.write(struct.pack('<I%ss'%length, length, val1))
00128     except struct.error as se: self._check_types(se)
00129     except TypeError as te: self._check_types(te)
00130 
00131   def deserialize_numpy(self, str, numpy):
00132     """
00133     unpack serialized message in str into this message instance using numpy for array types
00134     :param str: byte array of serialized message, ``str``
00135     :param numpy: numpy python module
00136     """
00137     try:
00138       end = 0
00139       start = end
00140       end += 4
00141       (length,) = _struct_I.unpack(str[start:end])
00142       pattern = '<%sd'%length
00143       start = end
00144       end += struct.calcsize(pattern)
00145       self.num_feedback = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00146       start = end
00147       end += 4
00148       (length,) = _struct_I.unpack(str[start:end])
00149       self.string_feedback = []
00150       for i in range(0, length):
00151         start = end
00152         end += 4
00153         (length,) = _struct_I.unpack(str[start:end])
00154         start = end
00155         end += length
00156         if python3:
00157           val1 = str[start:end].decode('utf-8')
00158         else:
00159           val1 = str[start:end]
00160         self.string_feedback.append(val1)
00161       return self
00162     except struct.error as e:
00163       raise genpy.DeserializationError(e) #most likely buffer underfill
00164 
00165 _struct_I = genpy.struct_I


tibi_dabo_msgs
Author(s): Sergi Hernandez Juan
autogenerated on Fri Dec 6 2013 20:03:32