$search
00001 """autogenerated by genmsg_py from Adc.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class Adc(roslib.message.Message): 00007 _md5sum = "6d7853a614e2e821319068311f2af25b" 00008 _type = "rosserial_arduino/Adc" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """uint16 adc0 00011 uint16 adc1 00012 uint16 adc2 00013 uint16 adc3 00014 uint16 adc4 00015 uint16 adc5 00016 00017 """ 00018 __slots__ = ['adc0','adc1','adc2','adc3','adc4','adc5'] 00019 _slot_types = ['uint16','uint16','uint16','uint16','uint16','uint16'] 00020 00021 def __init__(self, *args, **kwds): 00022 """ 00023 Constructor. Any message fields that are implicitly/explicitly 00024 set to None will be assigned a default value. The recommend 00025 use is keyword arguments as this is more robust to future message 00026 changes. You cannot mix in-order arguments and keyword arguments. 00027 00028 The available fields are: 00029 adc0,adc1,adc2,adc3,adc4,adc5 00030 00031 @param args: complete set of field values, in .msg order 00032 @param kwds: use keyword arguments corresponding to message field names 00033 to set specific fields. 00034 """ 00035 if args or kwds: 00036 super(Adc, self).__init__(*args, **kwds) 00037 #message fields cannot be None, assign default values for those that are 00038 if self.adc0 is None: 00039 self.adc0 = 0 00040 if self.adc1 is None: 00041 self.adc1 = 0 00042 if self.adc2 is None: 00043 self.adc2 = 0 00044 if self.adc3 is None: 00045 self.adc3 = 0 00046 if self.adc4 is None: 00047 self.adc4 = 0 00048 if self.adc5 is None: 00049 self.adc5 = 0 00050 else: 00051 self.adc0 = 0 00052 self.adc1 = 0 00053 self.adc2 = 0 00054 self.adc3 = 0 00055 self.adc4 = 0 00056 self.adc5 = 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_6H.pack(_x.adc0, _x.adc1, _x.adc2, _x.adc3, _x.adc4, _x.adc5)) 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 += 12 00087 (_x.adc0, _x.adc1, _x.adc2, _x.adc3, _x.adc4, _x.adc5,) = _struct_6H.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_6H.pack(_x.adc0, _x.adc1, _x.adc2, _x.adc3, _x.adc4, _x.adc5)) 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 += 12 00120 (_x.adc0, _x.adc1, _x.adc2, _x.adc3, _x.adc4, _x.adc5,) = _struct_6H.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_6H = struct.Struct("<6H")