_JtsDraw.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_msgs/JtsDraw.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 hrl_msgs.msg
00008 import std_msgs.msg
00009 
00010 class JtsDraw(genpy.Message):
00011   _md5sum = "036605f672c92bf6e863fc5c9347b3d5"
00012   _type = "hrl_haptic_manipulation_in_clutter_msgs/JtsDraw"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 
00016 hrl_msgs/FloatArrayBare[] jt_loc
00017 hrl_msgs/FloatArrayBare act_jts
00018 bool[] constr_jts
00019 
00020 
00021 
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data 
00026 # in a particular coordinate frame.
00027 # 
00028 # sequence ID: consecutively increasing ID 
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039 
00040 ================================================================================
00041 MSG: hrl_msgs/FloatArrayBare
00042 float64[] data
00043 
00044 
00045 """
00046   __slots__ = ['header','jt_loc','act_jts','constr_jts']
00047   _slot_types = ['std_msgs/Header','hrl_msgs/FloatArrayBare[]','hrl_msgs/FloatArrayBare','bool[]']
00048 
00049   def __init__(self, *args, **kwds):
00050     """
00051     Constructor. Any message fields that are implicitly/explicitly
00052     set to None will be assigned a default value. The recommend
00053     use is keyword arguments as this is more robust to future message
00054     changes.  You cannot mix in-order arguments and keyword arguments.
00055 
00056     The available fields are:
00057        header,jt_loc,act_jts,constr_jts
00058 
00059     :param args: complete set of field values, in .msg order
00060     :param kwds: use keyword arguments corresponding to message field names
00061     to set specific fields.
00062     """
00063     if args or kwds:
00064       super(JtsDraw, self).__init__(*args, **kwds)
00065       #message fields cannot be None, assign default values for those that are
00066       if self.header is None:
00067         self.header = std_msgs.msg.Header()
00068       if self.jt_loc is None:
00069         self.jt_loc = []
00070       if self.act_jts is None:
00071         self.act_jts = hrl_msgs.msg.FloatArrayBare()
00072       if self.constr_jts is None:
00073         self.constr_jts = []
00074     else:
00075       self.header = std_msgs.msg.Header()
00076       self.jt_loc = []
00077       self.act_jts = hrl_msgs.msg.FloatArrayBare()
00078       self.constr_jts = []
00079 
00080   def _get_types(self):
00081     """
00082     internal API method
00083     """
00084     return self._slot_types
00085 
00086   def serialize(self, buff):
00087     """
00088     serialize message into buffer
00089     :param buff: buffer, ``StringIO``
00090     """
00091     try:
00092       _x = self
00093       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00094       _x = self.header.frame_id
00095       length = len(_x)
00096       if python3 or type(_x) == unicode:
00097         _x = _x.encode('utf-8')
00098         length = len(_x)
00099       buff.write(struct.pack('<I%ss'%length, length, _x))
00100       length = len(self.jt_loc)
00101       buff.write(_struct_I.pack(length))
00102       for val1 in self.jt_loc:
00103         length = len(val1.data)
00104         buff.write(_struct_I.pack(length))
00105         pattern = '<%sd'%length
00106         buff.write(struct.pack(pattern, *val1.data))
00107       length = len(self.act_jts.data)
00108       buff.write(_struct_I.pack(length))
00109       pattern = '<%sd'%length
00110       buff.write(struct.pack(pattern, *self.act_jts.data))
00111       length = len(self.constr_jts)
00112       buff.write(_struct_I.pack(length))
00113       pattern = '<%sB'%length
00114       buff.write(struct.pack(pattern, *self.constr_jts))
00115     except struct.error as se: self._check_types(se)
00116     except TypeError as te: self._check_types(te)
00117 
00118   def deserialize(self, str):
00119     """
00120     unpack serialized message in str into this message instance
00121     :param str: byte array of serialized message, ``str``
00122     """
00123     try:
00124       if self.header is None:
00125         self.header = std_msgs.msg.Header()
00126       if self.jt_loc is None:
00127         self.jt_loc = None
00128       if self.act_jts is None:
00129         self.act_jts = hrl_msgs.msg.FloatArrayBare()
00130       end = 0
00131       _x = self
00132       start = end
00133       end += 12
00134       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00135       start = end
00136       end += 4
00137       (length,) = _struct_I.unpack(str[start:end])
00138       start = end
00139       end += length
00140       if python3:
00141         self.header.frame_id = str[start:end].decode('utf-8')
00142       else:
00143         self.header.frame_id = str[start:end]
00144       start = end
00145       end += 4
00146       (length,) = _struct_I.unpack(str[start:end])
00147       self.jt_loc = []
00148       for i in range(0, length):
00149         val1 = hrl_msgs.msg.FloatArrayBare()
00150         start = end
00151         end += 4
00152         (length,) = _struct_I.unpack(str[start:end])
00153         pattern = '<%sd'%length
00154         start = end
00155         end += struct.calcsize(pattern)
00156         val1.data = struct.unpack(pattern, str[start:end])
00157         self.jt_loc.append(val1)
00158       start = end
00159       end += 4
00160       (length,) = _struct_I.unpack(str[start:end])
00161       pattern = '<%sd'%length
00162       start = end
00163       end += struct.calcsize(pattern)
00164       self.act_jts.data = struct.unpack(pattern, str[start:end])
00165       start = end
00166       end += 4
00167       (length,) = _struct_I.unpack(str[start:end])
00168       pattern = '<%sB'%length
00169       start = end
00170       end += struct.calcsize(pattern)
00171       self.constr_jts = struct.unpack(pattern, str[start:end])
00172       self.constr_jts = map(bool, self.constr_jts)
00173       return self
00174     except struct.error as e:
00175       raise genpy.DeserializationError(e) #most likely buffer underfill
00176 
00177 
00178   def serialize_numpy(self, buff, numpy):
00179     """
00180     serialize message with numpy array types into buffer
00181     :param buff: buffer, ``StringIO``
00182     :param numpy: numpy python module
00183     """
00184     try:
00185       _x = self
00186       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00187       _x = self.header.frame_id
00188       length = len(_x)
00189       if python3 or type(_x) == unicode:
00190         _x = _x.encode('utf-8')
00191         length = len(_x)
00192       buff.write(struct.pack('<I%ss'%length, length, _x))
00193       length = len(self.jt_loc)
00194       buff.write(_struct_I.pack(length))
00195       for val1 in self.jt_loc:
00196         length = len(val1.data)
00197         buff.write(_struct_I.pack(length))
00198         pattern = '<%sd'%length
00199         buff.write(val1.data.tostring())
00200       length = len(self.act_jts.data)
00201       buff.write(_struct_I.pack(length))
00202       pattern = '<%sd'%length
00203       buff.write(self.act_jts.data.tostring())
00204       length = len(self.constr_jts)
00205       buff.write(_struct_I.pack(length))
00206       pattern = '<%sB'%length
00207       buff.write(self.constr_jts.tostring())
00208     except struct.error as se: self._check_types(se)
00209     except TypeError as te: self._check_types(te)
00210 
00211   def deserialize_numpy(self, str, numpy):
00212     """
00213     unpack serialized message in str into this message instance using numpy for array types
00214     :param str: byte array of serialized message, ``str``
00215     :param numpy: numpy python module
00216     """
00217     try:
00218       if self.header is None:
00219         self.header = std_msgs.msg.Header()
00220       if self.jt_loc is None:
00221         self.jt_loc = None
00222       if self.act_jts is None:
00223         self.act_jts = hrl_msgs.msg.FloatArrayBare()
00224       end = 0
00225       _x = self
00226       start = end
00227       end += 12
00228       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00229       start = end
00230       end += 4
00231       (length,) = _struct_I.unpack(str[start:end])
00232       start = end
00233       end += length
00234       if python3:
00235         self.header.frame_id = str[start:end].decode('utf-8')
00236       else:
00237         self.header.frame_id = str[start:end]
00238       start = end
00239       end += 4
00240       (length,) = _struct_I.unpack(str[start:end])
00241       self.jt_loc = []
00242       for i in range(0, length):
00243         val1 = hrl_msgs.msg.FloatArrayBare()
00244         start = end
00245         end += 4
00246         (length,) = _struct_I.unpack(str[start:end])
00247         pattern = '<%sd'%length
00248         start = end
00249         end += struct.calcsize(pattern)
00250         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00251         self.jt_loc.append(val1)
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.act_jts.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00259       start = end
00260       end += 4
00261       (length,) = _struct_I.unpack(str[start:end])
00262       pattern = '<%sB'%length
00263       start = end
00264       end += struct.calcsize(pattern)
00265       self.constr_jts = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length)
00266       self.constr_jts = map(bool, self.constr_jts)
00267       return self
00268     except struct.error as e:
00269       raise genpy.DeserializationError(e) #most likely buffer underfill
00270 
00271 _struct_I = genpy.struct_I
00272 _struct_3I = struct.Struct("<3I")


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