$search
00001 """autogenerated by genmsg_py from BoardInfo.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class BoardInfo(roslib.message.Message): 00007 _md5sum = "ffcb87ef2725c5fab7d0d8fcd4c7e7bc" 00008 _type = "ethercat_hardware/BoardInfo" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string description 00011 uint32 product_code 00012 uint32 pcb 00013 uint32 pca 00014 uint32 serial 00015 uint32 firmware_major 00016 uint32 firmware_minor 00017 float64 board_resistance 00018 float64 max_pwm_ratio 00019 float64 hw_max_current 00020 bool poor_measured_motor_voltage 00021 """ 00022 __slots__ = ['description','product_code','pcb','pca','serial','firmware_major','firmware_minor','board_resistance','max_pwm_ratio','hw_max_current','poor_measured_motor_voltage'] 00023 _slot_types = ['string','uint32','uint32','uint32','uint32','uint32','uint32','float64','float64','float64','bool'] 00024 00025 def __init__(self, *args, **kwds): 00026 """ 00027 Constructor. Any message fields that are implicitly/explicitly 00028 set to None will be assigned a default value. The recommend 00029 use is keyword arguments as this is more robust to future message 00030 changes. You cannot mix in-order arguments and keyword arguments. 00031 00032 The available fields are: 00033 description,product_code,pcb,pca,serial,firmware_major,firmware_minor,board_resistance,max_pwm_ratio,hw_max_current,poor_measured_motor_voltage 00034 00035 @param args: complete set of field values, in .msg order 00036 @param kwds: use keyword arguments corresponding to message field names 00037 to set specific fields. 00038 """ 00039 if args or kwds: 00040 super(BoardInfo, self).__init__(*args, **kwds) 00041 #message fields cannot be None, assign default values for those that are 00042 if self.description is None: 00043 self.description = '' 00044 if self.product_code is None: 00045 self.product_code = 0 00046 if self.pcb is None: 00047 self.pcb = 0 00048 if self.pca is None: 00049 self.pca = 0 00050 if self.serial is None: 00051 self.serial = 0 00052 if self.firmware_major is None: 00053 self.firmware_major = 0 00054 if self.firmware_minor is None: 00055 self.firmware_minor = 0 00056 if self.board_resistance is None: 00057 self.board_resistance = 0. 00058 if self.max_pwm_ratio is None: 00059 self.max_pwm_ratio = 0. 00060 if self.hw_max_current is None: 00061 self.hw_max_current = 0. 00062 if self.poor_measured_motor_voltage is None: 00063 self.poor_measured_motor_voltage = False 00064 else: 00065 self.description = '' 00066 self.product_code = 0 00067 self.pcb = 0 00068 self.pca = 0 00069 self.serial = 0 00070 self.firmware_major = 0 00071 self.firmware_minor = 0 00072 self.board_resistance = 0. 00073 self.max_pwm_ratio = 0. 00074 self.hw_max_current = 0. 00075 self.poor_measured_motor_voltage = False 00076 00077 def _get_types(self): 00078 """ 00079 internal API method 00080 """ 00081 return self._slot_types 00082 00083 def serialize(self, buff): 00084 """ 00085 serialize message into buffer 00086 @param buff: buffer 00087 @type buff: StringIO 00088 """ 00089 try: 00090 _x = self.description 00091 length = len(_x) 00092 buff.write(struct.pack('<I%ss'%length, length, _x)) 00093 _x = self 00094 buff.write(_struct_6I3dB.pack(_x.product_code, _x.pcb, _x.pca, _x.serial, _x.firmware_major, _x.firmware_minor, _x.board_resistance, _x.max_pwm_ratio, _x.hw_max_current, _x.poor_measured_motor_voltage)) 00095 except struct.error as se: self._check_types(se) 00096 except TypeError as te: self._check_types(te) 00097 00098 def deserialize(self, str): 00099 """ 00100 unpack serialized message in str into this message instance 00101 @param str: byte array of serialized message 00102 @type str: str 00103 """ 00104 try: 00105 end = 0 00106 start = end 00107 end += 4 00108 (length,) = _struct_I.unpack(str[start:end]) 00109 start = end 00110 end += length 00111 self.description = str[start:end] 00112 _x = self 00113 start = end 00114 end += 49 00115 (_x.product_code, _x.pcb, _x.pca, _x.serial, _x.firmware_major, _x.firmware_minor, _x.board_resistance, _x.max_pwm_ratio, _x.hw_max_current, _x.poor_measured_motor_voltage,) = _struct_6I3dB.unpack(str[start:end]) 00116 self.poor_measured_motor_voltage = bool(self.poor_measured_motor_voltage) 00117 return self 00118 except struct.error as e: 00119 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00120 00121 00122 def serialize_numpy(self, buff, numpy): 00123 """ 00124 serialize message with numpy array types into buffer 00125 @param buff: buffer 00126 @type buff: StringIO 00127 @param numpy: numpy python module 00128 @type numpy module 00129 """ 00130 try: 00131 _x = self.description 00132 length = len(_x) 00133 buff.write(struct.pack('<I%ss'%length, length, _x)) 00134 _x = self 00135 buff.write(_struct_6I3dB.pack(_x.product_code, _x.pcb, _x.pca, _x.serial, _x.firmware_major, _x.firmware_minor, _x.board_resistance, _x.max_pwm_ratio, _x.hw_max_current, _x.poor_measured_motor_voltage)) 00136 except struct.error as se: self._check_types(se) 00137 except TypeError as te: self._check_types(te) 00138 00139 def deserialize_numpy(self, str, numpy): 00140 """ 00141 unpack serialized message in str into this message instance using numpy for array types 00142 @param str: byte array of serialized message 00143 @type str: str 00144 @param numpy: numpy python module 00145 @type numpy: module 00146 """ 00147 try: 00148 end = 0 00149 start = end 00150 end += 4 00151 (length,) = _struct_I.unpack(str[start:end]) 00152 start = end 00153 end += length 00154 self.description = str[start:end] 00155 _x = self 00156 start = end 00157 end += 49 00158 (_x.product_code, _x.pcb, _x.pca, _x.serial, _x.firmware_major, _x.firmware_minor, _x.board_resistance, _x.max_pwm_ratio, _x.hw_max_current, _x.poor_measured_motor_voltage,) = _struct_6I3dB.unpack(str[start:end]) 00159 self.poor_measured_motor_voltage = bool(self.poor_measured_motor_voltage) 00160 return self 00161 except struct.error as e: 00162 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00163 00164 _struct_I = roslib.message.struct_I 00165 _struct_6I3dB = struct.Struct("<6I3dB")