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


tug_ist_diagnosis_msgs
Author(s): Safdar Zaman, Gerald Steinbauer
autogenerated on Mon Jan 6 2014 11:51:02