$search
00001 """autogenerated by genmsg_py from MotorTemperature.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 00007 class MotorTemperature(roslib.message.Message): 00008 _md5sum = "d8c7239cd096d6f25b75bff6b63f2162" 00009 _type = "ethercat_hardware/MotorTemperature" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# Sample of motor heating information 00012 time stamp 00013 float64 winding_temperature 00014 float64 housing_temperature 00015 float64 ambient_temperature 00016 float64 heating_power 00017 """ 00018 __slots__ = ['stamp','winding_temperature','housing_temperature','ambient_temperature','heating_power'] 00019 _slot_types = ['time','float64','float64','float64','float64'] 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 stamp,winding_temperature,housing_temperature,ambient_temperature,heating_power 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(MotorTemperature, self).__init__(*args, **kwds) 00037 #message fields cannot be None, assign default values for those that are 00038 if self.stamp is None: 00039 self.stamp = roslib.rostime.Time() 00040 if self.winding_temperature is None: 00041 self.winding_temperature = 0. 00042 if self.housing_temperature is None: 00043 self.housing_temperature = 0. 00044 if self.ambient_temperature is None: 00045 self.ambient_temperature = 0. 00046 if self.heating_power is None: 00047 self.heating_power = 0. 00048 else: 00049 self.stamp = roslib.rostime.Time() 00050 self.winding_temperature = 0. 00051 self.housing_temperature = 0. 00052 self.ambient_temperature = 0. 00053 self.heating_power = 0. 00054 00055 def _get_types(self): 00056 """ 00057 internal API method 00058 """ 00059 return self._slot_types 00060 00061 def serialize(self, buff): 00062 """ 00063 serialize message into buffer 00064 @param buff: buffer 00065 @type buff: StringIO 00066 """ 00067 try: 00068 _x = self 00069 buff.write(_struct_2I4d.pack(_x.stamp.secs, _x.stamp.nsecs, _x.winding_temperature, _x.housing_temperature, _x.ambient_temperature, _x.heating_power)) 00070 except struct.error as se: self._check_types(se) 00071 except TypeError as te: self._check_types(te) 00072 00073 def deserialize(self, str): 00074 """ 00075 unpack serialized message in str into this message instance 00076 @param str: byte array of serialized message 00077 @type str: str 00078 """ 00079 try: 00080 if self.stamp is None: 00081 self.stamp = roslib.rostime.Time() 00082 end = 0 00083 _x = self 00084 start = end 00085 end += 40 00086 (_x.stamp.secs, _x.stamp.nsecs, _x.winding_temperature, _x.housing_temperature, _x.ambient_temperature, _x.heating_power,) = _struct_2I4d.unpack(str[start:end]) 00087 self.stamp.canon() 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_2I4d.pack(_x.stamp.secs, _x.stamp.nsecs, _x.winding_temperature, _x.housing_temperature, _x.ambient_temperature, _x.heating_power)) 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 if self.stamp is None: 00117 self.stamp = roslib.rostime.Time() 00118 end = 0 00119 _x = self 00120 start = end 00121 end += 40 00122 (_x.stamp.secs, _x.stamp.nsecs, _x.winding_temperature, _x.housing_temperature, _x.ambient_temperature, _x.heating_power,) = _struct_2I4d.unpack(str[start:end]) 00123 self.stamp.canon() 00124 return self 00125 except struct.error as e: 00126 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00127 00128 _struct_I = roslib.message.struct_I 00129 _struct_2I4d = struct.Struct("<2I4d")