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