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