_Leds.py
Go to the documentation of this file.
00001 """autogenerated by genpy from irobot_create_2_1/LedsRequest.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 LedsRequest(genpy.Message):
00009   _md5sum = "df36903a5aadf6b7eb388fa7522028da"
00010   _type = "irobot_create_2_1/LedsRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """bool advance
00013 bool play
00014 uint8 color
00015 uint8 intensity
00016 
00017 """
00018   __slots__ = ['advance','play','color','intensity']
00019   _slot_types = ['bool','bool','uint8','uint8']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        advance,play,color,intensity
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(LedsRequest, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.advance is None:
00039         self.advance = False
00040       if self.play is None:
00041         self.play = False
00042       if self.color is None:
00043         self.color = 0
00044       if self.intensity is None:
00045         self.intensity = 0
00046     else:
00047       self.advance = False
00048       self.play = False
00049       self.color = 0
00050       self.intensity = 0
00051 
00052   def _get_types(self):
00053     """
00054     internal API method
00055     """
00056     return self._slot_types
00057 
00058   def serialize(self, buff):
00059     """
00060     serialize message into buffer
00061     :param buff: buffer, ``StringIO``
00062     """
00063     try:
00064       _x = self
00065       buff.write(_struct_4B.pack(_x.advance, _x.play, _x.color, _x.intensity))
00066     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00067     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00068 
00069   def deserialize(self, str):
00070     """
00071     unpack serialized message in str into this message instance
00072     :param str: byte array of serialized message, ``str``
00073     """
00074     try:
00075       end = 0
00076       _x = self
00077       start = end
00078       end += 4
00079       (_x.advance, _x.play, _x.color, _x.intensity,) = _struct_4B.unpack(str[start:end])
00080       self.advance = bool(self.advance)
00081       self.play = bool(self.play)
00082       return self
00083     except struct.error as e:
00084       raise genpy.DeserializationError(e) #most likely buffer underfill
00085 
00086 
00087   def serialize_numpy(self, buff, numpy):
00088     """
00089     serialize message with numpy array types into buffer
00090     :param buff: buffer, ``StringIO``
00091     :param numpy: numpy python module
00092     """
00093     try:
00094       _x = self
00095       buff.write(_struct_4B.pack(_x.advance, _x.play, _x.color, _x.intensity))
00096     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00097     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00098 
00099   def deserialize_numpy(self, str, numpy):
00100     """
00101     unpack serialized message in str into this message instance using numpy for array types
00102     :param str: byte array of serialized message, ``str``
00103     :param numpy: numpy python module
00104     """
00105     try:
00106       end = 0
00107       _x = self
00108       start = end
00109       end += 4
00110       (_x.advance, _x.play, _x.color, _x.intensity,) = _struct_4B.unpack(str[start:end])
00111       self.advance = bool(self.advance)
00112       self.play = bool(self.play)
00113       return self
00114     except struct.error as e:
00115       raise genpy.DeserializationError(e) #most likely buffer underfill
00116 
00117 _struct_I = genpy.struct_I
00118 _struct_4B = struct.Struct("<4B")
00119 """autogenerated by genpy from irobot_create_2_1/LedsResponse.msg. Do not edit."""
00120 import sys
00121 python3 = True if sys.hexversion > 0x03000000 else False
00122 import genpy
00123 import struct
00124 
00125 
00126 class LedsResponse(genpy.Message):
00127   _md5sum = "358e233cde0c8a8bcfea4ce193f8fc15"
00128   _type = "irobot_create_2_1/LedsResponse"
00129   _has_header = False #flag to mark the presence of a Header object
00130   _full_text = """bool success
00131 
00132 
00133 """
00134   __slots__ = ['success']
00135   _slot_types = ['bool']
00136 
00137   def __init__(self, *args, **kwds):
00138     """
00139     Constructor. Any message fields that are implicitly/explicitly
00140     set to None will be assigned a default value. The recommend
00141     use is keyword arguments as this is more robust to future message
00142     changes.  You cannot mix in-order arguments and keyword arguments.
00143 
00144     The available fields are:
00145        success
00146 
00147     :param args: complete set of field values, in .msg order
00148     :param kwds: use keyword arguments corresponding to message field names
00149     to set specific fields.
00150     """
00151     if args or kwds:
00152       super(LedsResponse, self).__init__(*args, **kwds)
00153       #message fields cannot be None, assign default values for those that are
00154       if self.success is None:
00155         self.success = False
00156     else:
00157       self.success = False
00158 
00159   def _get_types(self):
00160     """
00161     internal API method
00162     """
00163     return self._slot_types
00164 
00165   def serialize(self, buff):
00166     """
00167     serialize message into buffer
00168     :param buff: buffer, ``StringIO``
00169     """
00170     try:
00171       buff.write(_struct_B.pack(self.success))
00172     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00173     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00174 
00175   def deserialize(self, str):
00176     """
00177     unpack serialized message in str into this message instance
00178     :param str: byte array of serialized message, ``str``
00179     """
00180     try:
00181       end = 0
00182       start = end
00183       end += 1
00184       (self.success,) = _struct_B.unpack(str[start:end])
00185       self.success = bool(self.success)
00186       return self
00187     except struct.error as e:
00188       raise genpy.DeserializationError(e) #most likely buffer underfill
00189 
00190 
00191   def serialize_numpy(self, buff, numpy):
00192     """
00193     serialize message with numpy array types into buffer
00194     :param buff: buffer, ``StringIO``
00195     :param numpy: numpy python module
00196     """
00197     try:
00198       buff.write(_struct_B.pack(self.success))
00199     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00200     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00201 
00202   def deserialize_numpy(self, str, numpy):
00203     """
00204     unpack serialized message in str into this message instance using numpy for array types
00205     :param str: byte array of serialized message, ``str``
00206     :param numpy: numpy python module
00207     """
00208     try:
00209       end = 0
00210       start = end
00211       end += 1
00212       (self.success,) = _struct_B.unpack(str[start:end])
00213       self.success = bool(self.success)
00214       return self
00215     except struct.error as e:
00216       raise genpy.DeserializationError(e) #most likely buffer underfill
00217 
00218 _struct_I = genpy.struct_I
00219 _struct_B = struct.Struct("<B")
00220 class Leds(object):
00221   _type          = 'irobot_create_2_1/Leds'
00222   _md5sum = '926a8fe91d451f4d4bb099ec9e86ff14'
00223   _request_class  = LedsRequest
00224   _response_class = LedsResponse


irobot_create_2_1
Author(s): Graylin Trevor Jay, Brian Thomas
autogenerated on Sun Oct 5 2014 22:39:11