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