Go to the documentation of this file.00001 """autogenerated by genpy from kobuki_comms/Sound.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 Sound(genpy.Message):
00009 _md5sum = "dfeab0daae67749c426c1db741a4f420"
00010 _type = "kobuki_comms/Sound"
00011 _has_header = False
00012 _full_text = """# Sends a command for playing sounds.
00013 # The available sound sequences:
00014 # 0 - turn on
00015 # 1 - turn off
00016 # 2 - recharge start
00017 # 3 - press button,
00018 # 4 - error sound
00019 # 5 - start cleaning
00020 # 6 - cleaning end
00021
00022 uint8 ON = 0
00023 uint8 OFF = 1
00024 uint8 RECHARGE = 2
00025 uint8 BUTTON = 3
00026 uint8 ERROR = 4
00027 uint8 CLEANINGSTART = 5
00028 uint8 CLEANINGEND = 6
00029
00030 uint8 value
00031 """
00032
00033 ON = 0
00034 OFF = 1
00035 RECHARGE = 2
00036 BUTTON = 3
00037 ERROR = 4
00038 CLEANINGSTART = 5
00039 CLEANINGEND = 6
00040
00041 __slots__ = ['value']
00042 _slot_types = ['uint8']
00043
00044 def __init__(self, *args, **kwds):
00045 """
00046 Constructor. Any message fields that are implicitly/explicitly
00047 set to None will be assigned a default value. The recommend
00048 use is keyword arguments as this is more robust to future message
00049 changes. You cannot mix in-order arguments and keyword arguments.
00050
00051 The available fields are:
00052 value
00053
00054 :param args: complete set of field values, in .msg order
00055 :param kwds: use keyword arguments corresponding to message field names
00056 to set specific fields.
00057 """
00058 if args or kwds:
00059 super(Sound, self).__init__(*args, **kwds)
00060
00061 if self.value is None:
00062 self.value = 0
00063 else:
00064 self.value = 0
00065
00066 def _get_types(self):
00067 """
00068 internal API method
00069 """
00070 return self._slot_types
00071
00072 def serialize(self, buff):
00073 """
00074 serialize message into buffer
00075 :param buff: buffer, ``StringIO``
00076 """
00077 try:
00078 buff.write(_struct_B.pack(self.value))
00079 except struct.error as se: self._check_types(se)
00080 except TypeError as te: self._check_types(te)
00081
00082 def deserialize(self, str):
00083 """
00084 unpack serialized message in str into this message instance
00085 :param str: byte array of serialized message, ``str``
00086 """
00087 try:
00088 end = 0
00089 start = end
00090 end += 1
00091 (self.value,) = _struct_B.unpack(str[start:end])
00092 return self
00093 except struct.error as e:
00094 raise genpy.DeserializationError(e)
00095
00096
00097 def serialize_numpy(self, buff, numpy):
00098 """
00099 serialize message with numpy array types into buffer
00100 :param buff: buffer, ``StringIO``
00101 :param numpy: numpy python module
00102 """
00103 try:
00104 buff.write(_struct_B.pack(self.value))
00105 except struct.error as se: self._check_types(se)
00106 except TypeError as te: self._check_types(te)
00107
00108 def deserialize_numpy(self, str, numpy):
00109 """
00110 unpack serialized message in str into this message instance using numpy for array types
00111 :param str: byte array of serialized message, ``str``
00112 :param numpy: numpy python module
00113 """
00114 try:
00115 end = 0
00116 start = end
00117 end += 1
00118 (self.value,) = _struct_B.unpack(str[start:end])
00119 return self
00120 except struct.error as e:
00121 raise genpy.DeserializationError(e)
00122
00123 _struct_I = genpy.struct_I
00124 _struct_B = struct.Struct("<B")