_MPC_FormattedData.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_msgs/MPC_FormattedData.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import std_msgs.msg
00008 
00009 class MPC_FormattedData(genpy.Message):
00010   _md5sum = "35ec73a5af9869a7ed35470b92764e75"
00011   _type = "hrl_haptic_manipulation_in_clutter_msgs/MPC_FormattedData"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 
00015 float64 alpha
00016 float64 beta
00017 float64 gamma
00018 float64[] delta_x_d
00019 float64[] J
00020 float64[] desired_dist_increase
00021 float64[] x_0
00022 float64[] KP_t_KP
00023 float64[] q_min
00024 float64[] q_max
00025 float64[] dist_min
00026 float64[] dist_max
00027 float64[] n_J_ci
00028 float64[] n_J_ci_max
00029 float64[] u_min
00030 float64[] u_max
00031 float64[] Q
00032 
00033 
00034 
00035 
00036 
00037 ================================================================================
00038 MSG: std_msgs/Header
00039 # Standard metadata for higher-level stamped data types.
00040 # This is generally used to communicate timestamped data 
00041 # in a particular coordinate frame.
00042 # 
00043 # sequence ID: consecutively increasing ID 
00044 uint32 seq
00045 #Two-integer timestamp that is expressed as:
00046 # * stamp.secs: seconds (stamp_secs) since epoch
00047 # * stamp.nsecs: nanoseconds since stamp_secs
00048 # time-handling sugar is provided by the client library
00049 time stamp
00050 #Frame this data is associated with
00051 # 0: no frame
00052 # 1: global frame
00053 string frame_id
00054 
00055 """
00056   __slots__ = ['header','alpha','beta','gamma','delta_x_d','J','desired_dist_increase','x_0','KP_t_KP','q_min','q_max','dist_min','dist_max','n_J_ci','n_J_ci_max','u_min','u_max','Q']
00057   _slot_types = ['std_msgs/Header','float64','float64','float64','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]']
00058 
00059   def __init__(self, *args, **kwds):
00060     """
00061     Constructor. Any message fields that are implicitly/explicitly
00062     set to None will be assigned a default value. The recommend
00063     use is keyword arguments as this is more robust to future message
00064     changes.  You cannot mix in-order arguments and keyword arguments.
00065 
00066     The available fields are:
00067        header,alpha,beta,gamma,delta_x_d,J,desired_dist_increase,x_0,KP_t_KP,q_min,q_max,dist_min,dist_max,n_J_ci,n_J_ci_max,u_min,u_max,Q
00068 
00069     :param args: complete set of field values, in .msg order
00070     :param kwds: use keyword arguments corresponding to message field names
00071     to set specific fields.
00072     """
00073     if args or kwds:
00074       super(MPC_FormattedData, self).__init__(*args, **kwds)
00075       #message fields cannot be None, assign default values for those that are
00076       if self.header is None:
00077         self.header = std_msgs.msg.Header()
00078       if self.alpha is None:
00079         self.alpha = 0.
00080       if self.beta is None:
00081         self.beta = 0.
00082       if self.gamma is None:
00083         self.gamma = 0.
00084       if self.delta_x_d is None:
00085         self.delta_x_d = []
00086       if self.J is None:
00087         self.J = []
00088       if self.desired_dist_increase is None:
00089         self.desired_dist_increase = []
00090       if self.x_0 is None:
00091         self.x_0 = []
00092       if self.KP_t_KP is None:
00093         self.KP_t_KP = []
00094       if self.q_min is None:
00095         self.q_min = []
00096       if self.q_max is None:
00097         self.q_max = []
00098       if self.dist_min is None:
00099         self.dist_min = []
00100       if self.dist_max is None:
00101         self.dist_max = []
00102       if self.n_J_ci is None:
00103         self.n_J_ci = []
00104       if self.n_J_ci_max is None:
00105         self.n_J_ci_max = []
00106       if self.u_min is None:
00107         self.u_min = []
00108       if self.u_max is None:
00109         self.u_max = []
00110       if self.Q is None:
00111         self.Q = []
00112     else:
00113       self.header = std_msgs.msg.Header()
00114       self.alpha = 0.
00115       self.beta = 0.
00116       self.gamma = 0.
00117       self.delta_x_d = []
00118       self.J = []
00119       self.desired_dist_increase = []
00120       self.x_0 = []
00121       self.KP_t_KP = []
00122       self.q_min = []
00123       self.q_max = []
00124       self.dist_min = []
00125       self.dist_max = []
00126       self.n_J_ci = []
00127       self.n_J_ci_max = []
00128       self.u_min = []
00129       self.u_max = []
00130       self.Q = []
00131 
00132   def _get_types(self):
00133     """
00134     internal API method
00135     """
00136     return self._slot_types
00137 
00138   def serialize(self, buff):
00139     """
00140     serialize message into buffer
00141     :param buff: buffer, ``StringIO``
00142     """
00143     try:
00144       _x = self
00145       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00146       _x = self.header.frame_id
00147       length = len(_x)
00148       if python3 or type(_x) == unicode:
00149         _x = _x.encode('utf-8')
00150         length = len(_x)
00151       buff.write(struct.pack('<I%ss'%length, length, _x))
00152       _x = self
00153       buff.write(_struct_3d.pack(_x.alpha, _x.beta, _x.gamma))
00154       length = len(self.delta_x_d)
00155       buff.write(_struct_I.pack(length))
00156       pattern = '<%sd'%length
00157       buff.write(struct.pack(pattern, *self.delta_x_d))
00158       length = len(self.J)
00159       buff.write(_struct_I.pack(length))
00160       pattern = '<%sd'%length
00161       buff.write(struct.pack(pattern, *self.J))
00162       length = len(self.desired_dist_increase)
00163       buff.write(_struct_I.pack(length))
00164       pattern = '<%sd'%length
00165       buff.write(struct.pack(pattern, *self.desired_dist_increase))
00166       length = len(self.x_0)
00167       buff.write(_struct_I.pack(length))
00168       pattern = '<%sd'%length
00169       buff.write(struct.pack(pattern, *self.x_0))
00170       length = len(self.KP_t_KP)
00171       buff.write(_struct_I.pack(length))
00172       pattern = '<%sd'%length
00173       buff.write(struct.pack(pattern, *self.KP_t_KP))
00174       length = len(self.q_min)
00175       buff.write(_struct_I.pack(length))
00176       pattern = '<%sd'%length
00177       buff.write(struct.pack(pattern, *self.q_min))
00178       length = len(self.q_max)
00179       buff.write(_struct_I.pack(length))
00180       pattern = '<%sd'%length
00181       buff.write(struct.pack(pattern, *self.q_max))
00182       length = len(self.dist_min)
00183       buff.write(_struct_I.pack(length))
00184       pattern = '<%sd'%length
00185       buff.write(struct.pack(pattern, *self.dist_min))
00186       length = len(self.dist_max)
00187       buff.write(_struct_I.pack(length))
00188       pattern = '<%sd'%length
00189       buff.write(struct.pack(pattern, *self.dist_max))
00190       length = len(self.n_J_ci)
00191       buff.write(_struct_I.pack(length))
00192       pattern = '<%sd'%length
00193       buff.write(struct.pack(pattern, *self.n_J_ci))
00194       length = len(self.n_J_ci_max)
00195       buff.write(_struct_I.pack(length))
00196       pattern = '<%sd'%length
00197       buff.write(struct.pack(pattern, *self.n_J_ci_max))
00198       length = len(self.u_min)
00199       buff.write(_struct_I.pack(length))
00200       pattern = '<%sd'%length
00201       buff.write(struct.pack(pattern, *self.u_min))
00202       length = len(self.u_max)
00203       buff.write(_struct_I.pack(length))
00204       pattern = '<%sd'%length
00205       buff.write(struct.pack(pattern, *self.u_max))
00206       length = len(self.Q)
00207       buff.write(_struct_I.pack(length))
00208       pattern = '<%sd'%length
00209       buff.write(struct.pack(pattern, *self.Q))
00210     except struct.error as se: self._check_types(se)
00211     except TypeError as te: self._check_types(te)
00212 
00213   def deserialize(self, str):
00214     """
00215     unpack serialized message in str into this message instance
00216     :param str: byte array of serialized message, ``str``
00217     """
00218     try:
00219       if self.header is None:
00220         self.header = std_msgs.msg.Header()
00221       end = 0
00222       _x = self
00223       start = end
00224       end += 12
00225       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00226       start = end
00227       end += 4
00228       (length,) = _struct_I.unpack(str[start:end])
00229       start = end
00230       end += length
00231       if python3:
00232         self.header.frame_id = str[start:end].decode('utf-8')
00233       else:
00234         self.header.frame_id = str[start:end]
00235       _x = self
00236       start = end
00237       end += 24
00238       (_x.alpha, _x.beta, _x.gamma,) = _struct_3d.unpack(str[start:end])
00239       start = end
00240       end += 4
00241       (length,) = _struct_I.unpack(str[start:end])
00242       pattern = '<%sd'%length
00243       start = end
00244       end += struct.calcsize(pattern)
00245       self.delta_x_d = struct.unpack(pattern, str[start:end])
00246       start = end
00247       end += 4
00248       (length,) = _struct_I.unpack(str[start:end])
00249       pattern = '<%sd'%length
00250       start = end
00251       end += struct.calcsize(pattern)
00252       self.J = struct.unpack(pattern, str[start:end])
00253       start = end
00254       end += 4
00255       (length,) = _struct_I.unpack(str[start:end])
00256       pattern = '<%sd'%length
00257       start = end
00258       end += struct.calcsize(pattern)
00259       self.desired_dist_increase = struct.unpack(pattern, str[start:end])
00260       start = end
00261       end += 4
00262       (length,) = _struct_I.unpack(str[start:end])
00263       pattern = '<%sd'%length
00264       start = end
00265       end += struct.calcsize(pattern)
00266       self.x_0 = struct.unpack(pattern, str[start:end])
00267       start = end
00268       end += 4
00269       (length,) = _struct_I.unpack(str[start:end])
00270       pattern = '<%sd'%length
00271       start = end
00272       end += struct.calcsize(pattern)
00273       self.KP_t_KP = struct.unpack(pattern, str[start:end])
00274       start = end
00275       end += 4
00276       (length,) = _struct_I.unpack(str[start:end])
00277       pattern = '<%sd'%length
00278       start = end
00279       end += struct.calcsize(pattern)
00280       self.q_min = struct.unpack(pattern, str[start:end])
00281       start = end
00282       end += 4
00283       (length,) = _struct_I.unpack(str[start:end])
00284       pattern = '<%sd'%length
00285       start = end
00286       end += struct.calcsize(pattern)
00287       self.q_max = struct.unpack(pattern, str[start:end])
00288       start = end
00289       end += 4
00290       (length,) = _struct_I.unpack(str[start:end])
00291       pattern = '<%sd'%length
00292       start = end
00293       end += struct.calcsize(pattern)
00294       self.dist_min = struct.unpack(pattern, str[start:end])
00295       start = end
00296       end += 4
00297       (length,) = _struct_I.unpack(str[start:end])
00298       pattern = '<%sd'%length
00299       start = end
00300       end += struct.calcsize(pattern)
00301       self.dist_max = struct.unpack(pattern, str[start:end])
00302       start = end
00303       end += 4
00304       (length,) = _struct_I.unpack(str[start:end])
00305       pattern = '<%sd'%length
00306       start = end
00307       end += struct.calcsize(pattern)
00308       self.n_J_ci = struct.unpack(pattern, str[start:end])
00309       start = end
00310       end += 4
00311       (length,) = _struct_I.unpack(str[start:end])
00312       pattern = '<%sd'%length
00313       start = end
00314       end += struct.calcsize(pattern)
00315       self.n_J_ci_max = struct.unpack(pattern, str[start:end])
00316       start = end
00317       end += 4
00318       (length,) = _struct_I.unpack(str[start:end])
00319       pattern = '<%sd'%length
00320       start = end
00321       end += struct.calcsize(pattern)
00322       self.u_min = struct.unpack(pattern, str[start:end])
00323       start = end
00324       end += 4
00325       (length,) = _struct_I.unpack(str[start:end])
00326       pattern = '<%sd'%length
00327       start = end
00328       end += struct.calcsize(pattern)
00329       self.u_max = struct.unpack(pattern, str[start:end])
00330       start = end
00331       end += 4
00332       (length,) = _struct_I.unpack(str[start:end])
00333       pattern = '<%sd'%length
00334       start = end
00335       end += struct.calcsize(pattern)
00336       self.Q = struct.unpack(pattern, str[start:end])
00337       return self
00338     except struct.error as e:
00339       raise genpy.DeserializationError(e) #most likely buffer underfill
00340 
00341 
00342   def serialize_numpy(self, buff, numpy):
00343     """
00344     serialize message with numpy array types into buffer
00345     :param buff: buffer, ``StringIO``
00346     :param numpy: numpy python module
00347     """
00348     try:
00349       _x = self
00350       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00351       _x = self.header.frame_id
00352       length = len(_x)
00353       if python3 or type(_x) == unicode:
00354         _x = _x.encode('utf-8')
00355         length = len(_x)
00356       buff.write(struct.pack('<I%ss'%length, length, _x))
00357       _x = self
00358       buff.write(_struct_3d.pack(_x.alpha, _x.beta, _x.gamma))
00359       length = len(self.delta_x_d)
00360       buff.write(_struct_I.pack(length))
00361       pattern = '<%sd'%length
00362       buff.write(self.delta_x_d.tostring())
00363       length = len(self.J)
00364       buff.write(_struct_I.pack(length))
00365       pattern = '<%sd'%length
00366       buff.write(self.J.tostring())
00367       length = len(self.desired_dist_increase)
00368       buff.write(_struct_I.pack(length))
00369       pattern = '<%sd'%length
00370       buff.write(self.desired_dist_increase.tostring())
00371       length = len(self.x_0)
00372       buff.write(_struct_I.pack(length))
00373       pattern = '<%sd'%length
00374       buff.write(self.x_0.tostring())
00375       length = len(self.KP_t_KP)
00376       buff.write(_struct_I.pack(length))
00377       pattern = '<%sd'%length
00378       buff.write(self.KP_t_KP.tostring())
00379       length = len(self.q_min)
00380       buff.write(_struct_I.pack(length))
00381       pattern = '<%sd'%length
00382       buff.write(self.q_min.tostring())
00383       length = len(self.q_max)
00384       buff.write(_struct_I.pack(length))
00385       pattern = '<%sd'%length
00386       buff.write(self.q_max.tostring())
00387       length = len(self.dist_min)
00388       buff.write(_struct_I.pack(length))
00389       pattern = '<%sd'%length
00390       buff.write(self.dist_min.tostring())
00391       length = len(self.dist_max)
00392       buff.write(_struct_I.pack(length))
00393       pattern = '<%sd'%length
00394       buff.write(self.dist_max.tostring())
00395       length = len(self.n_J_ci)
00396       buff.write(_struct_I.pack(length))
00397       pattern = '<%sd'%length
00398       buff.write(self.n_J_ci.tostring())
00399       length = len(self.n_J_ci_max)
00400       buff.write(_struct_I.pack(length))
00401       pattern = '<%sd'%length
00402       buff.write(self.n_J_ci_max.tostring())
00403       length = len(self.u_min)
00404       buff.write(_struct_I.pack(length))
00405       pattern = '<%sd'%length
00406       buff.write(self.u_min.tostring())
00407       length = len(self.u_max)
00408       buff.write(_struct_I.pack(length))
00409       pattern = '<%sd'%length
00410       buff.write(self.u_max.tostring())
00411       length = len(self.Q)
00412       buff.write(_struct_I.pack(length))
00413       pattern = '<%sd'%length
00414       buff.write(self.Q.tostring())
00415     except struct.error as se: self._check_types(se)
00416     except TypeError as te: self._check_types(te)
00417 
00418   def deserialize_numpy(self, str, numpy):
00419     """
00420     unpack serialized message in str into this message instance using numpy for array types
00421     :param str: byte array of serialized message, ``str``
00422     :param numpy: numpy python module
00423     """
00424     try:
00425       if self.header is None:
00426         self.header = std_msgs.msg.Header()
00427       end = 0
00428       _x = self
00429       start = end
00430       end += 12
00431       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00432       start = end
00433       end += 4
00434       (length,) = _struct_I.unpack(str[start:end])
00435       start = end
00436       end += length
00437       if python3:
00438         self.header.frame_id = str[start:end].decode('utf-8')
00439       else:
00440         self.header.frame_id = str[start:end]
00441       _x = self
00442       start = end
00443       end += 24
00444       (_x.alpha, _x.beta, _x.gamma,) = _struct_3d.unpack(str[start:end])
00445       start = end
00446       end += 4
00447       (length,) = _struct_I.unpack(str[start:end])
00448       pattern = '<%sd'%length
00449       start = end
00450       end += struct.calcsize(pattern)
00451       self.delta_x_d = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00452       start = end
00453       end += 4
00454       (length,) = _struct_I.unpack(str[start:end])
00455       pattern = '<%sd'%length
00456       start = end
00457       end += struct.calcsize(pattern)
00458       self.J = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00459       start = end
00460       end += 4
00461       (length,) = _struct_I.unpack(str[start:end])
00462       pattern = '<%sd'%length
00463       start = end
00464       end += struct.calcsize(pattern)
00465       self.desired_dist_increase = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00466       start = end
00467       end += 4
00468       (length,) = _struct_I.unpack(str[start:end])
00469       pattern = '<%sd'%length
00470       start = end
00471       end += struct.calcsize(pattern)
00472       self.x_0 = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00473       start = end
00474       end += 4
00475       (length,) = _struct_I.unpack(str[start:end])
00476       pattern = '<%sd'%length
00477       start = end
00478       end += struct.calcsize(pattern)
00479       self.KP_t_KP = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00480       start = end
00481       end += 4
00482       (length,) = _struct_I.unpack(str[start:end])
00483       pattern = '<%sd'%length
00484       start = end
00485       end += struct.calcsize(pattern)
00486       self.q_min = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00487       start = end
00488       end += 4
00489       (length,) = _struct_I.unpack(str[start:end])
00490       pattern = '<%sd'%length
00491       start = end
00492       end += struct.calcsize(pattern)
00493       self.q_max = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00494       start = end
00495       end += 4
00496       (length,) = _struct_I.unpack(str[start:end])
00497       pattern = '<%sd'%length
00498       start = end
00499       end += struct.calcsize(pattern)
00500       self.dist_min = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00501       start = end
00502       end += 4
00503       (length,) = _struct_I.unpack(str[start:end])
00504       pattern = '<%sd'%length
00505       start = end
00506       end += struct.calcsize(pattern)
00507       self.dist_max = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00508       start = end
00509       end += 4
00510       (length,) = _struct_I.unpack(str[start:end])
00511       pattern = '<%sd'%length
00512       start = end
00513       end += struct.calcsize(pattern)
00514       self.n_J_ci = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00515       start = end
00516       end += 4
00517       (length,) = _struct_I.unpack(str[start:end])
00518       pattern = '<%sd'%length
00519       start = end
00520       end += struct.calcsize(pattern)
00521       self.n_J_ci_max = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00522       start = end
00523       end += 4
00524       (length,) = _struct_I.unpack(str[start:end])
00525       pattern = '<%sd'%length
00526       start = end
00527       end += struct.calcsize(pattern)
00528       self.u_min = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00529       start = end
00530       end += 4
00531       (length,) = _struct_I.unpack(str[start:end])
00532       pattern = '<%sd'%length
00533       start = end
00534       end += struct.calcsize(pattern)
00535       self.u_max = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00536       start = end
00537       end += 4
00538       (length,) = _struct_I.unpack(str[start:end])
00539       pattern = '<%sd'%length
00540       start = end
00541       end += struct.calcsize(pattern)
00542       self.Q = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00543       return self
00544     except struct.error as e:
00545       raise genpy.DeserializationError(e) #most likely buffer underfill
00546 
00547 _struct_I = genpy.struct_I
00548 _struct_3I = struct.Struct("<3I")
00549 _struct_3d = struct.Struct("<3d")


hrl_haptic_manipulation_in_clutter_msgs
Author(s): Advait Jain, Marc Killpack, Jeff Hawke. Advisor: Prof. Charlie Kemp. Healthcare Robotics Lab, Georgia Tech.
autogenerated on Wed Nov 27 2013 11:33:37