00001 """autogenerated by genpy from pr2_mechanism_msgs/SwitchControllerRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class SwitchControllerRequest(genpy.Message):
00009 _md5sum = "434da54adc434a5af5743ed711fd6ba1"
00010 _type = "pr2_mechanism_msgs/SwitchControllerRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 string[] start_controllers
00031 string[] stop_controllers
00032 int32 strictness
00033 int32 BEST_EFFORT=1
00034 int32 STRICT=2
00035
00036 """
00037
00038 BEST_EFFORT = 1
00039 STRICT = 2
00040
00041 __slots__ = ['start_controllers','stop_controllers','strictness']
00042 _slot_types = ['string[]','string[]','int32']
00043
00044 def __init__(self, *args, **kwds):
00045 """
00046 Constructor. Any message fields that are implicitly/explicitly
00047 set to None will be assigned a default value. The recommend
00048 use is keyword arguments as this is more robust to future message
00049 changes. You cannot mix in-order arguments and keyword arguments.
00050
00051 The available fields are:
00052 start_controllers,stop_controllers,strictness
00053
00054 :param args: complete set of field values, in .msg order
00055 :param kwds: use keyword arguments corresponding to message field names
00056 to set specific fields.
00057 """
00058 if args or kwds:
00059 super(SwitchControllerRequest, self).__init__(*args, **kwds)
00060
00061 if self.start_controllers is None:
00062 self.start_controllers = []
00063 if self.stop_controllers is None:
00064 self.stop_controllers = []
00065 if self.strictness is None:
00066 self.strictness = 0
00067 else:
00068 self.start_controllers = []
00069 self.stop_controllers = []
00070 self.strictness = 0
00071
00072 def _get_types(self):
00073 """
00074 internal API method
00075 """
00076 return self._slot_types
00077
00078 def serialize(self, buff):
00079 """
00080 serialize message into buffer
00081 :param buff: buffer, ``StringIO``
00082 """
00083 try:
00084 length = len(self.start_controllers)
00085 buff.write(_struct_I.pack(length))
00086 for val1 in self.start_controllers:
00087 length = len(val1)
00088 if python3 or type(val1) == unicode:
00089 val1 = val1.encode('utf-8')
00090 length = len(val1)
00091 buff.write(struct.pack('<I%ss'%length, length, val1))
00092 length = len(self.stop_controllers)
00093 buff.write(_struct_I.pack(length))
00094 for val1 in self.stop_controllers:
00095 length = len(val1)
00096 if python3 or type(val1) == unicode:
00097 val1 = val1.encode('utf-8')
00098 length = len(val1)
00099 buff.write(struct.pack('<I%ss'%length, length, val1))
00100 buff.write(_struct_i.pack(self.strictness))
00101 except struct.error as se: self._check_types(se)
00102 except TypeError as te: self._check_types(te)
00103
00104 def deserialize(self, str):
00105 """
00106 unpack serialized message in str into this message instance
00107 :param str: byte array of serialized message, ``str``
00108 """
00109 try:
00110 end = 0
00111 start = end
00112 end += 4
00113 (length,) = _struct_I.unpack(str[start:end])
00114 self.start_controllers = []
00115 for i in range(0, length):
00116 start = end
00117 end += 4
00118 (length,) = _struct_I.unpack(str[start:end])
00119 start = end
00120 end += length
00121 if python3:
00122 val1 = str[start:end].decode('utf-8')
00123 else:
00124 val1 = str[start:end]
00125 self.start_controllers.append(val1)
00126 start = end
00127 end += 4
00128 (length,) = _struct_I.unpack(str[start:end])
00129 self.stop_controllers = []
00130 for i in range(0, length):
00131 start = end
00132 end += 4
00133 (length,) = _struct_I.unpack(str[start:end])
00134 start = end
00135 end += length
00136 if python3:
00137 val1 = str[start:end].decode('utf-8')
00138 else:
00139 val1 = str[start:end]
00140 self.stop_controllers.append(val1)
00141 start = end
00142 end += 4
00143 (self.strictness,) = _struct_i.unpack(str[start:end])
00144 return self
00145 except struct.error as e:
00146 raise genpy.DeserializationError(e)
00147
00148
00149 def serialize_numpy(self, buff, numpy):
00150 """
00151 serialize message with numpy array types into buffer
00152 :param buff: buffer, ``StringIO``
00153 :param numpy: numpy python module
00154 """
00155 try:
00156 length = len(self.start_controllers)
00157 buff.write(_struct_I.pack(length))
00158 for val1 in self.start_controllers:
00159 length = len(val1)
00160 if python3 or type(val1) == unicode:
00161 val1 = val1.encode('utf-8')
00162 length = len(val1)
00163 buff.write(struct.pack('<I%ss'%length, length, val1))
00164 length = len(self.stop_controllers)
00165 buff.write(_struct_I.pack(length))
00166 for val1 in self.stop_controllers:
00167 length = len(val1)
00168 if python3 or type(val1) == unicode:
00169 val1 = val1.encode('utf-8')
00170 length = len(val1)
00171 buff.write(struct.pack('<I%ss'%length, length, val1))
00172 buff.write(_struct_i.pack(self.strictness))
00173 except struct.error as se: self._check_types(se)
00174 except TypeError as te: self._check_types(te)
00175
00176 def deserialize_numpy(self, str, numpy):
00177 """
00178 unpack serialized message in str into this message instance using numpy for array types
00179 :param str: byte array of serialized message, ``str``
00180 :param numpy: numpy python module
00181 """
00182 try:
00183 end = 0
00184 start = end
00185 end += 4
00186 (length,) = _struct_I.unpack(str[start:end])
00187 self.start_controllers = []
00188 for i in range(0, length):
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 start = end
00193 end += length
00194 if python3:
00195 val1 = str[start:end].decode('utf-8')
00196 else:
00197 val1 = str[start:end]
00198 self.start_controllers.append(val1)
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 self.stop_controllers = []
00203 for i in range(0, length):
00204 start = end
00205 end += 4
00206 (length,) = _struct_I.unpack(str[start:end])
00207 start = end
00208 end += length
00209 if python3:
00210 val1 = str[start:end].decode('utf-8')
00211 else:
00212 val1 = str[start:end]
00213 self.stop_controllers.append(val1)
00214 start = end
00215 end += 4
00216 (self.strictness,) = _struct_i.unpack(str[start:end])
00217 return self
00218 except struct.error as e:
00219 raise genpy.DeserializationError(e)
00220
00221 _struct_I = genpy.struct_I
00222 _struct_i = struct.Struct("<i")
00223 """autogenerated by genpy from pr2_mechanism_msgs/SwitchControllerResponse.msg. Do not edit."""
00224 import sys
00225 python3 = True if sys.hexversion > 0x03000000 else False
00226 import genpy
00227 import struct
00228
00229
00230 class SwitchControllerResponse(genpy.Message):
00231 _md5sum = "6f6da3883749771fac40d6deb24a8c02"
00232 _type = "pr2_mechanism_msgs/SwitchControllerResponse"
00233 _has_header = False
00234 _full_text = """bool ok
00235
00236
00237
00238
00239
00240 """
00241 __slots__ = ['ok']
00242 _slot_types = ['bool']
00243
00244 def __init__(self, *args, **kwds):
00245 """
00246 Constructor. Any message fields that are implicitly/explicitly
00247 set to None will be assigned a default value. The recommend
00248 use is keyword arguments as this is more robust to future message
00249 changes. You cannot mix in-order arguments and keyword arguments.
00250
00251 The available fields are:
00252 ok
00253
00254 :param args: complete set of field values, in .msg order
00255 :param kwds: use keyword arguments corresponding to message field names
00256 to set specific fields.
00257 """
00258 if args or kwds:
00259 super(SwitchControllerResponse, self).__init__(*args, **kwds)
00260
00261 if self.ok is None:
00262 self.ok = False
00263 else:
00264 self.ok = False
00265
00266 def _get_types(self):
00267 """
00268 internal API method
00269 """
00270 return self._slot_types
00271
00272 def serialize(self, buff):
00273 """
00274 serialize message into buffer
00275 :param buff: buffer, ``StringIO``
00276 """
00277 try:
00278 buff.write(_struct_B.pack(self.ok))
00279 except struct.error as se: self._check_types(se)
00280 except TypeError as te: self._check_types(te)
00281
00282 def deserialize(self, str):
00283 """
00284 unpack serialized message in str into this message instance
00285 :param str: byte array of serialized message, ``str``
00286 """
00287 try:
00288 end = 0
00289 start = end
00290 end += 1
00291 (self.ok,) = _struct_B.unpack(str[start:end])
00292 self.ok = bool(self.ok)
00293 return self
00294 except struct.error as e:
00295 raise genpy.DeserializationError(e)
00296
00297
00298 def serialize_numpy(self, buff, numpy):
00299 """
00300 serialize message with numpy array types into buffer
00301 :param buff: buffer, ``StringIO``
00302 :param numpy: numpy python module
00303 """
00304 try:
00305 buff.write(_struct_B.pack(self.ok))
00306 except struct.error as se: self._check_types(se)
00307 except TypeError as te: self._check_types(te)
00308
00309 def deserialize_numpy(self, str, numpy):
00310 """
00311 unpack serialized message in str into this message instance using numpy for array types
00312 :param str: byte array of serialized message, ``str``
00313 :param numpy: numpy python module
00314 """
00315 try:
00316 end = 0
00317 start = end
00318 end += 1
00319 (self.ok,) = _struct_B.unpack(str[start:end])
00320 self.ok = bool(self.ok)
00321 return self
00322 except struct.error as e:
00323 raise genpy.DeserializationError(e)
00324
00325 _struct_I = genpy.struct_I
00326 _struct_B = struct.Struct("<B")
00327 class SwitchController(object):
00328 _type = 'pr2_mechanism_msgs/SwitchController'
00329 _md5sum = '5e857dedf71d6f337975e15a1e7cfdd8'
00330 _request_class = SwitchControllerRequest
00331 _response_class = SwitchControllerResponse