00001 """autogenerated by genpy from roomba_500_series/Leds.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import std_msgs.msg
00008
00009 class Leds(genpy.Message):
00010 _md5sum = "d69ee7dfd55b5e80fe8d68fdc28e3612"
00011 _type = "roomba_500_series/Leds"
00012 _has_header = True
00013 _full_text = """Header header
00014 bool warning
00015 bool dock
00016 bool spot
00017 bool dirt_detect
00018 uint8 clean_color
00019 uint8 clean_intensity
00020
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data
00025 # in a particular coordinate frame.
00026 #
00027 # sequence ID: consecutively increasing ID
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038
00039 """
00040 __slots__ = ['header','warning','dock','spot','dirt_detect','clean_color','clean_intensity']
00041 _slot_types = ['std_msgs/Header','bool','bool','bool','bool','uint8','uint8']
00042
00043 def __init__(self, *args, **kwds):
00044 """
00045 Constructor. Any message fields that are implicitly/explicitly
00046 set to None will be assigned a default value. The recommend
00047 use is keyword arguments as this is more robust to future message
00048 changes. You cannot mix in-order arguments and keyword arguments.
00049
00050 The available fields are:
00051 header,warning,dock,spot,dirt_detect,clean_color,clean_intensity
00052
00053 :param args: complete set of field values, in .msg order
00054 :param kwds: use keyword arguments corresponding to message field names
00055 to set specific fields.
00056 """
00057 if args or kwds:
00058 super(Leds, self).__init__(*args, **kwds)
00059
00060 if self.header is None:
00061 self.header = std_msgs.msg.Header()
00062 if self.warning is None:
00063 self.warning = False
00064 if self.dock is None:
00065 self.dock = False
00066 if self.spot is None:
00067 self.spot = False
00068 if self.dirt_detect is None:
00069 self.dirt_detect = False
00070 if self.clean_color is None:
00071 self.clean_color = 0
00072 if self.clean_intensity is None:
00073 self.clean_intensity = 0
00074 else:
00075 self.header = std_msgs.msg.Header()
00076 self.warning = False
00077 self.dock = False
00078 self.spot = False
00079 self.dirt_detect = False
00080 self.clean_color = 0
00081 self.clean_intensity = 0
00082
00083 def _get_types(self):
00084 """
00085 internal API method
00086 """
00087 return self._slot_types
00088
00089 def serialize(self, buff):
00090 """
00091 serialize message into buffer
00092 :param buff: buffer, ``StringIO``
00093 """
00094 try:
00095 _x = self
00096 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00097 _x = self.header.frame_id
00098 length = len(_x)
00099 if python3 or type(_x) == unicode:
00100 _x = _x.encode('utf-8')
00101 length = len(_x)
00102 buff.write(struct.pack('<I%ss'%length, length, _x))
00103 _x = self
00104 buff.write(_struct_6B.pack(_x.warning, _x.dock, _x.spot, _x.dirt_detect, _x.clean_color, _x.clean_intensity))
00105 except struct.error as se: self._check_types(se)
00106 except TypeError as te: self._check_types(te)
00107
00108 def deserialize(self, str):
00109 """
00110 unpack serialized message in str into this message instance
00111 :param str: byte array of serialized message, ``str``
00112 """
00113 try:
00114 if self.header is None:
00115 self.header = std_msgs.msg.Header()
00116 end = 0
00117 _x = self
00118 start = end
00119 end += 12
00120 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00121 start = end
00122 end += 4
00123 (length,) = _struct_I.unpack(str[start:end])
00124 start = end
00125 end += length
00126 if python3:
00127 self.header.frame_id = str[start:end].decode('utf-8')
00128 else:
00129 self.header.frame_id = str[start:end]
00130 _x = self
00131 start = end
00132 end += 6
00133 (_x.warning, _x.dock, _x.spot, _x.dirt_detect, _x.clean_color, _x.clean_intensity,) = _struct_6B.unpack(str[start:end])
00134 self.warning = bool(self.warning)
00135 self.dock = bool(self.dock)
00136 self.spot = bool(self.spot)
00137 self.dirt_detect = bool(self.dirt_detect)
00138 return self
00139 except struct.error as e:
00140 raise genpy.DeserializationError(e)
00141
00142
00143 def serialize_numpy(self, buff, numpy):
00144 """
00145 serialize message with numpy array types into buffer
00146 :param buff: buffer, ``StringIO``
00147 :param numpy: numpy python module
00148 """
00149 try:
00150 _x = self
00151 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00152 _x = self.header.frame_id
00153 length = len(_x)
00154 if python3 or type(_x) == unicode:
00155 _x = _x.encode('utf-8')
00156 length = len(_x)
00157 buff.write(struct.pack('<I%ss'%length, length, _x))
00158 _x = self
00159 buff.write(_struct_6B.pack(_x.warning, _x.dock, _x.spot, _x.dirt_detect, _x.clean_color, _x.clean_intensity))
00160 except struct.error as se: self._check_types(se)
00161 except TypeError as te: self._check_types(te)
00162
00163 def deserialize_numpy(self, str, numpy):
00164 """
00165 unpack serialized message in str into this message instance using numpy for array types
00166 :param str: byte array of serialized message, ``str``
00167 :param numpy: numpy python module
00168 """
00169 try:
00170 if self.header is None:
00171 self.header = std_msgs.msg.Header()
00172 end = 0
00173 _x = self
00174 start = end
00175 end += 12
00176 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 if python3:
00183 self.header.frame_id = str[start:end].decode('utf-8')
00184 else:
00185 self.header.frame_id = str[start:end]
00186 _x = self
00187 start = end
00188 end += 6
00189 (_x.warning, _x.dock, _x.spot, _x.dirt_detect, _x.clean_color, _x.clean_intensity,) = _struct_6B.unpack(str[start:end])
00190 self.warning = bool(self.warning)
00191 self.dock = bool(self.dock)
00192 self.spot = bool(self.spot)
00193 self.dirt_detect = bool(self.dirt_detect)
00194 return self
00195 except struct.error as e:
00196 raise genpy.DeserializationError(e)
00197
00198 _struct_I = genpy.struct_I
00199 _struct_3I = struct.Struct("<3I")
00200 _struct_6B = struct.Struct("<6B")