$search
00001 """autogenerated by genmsg_py from TactileTouch.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class TactileTouch(roslib.message.Message): 00007 _md5sum = "b75165bf9dfed26d50ad4e3162304225" 00008 _type = "nao_msgs/TactileTouch" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# A message for Nao's tactile interface (toucht buttons on the head) 00011 00012 uint8 button # which of the three segments is touched 00013 uint8 state # pressed or released, see below 00014 00015 uint8 buttonFront=1 00016 uint8 buttonMiddle=2 00017 uint8 buttonRear=3 00018 00019 uint8 stateReleased=0 00020 uint8 statePressed=1 00021 00022 """ 00023 # Pseudo-constants 00024 buttonFront = 1 00025 buttonMiddle = 2 00026 buttonRear = 3 00027 stateReleased = 0 00028 statePressed = 1 00029 00030 __slots__ = ['button','state'] 00031 _slot_types = ['uint8','uint8'] 00032 00033 def __init__(self, *args, **kwds): 00034 """ 00035 Constructor. Any message fields that are implicitly/explicitly 00036 set to None will be assigned a default value. The recommend 00037 use is keyword arguments as this is more robust to future message 00038 changes. You cannot mix in-order arguments and keyword arguments. 00039 00040 The available fields are: 00041 button,state 00042 00043 @param args: complete set of field values, in .msg order 00044 @param kwds: use keyword arguments corresponding to message field names 00045 to set specific fields. 00046 """ 00047 if args or kwds: 00048 super(TactileTouch, self).__init__(*args, **kwds) 00049 #message fields cannot be None, assign default values for those that are 00050 if self.button is None: 00051 self.button = 0 00052 if self.state is None: 00053 self.state = 0 00054 else: 00055 self.button = 0 00056 self.state = 0 00057 00058 def _get_types(self): 00059 """ 00060 internal API method 00061 """ 00062 return self._slot_types 00063 00064 def serialize(self, buff): 00065 """ 00066 serialize message into buffer 00067 @param buff: buffer 00068 @type buff: StringIO 00069 """ 00070 try: 00071 _x = self 00072 buff.write(_struct_2B.pack(_x.button, _x.state)) 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 00080 @type str: str 00081 """ 00082 try: 00083 end = 0 00084 _x = self 00085 start = end 00086 end += 2 00087 (_x.button, _x.state,) = _struct_2B.unpack(str[start:end]) 00088 return self 00089 except struct.error as e: 00090 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00091 00092 00093 def serialize_numpy(self, buff, numpy): 00094 """ 00095 serialize message with numpy array types into buffer 00096 @param buff: buffer 00097 @type buff: StringIO 00098 @param numpy: numpy python module 00099 @type numpy module 00100 """ 00101 try: 00102 _x = self 00103 buff.write(_struct_2B.pack(_x.button, _x.state)) 00104 except struct.error as se: self._check_types(se) 00105 except TypeError as te: self._check_types(te) 00106 00107 def deserialize_numpy(self, str, numpy): 00108 """ 00109 unpack serialized message in str into this message instance using numpy for array types 00110 @param str: byte array of serialized message 00111 @type str: str 00112 @param numpy: numpy python module 00113 @type numpy: module 00114 """ 00115 try: 00116 end = 0 00117 _x = self 00118 start = end 00119 end += 2 00120 (_x.button, _x.state,) = _struct_2B.unpack(str[start:end]) 00121 return self 00122 except struct.error as e: 00123 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00124 00125 _struct_I = roslib.message.struct_I 00126 _struct_2B = struct.Struct("<2B")