$search
00001 """autogenerated by genmsg_py from ActuatorInfo.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ActuatorInfo(roslib.message.Message): 00007 _md5sum = "40f44d8ec4380adc0b63713486eecb09" 00008 _type = "ethercat_hardware/ActuatorInfo" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """uint32 id 00011 string name 00012 string robot_name 00013 string motor_make 00014 string motor_model 00015 float64 max_current 00016 float64 speed_constant 00017 float64 motor_resistance 00018 float64 motor_torque_constant 00019 float64 encoder_reduction 00020 float64 pulses_per_revolution 00021 """ 00022 __slots__ = ['id','name','robot_name','motor_make','motor_model','max_current','speed_constant','motor_resistance','motor_torque_constant','encoder_reduction','pulses_per_revolution'] 00023 _slot_types = ['uint32','string','string','string','string','float64','float64','float64','float64','float64','float64'] 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 id,name,robot_name,motor_make,motor_model,max_current,speed_constant,motor_resistance,motor_torque_constant,encoder_reduction,pulses_per_revolution 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(ActuatorInfo, self).__init__(*args, **kwds) 00041 #message fields cannot be None, assign default values for those that are 00042 if self.id is None: 00043 self.id = 0 00044 if self.name is None: 00045 self.name = '' 00046 if self.robot_name is None: 00047 self.robot_name = '' 00048 if self.motor_make is None: 00049 self.motor_make = '' 00050 if self.motor_model is None: 00051 self.motor_model = '' 00052 if self.max_current is None: 00053 self.max_current = 0. 00054 if self.speed_constant is None: 00055 self.speed_constant = 0. 00056 if self.motor_resistance is None: 00057 self.motor_resistance = 0. 00058 if self.motor_torque_constant is None: 00059 self.motor_torque_constant = 0. 00060 if self.encoder_reduction is None: 00061 self.encoder_reduction = 0. 00062 if self.pulses_per_revolution is None: 00063 self.pulses_per_revolution = 0. 00064 else: 00065 self.id = 0 00066 self.name = '' 00067 self.robot_name = '' 00068 self.motor_make = '' 00069 self.motor_model = '' 00070 self.max_current = 0. 00071 self.speed_constant = 0. 00072 self.motor_resistance = 0. 00073 self.motor_torque_constant = 0. 00074 self.encoder_reduction = 0. 00075 self.pulses_per_revolution = 0. 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 buff.write(_struct_I.pack(self.id)) 00091 _x = self.name 00092 length = len(_x) 00093 buff.write(struct.pack('<I%ss'%length, length, _x)) 00094 _x = self.robot_name 00095 length = len(_x) 00096 buff.write(struct.pack('<I%ss'%length, length, _x)) 00097 _x = self.motor_make 00098 length = len(_x) 00099 buff.write(struct.pack('<I%ss'%length, length, _x)) 00100 _x = self.motor_model 00101 length = len(_x) 00102 buff.write(struct.pack('<I%ss'%length, length, _x)) 00103 _x = self 00104 buff.write(_struct_6d.pack(_x.max_current, _x.speed_constant, _x.motor_resistance, _x.motor_torque_constant, _x.encoder_reduction, _x.pulses_per_revolution)) 00105 except struct.error as se: self._check_types(se) 00106 except TypeError as te: self._check_types(te) 00107 00108 def deserialize(self, str): 00109 """ 00110 unpack serialized message in str into this message instance 00111 @param str: byte array of serialized message 00112 @type str: str 00113 """ 00114 try: 00115 end = 0 00116 start = end 00117 end += 4 00118 (self.id,) = _struct_I.unpack(str[start:end]) 00119 start = end 00120 end += 4 00121 (length,) = _struct_I.unpack(str[start:end]) 00122 start = end 00123 end += length 00124 self.name = str[start:end] 00125 start = end 00126 end += 4 00127 (length,) = _struct_I.unpack(str[start:end]) 00128 start = end 00129 end += length 00130 self.robot_name = str[start:end] 00131 start = end 00132 end += 4 00133 (length,) = _struct_I.unpack(str[start:end]) 00134 start = end 00135 end += length 00136 self.motor_make = str[start:end] 00137 start = end 00138 end += 4 00139 (length,) = _struct_I.unpack(str[start:end]) 00140 start = end 00141 end += length 00142 self.motor_model = str[start:end] 00143 _x = self 00144 start = end 00145 end += 48 00146 (_x.max_current, _x.speed_constant, _x.motor_resistance, _x.motor_torque_constant, _x.encoder_reduction, _x.pulses_per_revolution,) = _struct_6d.unpack(str[start:end]) 00147 return self 00148 except struct.error as e: 00149 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00150 00151 00152 def serialize_numpy(self, buff, numpy): 00153 """ 00154 serialize message with numpy array types into buffer 00155 @param buff: buffer 00156 @type buff: StringIO 00157 @param numpy: numpy python module 00158 @type numpy module 00159 """ 00160 try: 00161 buff.write(_struct_I.pack(self.id)) 00162 _x = self.name 00163 length = len(_x) 00164 buff.write(struct.pack('<I%ss'%length, length, _x)) 00165 _x = self.robot_name 00166 length = len(_x) 00167 buff.write(struct.pack('<I%ss'%length, length, _x)) 00168 _x = self.motor_make 00169 length = len(_x) 00170 buff.write(struct.pack('<I%ss'%length, length, _x)) 00171 _x = self.motor_model 00172 length = len(_x) 00173 buff.write(struct.pack('<I%ss'%length, length, _x)) 00174 _x = self 00175 buff.write(_struct_6d.pack(_x.max_current, _x.speed_constant, _x.motor_resistance, _x.motor_torque_constant, _x.encoder_reduction, _x.pulses_per_revolution)) 00176 except struct.error as se: self._check_types(se) 00177 except TypeError as te: self._check_types(te) 00178 00179 def deserialize_numpy(self, str, numpy): 00180 """ 00181 unpack serialized message in str into this message instance using numpy for array types 00182 @param str: byte array of serialized message 00183 @type str: str 00184 @param numpy: numpy python module 00185 @type numpy: module 00186 """ 00187 try: 00188 end = 0 00189 start = end 00190 end += 4 00191 (self.id,) = _struct_I.unpack(str[start:end]) 00192 start = end 00193 end += 4 00194 (length,) = _struct_I.unpack(str[start:end]) 00195 start = end 00196 end += length 00197 self.name = str[start:end] 00198 start = end 00199 end += 4 00200 (length,) = _struct_I.unpack(str[start:end]) 00201 start = end 00202 end += length 00203 self.robot_name = str[start:end] 00204 start = end 00205 end += 4 00206 (length,) = _struct_I.unpack(str[start:end]) 00207 start = end 00208 end += length 00209 self.motor_make = str[start:end] 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 start = end 00214 end += length 00215 self.motor_model = str[start:end] 00216 _x = self 00217 start = end 00218 end += 48 00219 (_x.max_current, _x.speed_constant, _x.motor_resistance, _x.motor_torque_constant, _x.encoder_reduction, _x.pulses_per_revolution,) = _struct_6d.unpack(str[start:end]) 00220 return self 00221 except struct.error as e: 00222 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00223 00224 _struct_I = roslib.message.struct_I 00225 _struct_6d = struct.Struct("<6d")