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


ros_rt_wmp_msgs
Author(s): Pablo Urcola
autogenerated on Fri Jan 3 2014 12:07:44