$search
00001 """autogenerated by genmsg_py from PowerBoardCommand2Request.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class PowerBoardCommand2Request(roslib.message.Message): 00007 _md5sum = "a31aee1db4294698375ff2a8cf53fea5" 00008 _type = "pr2_power_board/PowerBoardCommand2Request" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """int32 NUMBER_OF_CIRCUITS = 3 00011 00012 00013 00014 int32 circuit 00015 00016 00017 00018 int32 BASE = 0 00019 int32 RIGHT_ARM = 1 00020 int32 LEFT_ARM = 2 00021 00022 00023 00024 00025 string command 00026 00027 00028 bool reset_stats 00029 00030 00031 bool reset_circuits 00032 00033 """ 00034 # Pseudo-constants 00035 NUMBER_OF_CIRCUITS = 3 00036 BASE = 0 00037 RIGHT_ARM = 1 00038 LEFT_ARM = 2 00039 00040 __slots__ = ['circuit','command','reset_stats','reset_circuits'] 00041 _slot_types = ['int32','string','bool','bool'] 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 circuit,command,reset_stats,reset_circuits 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(PowerBoardCommand2Request, self).__init__(*args, **kwds) 00059 #message fields cannot be None, assign default values for those that are 00060 if self.circuit is None: 00061 self.circuit = 0 00062 if self.command is None: 00063 self.command = '' 00064 if self.reset_stats is None: 00065 self.reset_stats = False 00066 if self.reset_circuits is None: 00067 self.reset_circuits = False 00068 else: 00069 self.circuit = 0 00070 self.command = '' 00071 self.reset_stats = False 00072 self.reset_circuits = False 00073 00074 def _get_types(self): 00075 """ 00076 internal API method 00077 """ 00078 return self._slot_types 00079 00080 def serialize(self, buff): 00081 """ 00082 serialize message into buffer 00083 @param buff: buffer 00084 @type buff: StringIO 00085 """ 00086 try: 00087 buff.write(_struct_i.pack(self.circuit)) 00088 _x = self.command 00089 length = len(_x) 00090 buff.write(struct.pack('<I%ss'%length, length, _x)) 00091 _x = self 00092 buff.write(_struct_2B.pack(_x.reset_stats, _x.reset_circuits)) 00093 except struct.error as se: self._check_types(se) 00094 except TypeError as te: self._check_types(te) 00095 00096 def deserialize(self, str): 00097 """ 00098 unpack serialized message in str into this message instance 00099 @param str: byte array of serialized message 00100 @type str: str 00101 """ 00102 try: 00103 end = 0 00104 start = end 00105 end += 4 00106 (self.circuit,) = _struct_i.unpack(str[start:end]) 00107 start = end 00108 end += 4 00109 (length,) = _struct_I.unpack(str[start:end]) 00110 start = end 00111 end += length 00112 self.command = str[start:end] 00113 _x = self 00114 start = end 00115 end += 2 00116 (_x.reset_stats, _x.reset_circuits,) = _struct_2B.unpack(str[start:end]) 00117 self.reset_stats = bool(self.reset_stats) 00118 self.reset_circuits = bool(self.reset_circuits) 00119 return self 00120 except struct.error as e: 00121 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00122 00123 00124 def serialize_numpy(self, buff, numpy): 00125 """ 00126 serialize message with numpy array types into buffer 00127 @param buff: buffer 00128 @type buff: StringIO 00129 @param numpy: numpy python module 00130 @type numpy module 00131 """ 00132 try: 00133 buff.write(_struct_i.pack(self.circuit)) 00134 _x = self.command 00135 length = len(_x) 00136 buff.write(struct.pack('<I%ss'%length, length, _x)) 00137 _x = self 00138 buff.write(_struct_2B.pack(_x.reset_stats, _x.reset_circuits)) 00139 except struct.error as se: self._check_types(se) 00140 except TypeError as te: self._check_types(te) 00141 00142 def deserialize_numpy(self, str, numpy): 00143 """ 00144 unpack serialized message in str into this message instance using numpy for array types 00145 @param str: byte array of serialized message 00146 @type str: str 00147 @param numpy: numpy python module 00148 @type numpy: module 00149 """ 00150 try: 00151 end = 0 00152 start = end 00153 end += 4 00154 (self.circuit,) = _struct_i.unpack(str[start:end]) 00155 start = end 00156 end += 4 00157 (length,) = _struct_I.unpack(str[start:end]) 00158 start = end 00159 end += length 00160 self.command = str[start:end] 00161 _x = self 00162 start = end 00163 end += 2 00164 (_x.reset_stats, _x.reset_circuits,) = _struct_2B.unpack(str[start:end]) 00165 self.reset_stats = bool(self.reset_stats) 00166 self.reset_circuits = bool(self.reset_circuits) 00167 return self 00168 except struct.error as e: 00169 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00170 00171 _struct_I = roslib.message.struct_I 00172 _struct_i = struct.Struct("<i") 00173 _struct_2B = struct.Struct("<2B") 00174 """autogenerated by genmsg_py from PowerBoardCommand2Response.msg. Do not edit.""" 00175 import roslib.message 00176 import struct 00177 00178 00179 class PowerBoardCommand2Response(roslib.message.Message): 00180 _md5sum = "358e233cde0c8a8bcfea4ce193f8fc15" 00181 _type = "pr2_power_board/PowerBoardCommand2Response" 00182 _has_header = False #flag to mark the presence of a Header object 00183 _full_text = """ 00184 bool success 00185 00186 00187 """ 00188 __slots__ = ['success'] 00189 _slot_types = ['bool'] 00190 00191 def __init__(self, *args, **kwds): 00192 """ 00193 Constructor. Any message fields that are implicitly/explicitly 00194 set to None will be assigned a default value. The recommend 00195 use is keyword arguments as this is more robust to future message 00196 changes. You cannot mix in-order arguments and keyword arguments. 00197 00198 The available fields are: 00199 success 00200 00201 @param args: complete set of field values, in .msg order 00202 @param kwds: use keyword arguments corresponding to message field names 00203 to set specific fields. 00204 """ 00205 if args or kwds: 00206 super(PowerBoardCommand2Response, self).__init__(*args, **kwds) 00207 #message fields cannot be None, assign default values for those that are 00208 if self.success is None: 00209 self.success = False 00210 else: 00211 self.success = False 00212 00213 def _get_types(self): 00214 """ 00215 internal API method 00216 """ 00217 return self._slot_types 00218 00219 def serialize(self, buff): 00220 """ 00221 serialize message into buffer 00222 @param buff: buffer 00223 @type buff: StringIO 00224 """ 00225 try: 00226 buff.write(_struct_B.pack(self.success)) 00227 except struct.error as se: self._check_types(se) 00228 except TypeError as te: self._check_types(te) 00229 00230 def deserialize(self, str): 00231 """ 00232 unpack serialized message in str into this message instance 00233 @param str: byte array of serialized message 00234 @type str: str 00235 """ 00236 try: 00237 end = 0 00238 start = end 00239 end += 1 00240 (self.success,) = _struct_B.unpack(str[start:end]) 00241 self.success = bool(self.success) 00242 return self 00243 except struct.error as e: 00244 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00245 00246 00247 def serialize_numpy(self, buff, numpy): 00248 """ 00249 serialize message with numpy array types into buffer 00250 @param buff: buffer 00251 @type buff: StringIO 00252 @param numpy: numpy python module 00253 @type numpy module 00254 """ 00255 try: 00256 buff.write(_struct_B.pack(self.success)) 00257 except struct.error as se: self._check_types(se) 00258 except TypeError as te: self._check_types(te) 00259 00260 def deserialize_numpy(self, str, numpy): 00261 """ 00262 unpack serialized message in str into this message instance using numpy for array types 00263 @param str: byte array of serialized message 00264 @type str: str 00265 @param numpy: numpy python module 00266 @type numpy: module 00267 """ 00268 try: 00269 end = 0 00270 start = end 00271 end += 1 00272 (self.success,) = _struct_B.unpack(str[start:end]) 00273 self.success = bool(self.success) 00274 return self 00275 except struct.error as e: 00276 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00277 00278 _struct_I = roslib.message.struct_I 00279 _struct_B = struct.Struct("<B") 00280 class PowerBoardCommand2(roslib.message.ServiceDefinition): 00281 _type = 'pr2_power_board/PowerBoardCommand2' 00282 _md5sum = '4f143c27e05688798e6220ba69c6906a' 00283 _request_class = PowerBoardCommand2Request 00284 _response_class = PowerBoardCommand2Response