$search
00001 """autogenerated by genmsg_py from GPUStatus.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class GPUStatus(roslib.message.Message): 00008 _md5sum = "4c74e5474b8aade04e56108262099c6e" 00009 _type = "pr2_msgs/GPUStatus" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """Header header 00012 string product_name 00013 string pci_device_id 00014 string pci_location 00015 string display 00016 string driver_version 00017 float32 temperature # Temperature in Celcius 00018 float32 fan_speed # Fan speed in rad/s 00019 float32 gpu_usage # Usage in percent 00020 float32 memory_usage # Usage in percent 00021 ================================================================================ 00022 MSG: std_msgs/Header 00023 # Standard metadata for higher-level stamped data types. 00024 # This is generally used to communicate timestamped data 00025 # in a particular coordinate frame. 00026 # 00027 # sequence ID: consecutively increasing ID 00028 uint32 seq 00029 #Two-integer timestamp that is expressed as: 00030 # * stamp.secs: seconds (stamp_secs) since epoch 00031 # * stamp.nsecs: nanoseconds since stamp_secs 00032 # time-handling sugar is provided by the client library 00033 time stamp 00034 #Frame this data is associated with 00035 # 0: no frame 00036 # 1: global frame 00037 string frame_id 00038 00039 """ 00040 __slots__ = ['header','product_name','pci_device_id','pci_location','display','driver_version','temperature','fan_speed','gpu_usage','memory_usage'] 00041 _slot_types = ['Header','string','string','string','string','string','float32','float32','float32','float32'] 00042 00043 def __init__(self, *args, **kwds): 00044 """ 00045 Constructor. Any message fields that are implicitly/explicitly 00046 set to None will be assigned a default value. The recommend 00047 use is keyword arguments as this is more robust to future message 00048 changes. You cannot mix in-order arguments and keyword arguments. 00049 00050 The available fields are: 00051 header,product_name,pci_device_id,pci_location,display,driver_version,temperature,fan_speed,gpu_usage,memory_usage 00052 00053 @param args: complete set of field values, in .msg order 00054 @param kwds: use keyword arguments corresponding to message field names 00055 to set specific fields. 00056 """ 00057 if args or kwds: 00058 super(GPUStatus, self).__init__(*args, **kwds) 00059 #message fields cannot be None, assign default values for those that are 00060 if self.header is None: 00061 self.header = std_msgs.msg._Header.Header() 00062 if self.product_name is None: 00063 self.product_name = '' 00064 if self.pci_device_id is None: 00065 self.pci_device_id = '' 00066 if self.pci_location is None: 00067 self.pci_location = '' 00068 if self.display is None: 00069 self.display = '' 00070 if self.driver_version is None: 00071 self.driver_version = '' 00072 if self.temperature is None: 00073 self.temperature = 0. 00074 if self.fan_speed is None: 00075 self.fan_speed = 0. 00076 if self.gpu_usage is None: 00077 self.gpu_usage = 0. 00078 if self.memory_usage is None: 00079 self.memory_usage = 0. 00080 else: 00081 self.header = std_msgs.msg._Header.Header() 00082 self.product_name = '' 00083 self.pci_device_id = '' 00084 self.pci_location = '' 00085 self.display = '' 00086 self.driver_version = '' 00087 self.temperature = 0. 00088 self.fan_speed = 0. 00089 self.gpu_usage = 0. 00090 self.memory_usage = 0. 00091 00092 def _get_types(self): 00093 """ 00094 internal API method 00095 """ 00096 return self._slot_types 00097 00098 def serialize(self, buff): 00099 """ 00100 serialize message into buffer 00101 @param buff: buffer 00102 @type buff: StringIO 00103 """ 00104 try: 00105 _x = self 00106 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00107 _x = self.header.frame_id 00108 length = len(_x) 00109 buff.write(struct.pack('<I%ss'%length, length, _x)) 00110 _x = self.product_name 00111 length = len(_x) 00112 buff.write(struct.pack('<I%ss'%length, length, _x)) 00113 _x = self.pci_device_id 00114 length = len(_x) 00115 buff.write(struct.pack('<I%ss'%length, length, _x)) 00116 _x = self.pci_location 00117 length = len(_x) 00118 buff.write(struct.pack('<I%ss'%length, length, _x)) 00119 _x = self.display 00120 length = len(_x) 00121 buff.write(struct.pack('<I%ss'%length, length, _x)) 00122 _x = self.driver_version 00123 length = len(_x) 00124 buff.write(struct.pack('<I%ss'%length, length, _x)) 00125 _x = self 00126 buff.write(_struct_4f.pack(_x.temperature, _x.fan_speed, _x.gpu_usage, _x.memory_usage)) 00127 except struct.error as se: self._check_types(se) 00128 except TypeError as te: self._check_types(te) 00129 00130 def deserialize(self, str): 00131 """ 00132 unpack serialized message in str into this message instance 00133 @param str: byte array of serialized message 00134 @type str: str 00135 """ 00136 try: 00137 if self.header is None: 00138 self.header = std_msgs.msg._Header.Header() 00139 end = 0 00140 _x = self 00141 start = end 00142 end += 12 00143 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00144 start = end 00145 end += 4 00146 (length,) = _struct_I.unpack(str[start:end]) 00147 start = end 00148 end += length 00149 self.header.frame_id = str[start:end] 00150 start = end 00151 end += 4 00152 (length,) = _struct_I.unpack(str[start:end]) 00153 start = end 00154 end += length 00155 self.product_name = str[start:end] 00156 start = end 00157 end += 4 00158 (length,) = _struct_I.unpack(str[start:end]) 00159 start = end 00160 end += length 00161 self.pci_device_id = str[start:end] 00162 start = end 00163 end += 4 00164 (length,) = _struct_I.unpack(str[start:end]) 00165 start = end 00166 end += length 00167 self.pci_location = str[start:end] 00168 start = end 00169 end += 4 00170 (length,) = _struct_I.unpack(str[start:end]) 00171 start = end 00172 end += length 00173 self.display = str[start:end] 00174 start = end 00175 end += 4 00176 (length,) = _struct_I.unpack(str[start:end]) 00177 start = end 00178 end += length 00179 self.driver_version = str[start:end] 00180 _x = self 00181 start = end 00182 end += 16 00183 (_x.temperature, _x.fan_speed, _x.gpu_usage, _x.memory_usage,) = _struct_4f.unpack(str[start:end]) 00184 return self 00185 except struct.error as e: 00186 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00187 00188 00189 def serialize_numpy(self, buff, numpy): 00190 """ 00191 serialize message with numpy array types into buffer 00192 @param buff: buffer 00193 @type buff: StringIO 00194 @param numpy: numpy python module 00195 @type numpy module 00196 """ 00197 try: 00198 _x = self 00199 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00200 _x = self.header.frame_id 00201 length = len(_x) 00202 buff.write(struct.pack('<I%ss'%length, length, _x)) 00203 _x = self.product_name 00204 length = len(_x) 00205 buff.write(struct.pack('<I%ss'%length, length, _x)) 00206 _x = self.pci_device_id 00207 length = len(_x) 00208 buff.write(struct.pack('<I%ss'%length, length, _x)) 00209 _x = self.pci_location 00210 length = len(_x) 00211 buff.write(struct.pack('<I%ss'%length, length, _x)) 00212 _x = self.display 00213 length = len(_x) 00214 buff.write(struct.pack('<I%ss'%length, length, _x)) 00215 _x = self.driver_version 00216 length = len(_x) 00217 buff.write(struct.pack('<I%ss'%length, length, _x)) 00218 _x = self 00219 buff.write(_struct_4f.pack(_x.temperature, _x.fan_speed, _x.gpu_usage, _x.memory_usage)) 00220 except struct.error as se: self._check_types(se) 00221 except TypeError as te: self._check_types(te) 00222 00223 def deserialize_numpy(self, str, numpy): 00224 """ 00225 unpack serialized message in str into this message instance using numpy for array types 00226 @param str: byte array of serialized message 00227 @type str: str 00228 @param numpy: numpy python module 00229 @type numpy: module 00230 """ 00231 try: 00232 if self.header is None: 00233 self.header = std_msgs.msg._Header.Header() 00234 end = 0 00235 _x = self 00236 start = end 00237 end += 12 00238 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00239 start = end 00240 end += 4 00241 (length,) = _struct_I.unpack(str[start:end]) 00242 start = end 00243 end += length 00244 self.header.frame_id = str[start:end] 00245 start = end 00246 end += 4 00247 (length,) = _struct_I.unpack(str[start:end]) 00248 start = end 00249 end += length 00250 self.product_name = str[start:end] 00251 start = end 00252 end += 4 00253 (length,) = _struct_I.unpack(str[start:end]) 00254 start = end 00255 end += length 00256 self.pci_device_id = str[start:end] 00257 start = end 00258 end += 4 00259 (length,) = _struct_I.unpack(str[start:end]) 00260 start = end 00261 end += length 00262 self.pci_location = str[start:end] 00263 start = end 00264 end += 4 00265 (length,) = _struct_I.unpack(str[start:end]) 00266 start = end 00267 end += length 00268 self.display = str[start:end] 00269 start = end 00270 end += 4 00271 (length,) = _struct_I.unpack(str[start:end]) 00272 start = end 00273 end += length 00274 self.driver_version = str[start:end] 00275 _x = self 00276 start = end 00277 end += 16 00278 (_x.temperature, _x.fan_speed, _x.gpu_usage, _x.memory_usage,) = _struct_4f.unpack(str[start:end]) 00279 return self 00280 except struct.error as e: 00281 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00282 00283 _struct_I = roslib.message.struct_I 00284 _struct_4f = struct.Struct("<4f") 00285 _struct_3I = struct.Struct("<3I")