00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_srvs/ServiceBasedMPCRequest.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 ServiceBasedMPCRequest(genpy.Message):
00009 _md5sum = "ff2d5410ce473a73156a5162cbdc78d0"
00010 _type = "hrl_haptic_manipulation_in_clutter_srvs/ServiceBasedMPCRequest"
00011 _has_header = False
00012 _full_text = """float64 alpha
00013 float64 beta
00014 float64 gamma
00015 float64[] delta_x_d
00016 float64[] J
00017 float64[] desired_force_decrease
00018 float64[] x_0
00019 float64[] KP_t_KP
00020 float64[] B
00021 float64[] q_min
00022 float64[] q_max
00023 float64[] f_min
00024 float64[] f_max
00025 float64[] n_K_ci_J_ci
00026 float64[] n_K_ci_J_ci_max
00027 float64[] u_min
00028 float64[] u_max
00029 float64[] Q
00030
00031 """
00032 __slots__ = ['alpha','beta','gamma','delta_x_d','J','desired_force_decrease','x_0','KP_t_KP','B','q_min','q_max','f_min','f_max','n_K_ci_J_ci','n_K_ci_J_ci_max','u_min','u_max','Q']
00033 _slot_types = ['float64','float64','float64','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]']
00034
00035 def __init__(self, *args, **kwds):
00036 """
00037 Constructor. Any message fields that are implicitly/explicitly
00038 set to None will be assigned a default value. The recommend
00039 use is keyword arguments as this is more robust to future message
00040 changes. You cannot mix in-order arguments and keyword arguments.
00041
00042 The available fields are:
00043 alpha,beta,gamma,delta_x_d,J,desired_force_decrease,x_0,KP_t_KP,B,q_min,q_max,f_min,f_max,n_K_ci_J_ci,n_K_ci_J_ci_max,u_min,u_max,Q
00044
00045 :param args: complete set of field values, in .msg order
00046 :param kwds: use keyword arguments corresponding to message field names
00047 to set specific fields.
00048 """
00049 if args or kwds:
00050 super(ServiceBasedMPCRequest, self).__init__(*args, **kwds)
00051
00052 if self.alpha is None:
00053 self.alpha = 0.
00054 if self.beta is None:
00055 self.beta = 0.
00056 if self.gamma is None:
00057 self.gamma = 0.
00058 if self.delta_x_d is None:
00059 self.delta_x_d = []
00060 if self.J is None:
00061 self.J = []
00062 if self.desired_force_decrease is None:
00063 self.desired_force_decrease = []
00064 if self.x_0 is None:
00065 self.x_0 = []
00066 if self.KP_t_KP is None:
00067 self.KP_t_KP = []
00068 if self.B is None:
00069 self.B = []
00070 if self.q_min is None:
00071 self.q_min = []
00072 if self.q_max is None:
00073 self.q_max = []
00074 if self.f_min is None:
00075 self.f_min = []
00076 if self.f_max is None:
00077 self.f_max = []
00078 if self.n_K_ci_J_ci is None:
00079 self.n_K_ci_J_ci = []
00080 if self.n_K_ci_J_ci_max is None:
00081 self.n_K_ci_J_ci_max = []
00082 if self.u_min is None:
00083 self.u_min = []
00084 if self.u_max is None:
00085 self.u_max = []
00086 if self.Q is None:
00087 self.Q = []
00088 else:
00089 self.alpha = 0.
00090 self.beta = 0.
00091 self.gamma = 0.
00092 self.delta_x_d = []
00093 self.J = []
00094 self.desired_force_decrease = []
00095 self.x_0 = []
00096 self.KP_t_KP = []
00097 self.B = []
00098 self.q_min = []
00099 self.q_max = []
00100 self.f_min = []
00101 self.f_max = []
00102 self.n_K_ci_J_ci = []
00103 self.n_K_ci_J_ci_max = []
00104 self.u_min = []
00105 self.u_max = []
00106 self.Q = []
00107
00108 def _get_types(self):
00109 """
00110 internal API method
00111 """
00112 return self._slot_types
00113
00114 def serialize(self, buff):
00115 """
00116 serialize message into buffer
00117 :param buff: buffer, ``StringIO``
00118 """
00119 try:
00120 _x = self
00121 buff.write(_struct_3d.pack(_x.alpha, _x.beta, _x.gamma))
00122 length = len(self.delta_x_d)
00123 buff.write(_struct_I.pack(length))
00124 pattern = '<%sd'%length
00125 buff.write(struct.pack(pattern, *self.delta_x_d))
00126 length = len(self.J)
00127 buff.write(_struct_I.pack(length))
00128 pattern = '<%sd'%length
00129 buff.write(struct.pack(pattern, *self.J))
00130 length = len(self.desired_force_decrease)
00131 buff.write(_struct_I.pack(length))
00132 pattern = '<%sd'%length
00133 buff.write(struct.pack(pattern, *self.desired_force_decrease))
00134 length = len(self.x_0)
00135 buff.write(_struct_I.pack(length))
00136 pattern = '<%sd'%length
00137 buff.write(struct.pack(pattern, *self.x_0))
00138 length = len(self.KP_t_KP)
00139 buff.write(_struct_I.pack(length))
00140 pattern = '<%sd'%length
00141 buff.write(struct.pack(pattern, *self.KP_t_KP))
00142 length = len(self.B)
00143 buff.write(_struct_I.pack(length))
00144 pattern = '<%sd'%length
00145 buff.write(struct.pack(pattern, *self.B))
00146 length = len(self.q_min)
00147 buff.write(_struct_I.pack(length))
00148 pattern = '<%sd'%length
00149 buff.write(struct.pack(pattern, *self.q_min))
00150 length = len(self.q_max)
00151 buff.write(_struct_I.pack(length))
00152 pattern = '<%sd'%length
00153 buff.write(struct.pack(pattern, *self.q_max))
00154 length = len(self.f_min)
00155 buff.write(_struct_I.pack(length))
00156 pattern = '<%sd'%length
00157 buff.write(struct.pack(pattern, *self.f_min))
00158 length = len(self.f_max)
00159 buff.write(_struct_I.pack(length))
00160 pattern = '<%sd'%length
00161 buff.write(struct.pack(pattern, *self.f_max))
00162 length = len(self.n_K_ci_J_ci)
00163 buff.write(_struct_I.pack(length))
00164 pattern = '<%sd'%length
00165 buff.write(struct.pack(pattern, *self.n_K_ci_J_ci))
00166 length = len(self.n_K_ci_J_ci_max)
00167 buff.write(_struct_I.pack(length))
00168 pattern = '<%sd'%length
00169 buff.write(struct.pack(pattern, *self.n_K_ci_J_ci_max))
00170 length = len(self.u_min)
00171 buff.write(_struct_I.pack(length))
00172 pattern = '<%sd'%length
00173 buff.write(struct.pack(pattern, *self.u_min))
00174 length = len(self.u_max)
00175 buff.write(_struct_I.pack(length))
00176 pattern = '<%sd'%length
00177 buff.write(struct.pack(pattern, *self.u_max))
00178 length = len(self.Q)
00179 buff.write(_struct_I.pack(length))
00180 pattern = '<%sd'%length
00181 buff.write(struct.pack(pattern, *self.Q))
00182 except struct.error as se: self._check_types(se)
00183 except TypeError as te: self._check_types(te)
00184
00185 def deserialize(self, str):
00186 """
00187 unpack serialized message in str into this message instance
00188 :param str: byte array of serialized message, ``str``
00189 """
00190 try:
00191 end = 0
00192 _x = self
00193 start = end
00194 end += 24
00195 (_x.alpha, _x.beta, _x.gamma,) = _struct_3d.unpack(str[start:end])
00196 start = end
00197 end += 4
00198 (length,) = _struct_I.unpack(str[start:end])
00199 pattern = '<%sd'%length
00200 start = end
00201 end += struct.calcsize(pattern)
00202 self.delta_x_d = struct.unpack(pattern, str[start:end])
00203 start = end
00204 end += 4
00205 (length,) = _struct_I.unpack(str[start:end])
00206 pattern = '<%sd'%length
00207 start = end
00208 end += struct.calcsize(pattern)
00209 self.J = struct.unpack(pattern, str[start:end])
00210 start = end
00211 end += 4
00212 (length,) = _struct_I.unpack(str[start:end])
00213 pattern = '<%sd'%length
00214 start = end
00215 end += struct.calcsize(pattern)
00216 self.desired_force_decrease = struct.unpack(pattern, str[start:end])
00217 start = end
00218 end += 4
00219 (length,) = _struct_I.unpack(str[start:end])
00220 pattern = '<%sd'%length
00221 start = end
00222 end += struct.calcsize(pattern)
00223 self.x_0 = struct.unpack(pattern, str[start:end])
00224 start = end
00225 end += 4
00226 (length,) = _struct_I.unpack(str[start:end])
00227 pattern = '<%sd'%length
00228 start = end
00229 end += struct.calcsize(pattern)
00230 self.KP_t_KP = struct.unpack(pattern, str[start:end])
00231 start = end
00232 end += 4
00233 (length,) = _struct_I.unpack(str[start:end])
00234 pattern = '<%sd'%length
00235 start = end
00236 end += struct.calcsize(pattern)
00237 self.B = struct.unpack(pattern, str[start:end])
00238 start = end
00239 end += 4
00240 (length,) = _struct_I.unpack(str[start:end])
00241 pattern = '<%sd'%length
00242 start = end
00243 end += struct.calcsize(pattern)
00244 self.q_min = struct.unpack(pattern, str[start:end])
00245 start = end
00246 end += 4
00247 (length,) = _struct_I.unpack(str[start:end])
00248 pattern = '<%sd'%length
00249 start = end
00250 end += struct.calcsize(pattern)
00251 self.q_max = struct.unpack(pattern, str[start:end])
00252 start = end
00253 end += 4
00254 (length,) = _struct_I.unpack(str[start:end])
00255 pattern = '<%sd'%length
00256 start = end
00257 end += struct.calcsize(pattern)
00258 self.f_min = struct.unpack(pattern, str[start:end])
00259 start = end
00260 end += 4
00261 (length,) = _struct_I.unpack(str[start:end])
00262 pattern = '<%sd'%length
00263 start = end
00264 end += struct.calcsize(pattern)
00265 self.f_max = struct.unpack(pattern, str[start:end])
00266 start = end
00267 end += 4
00268 (length,) = _struct_I.unpack(str[start:end])
00269 pattern = '<%sd'%length
00270 start = end
00271 end += struct.calcsize(pattern)
00272 self.n_K_ci_J_ci = struct.unpack(pattern, str[start:end])
00273 start = end
00274 end += 4
00275 (length,) = _struct_I.unpack(str[start:end])
00276 pattern = '<%sd'%length
00277 start = end
00278 end += struct.calcsize(pattern)
00279 self.n_K_ci_J_ci_max = struct.unpack(pattern, str[start:end])
00280 start = end
00281 end += 4
00282 (length,) = _struct_I.unpack(str[start:end])
00283 pattern = '<%sd'%length
00284 start = end
00285 end += struct.calcsize(pattern)
00286 self.u_min = struct.unpack(pattern, str[start:end])
00287 start = end
00288 end += 4
00289 (length,) = _struct_I.unpack(str[start:end])
00290 pattern = '<%sd'%length
00291 start = end
00292 end += struct.calcsize(pattern)
00293 self.u_max = struct.unpack(pattern, str[start:end])
00294 start = end
00295 end += 4
00296 (length,) = _struct_I.unpack(str[start:end])
00297 pattern = '<%sd'%length
00298 start = end
00299 end += struct.calcsize(pattern)
00300 self.Q = struct.unpack(pattern, str[start:end])
00301 return self
00302 except struct.error as e:
00303 raise genpy.DeserializationError(e)
00304
00305
00306 def serialize_numpy(self, buff, numpy):
00307 """
00308 serialize message with numpy array types into buffer
00309 :param buff: buffer, ``StringIO``
00310 :param numpy: numpy python module
00311 """
00312 try:
00313 _x = self
00314 buff.write(_struct_3d.pack(_x.alpha, _x.beta, _x.gamma))
00315 length = len(self.delta_x_d)
00316 buff.write(_struct_I.pack(length))
00317 pattern = '<%sd'%length
00318 buff.write(self.delta_x_d.tostring())
00319 length = len(self.J)
00320 buff.write(_struct_I.pack(length))
00321 pattern = '<%sd'%length
00322 buff.write(self.J.tostring())
00323 length = len(self.desired_force_decrease)
00324 buff.write(_struct_I.pack(length))
00325 pattern = '<%sd'%length
00326 buff.write(self.desired_force_decrease.tostring())
00327 length = len(self.x_0)
00328 buff.write(_struct_I.pack(length))
00329 pattern = '<%sd'%length
00330 buff.write(self.x_0.tostring())
00331 length = len(self.KP_t_KP)
00332 buff.write(_struct_I.pack(length))
00333 pattern = '<%sd'%length
00334 buff.write(self.KP_t_KP.tostring())
00335 length = len(self.B)
00336 buff.write(_struct_I.pack(length))
00337 pattern = '<%sd'%length
00338 buff.write(self.B.tostring())
00339 length = len(self.q_min)
00340 buff.write(_struct_I.pack(length))
00341 pattern = '<%sd'%length
00342 buff.write(self.q_min.tostring())
00343 length = len(self.q_max)
00344 buff.write(_struct_I.pack(length))
00345 pattern = '<%sd'%length
00346 buff.write(self.q_max.tostring())
00347 length = len(self.f_min)
00348 buff.write(_struct_I.pack(length))
00349 pattern = '<%sd'%length
00350 buff.write(self.f_min.tostring())
00351 length = len(self.f_max)
00352 buff.write(_struct_I.pack(length))
00353 pattern = '<%sd'%length
00354 buff.write(self.f_max.tostring())
00355 length = len(self.n_K_ci_J_ci)
00356 buff.write(_struct_I.pack(length))
00357 pattern = '<%sd'%length
00358 buff.write(self.n_K_ci_J_ci.tostring())
00359 length = len(self.n_K_ci_J_ci_max)
00360 buff.write(_struct_I.pack(length))
00361 pattern = '<%sd'%length
00362 buff.write(self.n_K_ci_J_ci_max.tostring())
00363 length = len(self.u_min)
00364 buff.write(_struct_I.pack(length))
00365 pattern = '<%sd'%length
00366 buff.write(self.u_min.tostring())
00367 length = len(self.u_max)
00368 buff.write(_struct_I.pack(length))
00369 pattern = '<%sd'%length
00370 buff.write(self.u_max.tostring())
00371 length = len(self.Q)
00372 buff.write(_struct_I.pack(length))
00373 pattern = '<%sd'%length
00374 buff.write(self.Q.tostring())
00375 except struct.error as se: self._check_types(se)
00376 except TypeError as te: self._check_types(te)
00377
00378 def deserialize_numpy(self, str, numpy):
00379 """
00380 unpack serialized message in str into this message instance using numpy for array types
00381 :param str: byte array of serialized message, ``str``
00382 :param numpy: numpy python module
00383 """
00384 try:
00385 end = 0
00386 _x = self
00387 start = end
00388 end += 24
00389 (_x.alpha, _x.beta, _x.gamma,) = _struct_3d.unpack(str[start:end])
00390 start = end
00391 end += 4
00392 (length,) = _struct_I.unpack(str[start:end])
00393 pattern = '<%sd'%length
00394 start = end
00395 end += struct.calcsize(pattern)
00396 self.delta_x_d = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00397 start = end
00398 end += 4
00399 (length,) = _struct_I.unpack(str[start:end])
00400 pattern = '<%sd'%length
00401 start = end
00402 end += struct.calcsize(pattern)
00403 self.J = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00404 start = end
00405 end += 4
00406 (length,) = _struct_I.unpack(str[start:end])
00407 pattern = '<%sd'%length
00408 start = end
00409 end += struct.calcsize(pattern)
00410 self.desired_force_decrease = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00411 start = end
00412 end += 4
00413 (length,) = _struct_I.unpack(str[start:end])
00414 pattern = '<%sd'%length
00415 start = end
00416 end += struct.calcsize(pattern)
00417 self.x_0 = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00418 start = end
00419 end += 4
00420 (length,) = _struct_I.unpack(str[start:end])
00421 pattern = '<%sd'%length
00422 start = end
00423 end += struct.calcsize(pattern)
00424 self.KP_t_KP = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00425 start = end
00426 end += 4
00427 (length,) = _struct_I.unpack(str[start:end])
00428 pattern = '<%sd'%length
00429 start = end
00430 end += struct.calcsize(pattern)
00431 self.B = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00432 start = end
00433 end += 4
00434 (length,) = _struct_I.unpack(str[start:end])
00435 pattern = '<%sd'%length
00436 start = end
00437 end += struct.calcsize(pattern)
00438 self.q_min = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00439 start = end
00440 end += 4
00441 (length,) = _struct_I.unpack(str[start:end])
00442 pattern = '<%sd'%length
00443 start = end
00444 end += struct.calcsize(pattern)
00445 self.q_max = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00446 start = end
00447 end += 4
00448 (length,) = _struct_I.unpack(str[start:end])
00449 pattern = '<%sd'%length
00450 start = end
00451 end += struct.calcsize(pattern)
00452 self.f_min = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00453 start = end
00454 end += 4
00455 (length,) = _struct_I.unpack(str[start:end])
00456 pattern = '<%sd'%length
00457 start = end
00458 end += struct.calcsize(pattern)
00459 self.f_max = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00460 start = end
00461 end += 4
00462 (length,) = _struct_I.unpack(str[start:end])
00463 pattern = '<%sd'%length
00464 start = end
00465 end += struct.calcsize(pattern)
00466 self.n_K_ci_J_ci = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00467 start = end
00468 end += 4
00469 (length,) = _struct_I.unpack(str[start:end])
00470 pattern = '<%sd'%length
00471 start = end
00472 end += struct.calcsize(pattern)
00473 self.n_K_ci_J_ci_max = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00474 start = end
00475 end += 4
00476 (length,) = _struct_I.unpack(str[start:end])
00477 pattern = '<%sd'%length
00478 start = end
00479 end += struct.calcsize(pattern)
00480 self.u_min = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00481 start = end
00482 end += 4
00483 (length,) = _struct_I.unpack(str[start:end])
00484 pattern = '<%sd'%length
00485 start = end
00486 end += struct.calcsize(pattern)
00487 self.u_max = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00488 start = end
00489 end += 4
00490 (length,) = _struct_I.unpack(str[start:end])
00491 pattern = '<%sd'%length
00492 start = end
00493 end += struct.calcsize(pattern)
00494 self.Q = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00495 return self
00496 except struct.error as e:
00497 raise genpy.DeserializationError(e)
00498
00499 _struct_I = genpy.struct_I
00500 _struct_3d = struct.Struct("<3d")
00501 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_srvs/ServiceBasedMPCResponse.msg. Do not edit."""
00502 import sys
00503 python3 = True if sys.hexversion > 0x03000000 else False
00504 import genpy
00505 import struct
00506
00507
00508 class ServiceBasedMPCResponse(genpy.Message):
00509 _md5sum = "00475d6b4b4fc3a6b932afa7b8502db3"
00510 _type = "hrl_haptic_manipulation_in_clutter_srvs/ServiceBasedMPCResponse"
00511 _has_header = False
00512 _full_text = """float64[7] delta_phi_opt
00513 float64[7] predicted_joint_angles
00514
00515
00516
00517
00518
00519
00520 """
00521 __slots__ = ['delta_phi_opt','predicted_joint_angles']
00522 _slot_types = ['float64[7]','float64[7]']
00523
00524 def __init__(self, *args, **kwds):
00525 """
00526 Constructor. Any message fields that are implicitly/explicitly
00527 set to None will be assigned a default value. The recommend
00528 use is keyword arguments as this is more robust to future message
00529 changes. You cannot mix in-order arguments and keyword arguments.
00530
00531 The available fields are:
00532 delta_phi_opt,predicted_joint_angles
00533
00534 :param args: complete set of field values, in .msg order
00535 :param kwds: use keyword arguments corresponding to message field names
00536 to set specific fields.
00537 """
00538 if args or kwds:
00539 super(ServiceBasedMPCResponse, self).__init__(*args, **kwds)
00540
00541 if self.delta_phi_opt is None:
00542 self.delta_phi_opt = [0.,0.,0.,0.,0.,0.,0.]
00543 if self.predicted_joint_angles is None:
00544 self.predicted_joint_angles = [0.,0.,0.,0.,0.,0.,0.]
00545 else:
00546 self.delta_phi_opt = [0.,0.,0.,0.,0.,0.,0.]
00547 self.predicted_joint_angles = [0.,0.,0.,0.,0.,0.,0.]
00548
00549 def _get_types(self):
00550 """
00551 internal API method
00552 """
00553 return self._slot_types
00554
00555 def serialize(self, buff):
00556 """
00557 serialize message into buffer
00558 :param buff: buffer, ``StringIO``
00559 """
00560 try:
00561 buff.write(_struct_7d.pack(*self.delta_phi_opt))
00562 buff.write(_struct_7d.pack(*self.predicted_joint_angles))
00563 except struct.error as se: self._check_types(se)
00564 except TypeError as te: self._check_types(te)
00565
00566 def deserialize(self, str):
00567 """
00568 unpack serialized message in str into this message instance
00569 :param str: byte array of serialized message, ``str``
00570 """
00571 try:
00572 end = 0
00573 start = end
00574 end += 56
00575 self.delta_phi_opt = _struct_7d.unpack(str[start:end])
00576 start = end
00577 end += 56
00578 self.predicted_joint_angles = _struct_7d.unpack(str[start:end])
00579 return self
00580 except struct.error as e:
00581 raise genpy.DeserializationError(e)
00582
00583
00584 def serialize_numpy(self, buff, numpy):
00585 """
00586 serialize message with numpy array types into buffer
00587 :param buff: buffer, ``StringIO``
00588 :param numpy: numpy python module
00589 """
00590 try:
00591 buff.write(self.delta_phi_opt.tostring())
00592 buff.write(self.predicted_joint_angles.tostring())
00593 except struct.error as se: self._check_types(se)
00594 except TypeError as te: self._check_types(te)
00595
00596 def deserialize_numpy(self, str, numpy):
00597 """
00598 unpack serialized message in str into this message instance using numpy for array types
00599 :param str: byte array of serialized message, ``str``
00600 :param numpy: numpy python module
00601 """
00602 try:
00603 end = 0
00604 start = end
00605 end += 56
00606 self.delta_phi_opt = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=7)
00607 start = end
00608 end += 56
00609 self.predicted_joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=7)
00610 return self
00611 except struct.error as e:
00612 raise genpy.DeserializationError(e)
00613
00614 _struct_I = genpy.struct_I
00615 _struct_7d = struct.Struct("<7d")
00616 class ServiceBasedMPC(object):
00617 _type = 'hrl_haptic_manipulation_in_clutter_srvs/ServiceBasedMPC'
00618 _md5sum = '67c7bceb584229e1de3a6ec4552d4994'
00619 _request_class = ServiceBasedMPCRequest
00620 _response_class = ServiceBasedMPCResponse