00001 """autogenerated by genmsg_py from PowerBoardCommandRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class PowerBoardCommandRequest(roslib.message.Message):
00007 _md5sum = "9c621f5309bca0033e8eaef81c31500a"
00008 _type = "pr2_power_board/PowerBoardCommandRequest"
00009 _has_header = False
00010 _full_text = """uint32 serial_number
00011 int32 breaker_number
00012 string command
00013 uint32 flags
00014
00015 """
00016 __slots__ = ['serial_number','breaker_number','command','flags']
00017 _slot_types = ['uint32','int32','string','uint32']
00018
00019 def __init__(self, *args, **kwds):
00020 """
00021 Constructor. Any message fields that are implicitly/explicitly
00022 set to None will be assigned a default value. The recommend
00023 use is keyword arguments as this is more robust to future message
00024 changes. You cannot mix in-order arguments and keyword arguments.
00025
00026 The available fields are:
00027 serial_number,breaker_number,command,flags
00028
00029 @param args: complete set of field values, in .msg order
00030 @param kwds: use keyword arguments corresponding to message field names
00031 to set specific fields.
00032 """
00033 if args or kwds:
00034 super(PowerBoardCommandRequest, self).__init__(*args, **kwds)
00035
00036 if self.serial_number is None:
00037 self.serial_number = 0
00038 if self.breaker_number is None:
00039 self.breaker_number = 0
00040 if self.command is None:
00041 self.command = ''
00042 if self.flags is None:
00043 self.flags = 0
00044 else:
00045 self.serial_number = 0
00046 self.breaker_number = 0
00047 self.command = ''
00048 self.flags = 0
00049
00050 def _get_types(self):
00051 """
00052 internal API method
00053 """
00054 return self._slot_types
00055
00056 def serialize(self, buff):
00057 """
00058 serialize message into buffer
00059 @param buff: buffer
00060 @type buff: StringIO
00061 """
00062 try:
00063 _x = self
00064 buff.write(_struct_Ii.pack(_x.serial_number, _x.breaker_number))
00065 _x = self.command
00066 length = len(_x)
00067 buff.write(struct.pack('<I%ss'%length, length, _x))
00068 buff.write(_struct_I.pack(self.flags))
00069 except struct.error, se: self._check_types(se)
00070 except TypeError, te: self._check_types(te)
00071
00072 def deserialize(self, str):
00073 """
00074 unpack serialized message in str into this message instance
00075 @param str: byte array of serialized message
00076 @type str: str
00077 """
00078 try:
00079 end = 0
00080 _x = self
00081 start = end
00082 end += 8
00083 (_x.serial_number, _x.breaker_number,) = _struct_Ii.unpack(str[start:end])
00084 start = end
00085 end += 4
00086 (length,) = _struct_I.unpack(str[start:end])
00087 start = end
00088 end += length
00089 self.command = str[start:end]
00090 start = end
00091 end += 4
00092 (self.flags,) = _struct_I.unpack(str[start:end])
00093 return self
00094 except struct.error, e:
00095 raise roslib.message.DeserializationError(e)
00096
00097
00098 def serialize_numpy(self, buff, numpy):
00099 """
00100 serialize message with numpy array types into buffer
00101 @param buff: buffer
00102 @type buff: StringIO
00103 @param numpy: numpy python module
00104 @type numpy module
00105 """
00106 try:
00107 _x = self
00108 buff.write(_struct_Ii.pack(_x.serial_number, _x.breaker_number))
00109 _x = self.command
00110 length = len(_x)
00111 buff.write(struct.pack('<I%ss'%length, length, _x))
00112 buff.write(_struct_I.pack(self.flags))
00113 except struct.error, se: self._check_types(se)
00114 except TypeError, te: self._check_types(te)
00115
00116 def deserialize_numpy(self, str, numpy):
00117 """
00118 unpack serialized message in str into this message instance using numpy for array types
00119 @param str: byte array of serialized message
00120 @type str: str
00121 @param numpy: numpy python module
00122 @type numpy: module
00123 """
00124 try:
00125 end = 0
00126 _x = self
00127 start = end
00128 end += 8
00129 (_x.serial_number, _x.breaker_number,) = _struct_Ii.unpack(str[start:end])
00130 start = end
00131 end += 4
00132 (length,) = _struct_I.unpack(str[start:end])
00133 start = end
00134 end += length
00135 self.command = str[start:end]
00136 start = end
00137 end += 4
00138 (self.flags,) = _struct_I.unpack(str[start:end])
00139 return self
00140 except struct.error, e:
00141 raise roslib.message.DeserializationError(e)
00142
00143 _struct_I = roslib.message.struct_I
00144 _struct_Ii = struct.Struct("<Ii")
00145 """autogenerated by genmsg_py from PowerBoardCommandResponse.msg. Do not edit."""
00146 import roslib.message
00147 import struct
00148
00149
00150 class PowerBoardCommandResponse(roslib.message.Message):
00151 _md5sum = "f5697a1e05c2a3e1c23cab49a31319ec"
00152 _type = "pr2_power_board/PowerBoardCommandResponse"
00153 _has_header = False
00154 _full_text = """int32 retval
00155
00156
00157 """
00158 __slots__ = ['retval']
00159 _slot_types = ['int32']
00160
00161 def __init__(self, *args, **kwds):
00162 """
00163 Constructor. Any message fields that are implicitly/explicitly
00164 set to None will be assigned a default value. The recommend
00165 use is keyword arguments as this is more robust to future message
00166 changes. You cannot mix in-order arguments and keyword arguments.
00167
00168 The available fields are:
00169 retval
00170
00171 @param args: complete set of field values, in .msg order
00172 @param kwds: use keyword arguments corresponding to message field names
00173 to set specific fields.
00174 """
00175 if args or kwds:
00176 super(PowerBoardCommandResponse, self).__init__(*args, **kwds)
00177
00178 if self.retval is None:
00179 self.retval = 0
00180 else:
00181 self.retval = 0
00182
00183 def _get_types(self):
00184 """
00185 internal API method
00186 """
00187 return self._slot_types
00188
00189 def serialize(self, buff):
00190 """
00191 serialize message into buffer
00192 @param buff: buffer
00193 @type buff: StringIO
00194 """
00195 try:
00196 buff.write(_struct_i.pack(self.retval))
00197 except struct.error, se: self._check_types(se)
00198 except TypeError, te: self._check_types(te)
00199
00200 def deserialize(self, str):
00201 """
00202 unpack serialized message in str into this message instance
00203 @param str: byte array of serialized message
00204 @type str: str
00205 """
00206 try:
00207 end = 0
00208 start = end
00209 end += 4
00210 (self.retval,) = _struct_i.unpack(str[start:end])
00211 return self
00212 except struct.error, e:
00213 raise roslib.message.DeserializationError(e)
00214
00215
00216 def serialize_numpy(self, buff, numpy):
00217 """
00218 serialize message with numpy array types into buffer
00219 @param buff: buffer
00220 @type buff: StringIO
00221 @param numpy: numpy python module
00222 @type numpy module
00223 """
00224 try:
00225 buff.write(_struct_i.pack(self.retval))
00226 except struct.error, se: self._check_types(se)
00227 except TypeError, te: self._check_types(te)
00228
00229 def deserialize_numpy(self, str, numpy):
00230 """
00231 unpack serialized message in str into this message instance using numpy for array types
00232 @param str: byte array of serialized message
00233 @type str: str
00234 @param numpy: numpy python module
00235 @type numpy: module
00236 """
00237 try:
00238 end = 0
00239 start = end
00240 end += 4
00241 (self.retval,) = _struct_i.unpack(str[start:end])
00242 return self
00243 except struct.error, e:
00244 raise roslib.message.DeserializationError(e)
00245
00246 _struct_I = roslib.message.struct_I
00247 _struct_i = struct.Struct("<i")
00248 class PowerBoardCommand(roslib.message.ServiceDefinition):
00249 _type = 'pr2_power_board/PowerBoardCommand'
00250 _md5sum = 'd9e38de783aa7edc3146446518e85af2'
00251 _request_class = PowerBoardCommandRequest
00252 _response_class = PowerBoardCommandResponse