Go to the documentation of this file.00001 """autogenerated by genpy from kobuki_comms/WheelDropEvent.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 WheelDropEvent(genpy.Message):
00009 _md5sum = "d5872d35ba1f2183db249e0f0efb87a4"
00010 _type = "kobuki_comms/WheelDropEvent"
00011 _has_header = False
00012 _full_text = """# Provides a wheel drop event
00013 # This message is generated whenever a wheel is dropped (robot fell or was raised) or raised (normal condition).
00014
00015 uint8 LEFT = 0
00016 uint8 RIGHT = 1
00017
00018 uint8 RAISED = 0
00019 uint8 DROPPED = 1
00020
00021 uint8 state
00022 uint8 wheel
00023
00024 """
00025
00026 LEFT = 0
00027 RIGHT = 1
00028 RAISED = 0
00029 DROPPED = 1
00030
00031 __slots__ = ['state','wheel']
00032 _slot_types = ['uint8','uint8']
00033
00034 def __init__(self, *args, **kwds):
00035 """
00036 Constructor. Any message fields that are implicitly/explicitly
00037 set to None will be assigned a default value. The recommend
00038 use is keyword arguments as this is more robust to future message
00039 changes. You cannot mix in-order arguments and keyword arguments.
00040
00041 The available fields are:
00042 state,wheel
00043
00044 :param args: complete set of field values, in .msg order
00045 :param kwds: use keyword arguments corresponding to message field names
00046 to set specific fields.
00047 """
00048 if args or kwds:
00049 super(WheelDropEvent, self).__init__(*args, **kwds)
00050
00051 if self.state is None:
00052 self.state = 0
00053 if self.wheel is None:
00054 self.wheel = 0
00055 else:
00056 self.state = 0
00057 self.wheel = 0
00058
00059 def _get_types(self):
00060 """
00061 internal API method
00062 """
00063 return self._slot_types
00064
00065 def serialize(self, buff):
00066 """
00067 serialize message into buffer
00068 :param buff: buffer, ``StringIO``
00069 """
00070 try:
00071 _x = self
00072 buff.write(_struct_2B.pack(_x.state, _x.wheel))
00073 except struct.error as se: self._check_types(se)
00074 except TypeError as te: self._check_types(te)
00075
00076 def deserialize(self, str):
00077 """
00078 unpack serialized message in str into this message instance
00079 :param str: byte array of serialized message, ``str``
00080 """
00081 try:
00082 end = 0
00083 _x = self
00084 start = end
00085 end += 2
00086 (_x.state, _x.wheel,) = _struct_2B.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 _x = self
00100 buff.write(_struct_2B.pack(_x.state, _x.wheel))
00101 except struct.error as se: self._check_types(se)
00102 except TypeError as te: self._check_types(te)
00103
00104 def deserialize_numpy(self, str, numpy):
00105 """
00106 unpack serialized message in str into this message instance using numpy for array types
00107 :param str: byte array of serialized message, ``str``
00108 :param numpy: numpy python module
00109 """
00110 try:
00111 end = 0
00112 _x = self
00113 start = end
00114 end += 2
00115 (_x.state, _x.wheel,) = _struct_2B.unpack(str[start:end])
00116 return self
00117 except struct.error as e:
00118 raise genpy.DeserializationError(e)
00119
00120 _struct_I = genpy.struct_I
00121 _struct_2B = struct.Struct("<2B")