_BodyDraw.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_msgs/BodyDraw.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 BodyDraw(genpy.Message):
00011   _md5sum = "9d2f1cfc83ddaebaf16587e23cfc1748"
00012   _type = "hrl_haptic_manipulation_in_clutter_msgs/BodyDraw"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 
00016 # commented out by Advait on Aug 30, 2011. It is not populated in
00017 # demo_kinematic.cpp
00018 #string[] link_names
00019 
00020 hrl_msgs/FloatArrayBare[] obst_loc
00021 hrl_msgs/FloatArrayBare[] obst_rot
00022 
00023 hrl_msgs/FloatArrayBare[] link_loc
00024 hrl_msgs/FloatArrayBare[] link_rot
00025 
00026 
00027 
00028 ================================================================================
00029 MSG: std_msgs/Header
00030 # Standard metadata for higher-level stamped data types.
00031 # This is generally used to communicate timestamped data 
00032 # in a particular coordinate frame.
00033 # 
00034 # sequence ID: consecutively increasing ID 
00035 uint32 seq
00036 #Two-integer timestamp that is expressed as:
00037 # * stamp.secs: seconds (stamp_secs) since epoch
00038 # * stamp.nsecs: nanoseconds since stamp_secs
00039 # time-handling sugar is provided by the client library
00040 time stamp
00041 #Frame this data is associated with
00042 # 0: no frame
00043 # 1: global frame
00044 string frame_id
00045 
00046 ================================================================================
00047 MSG: hrl_msgs/FloatArrayBare
00048 float64[] data
00049 
00050 
00051 """
00052   __slots__ = ['header','obst_loc','obst_rot','link_loc','link_rot']
00053   _slot_types = ['std_msgs/Header','hrl_msgs/FloatArrayBare[]','hrl_msgs/FloatArrayBare[]','hrl_msgs/FloatArrayBare[]','hrl_msgs/FloatArrayBare[]']
00054 
00055   def __init__(self, *args, **kwds):
00056     """
00057     Constructor. Any message fields that are implicitly/explicitly
00058     set to None will be assigned a default value. The recommend
00059     use is keyword arguments as this is more robust to future message
00060     changes.  You cannot mix in-order arguments and keyword arguments.
00061 
00062     The available fields are:
00063        header,obst_loc,obst_rot,link_loc,link_rot
00064 
00065     :param args: complete set of field values, in .msg order
00066     :param kwds: use keyword arguments corresponding to message field names
00067     to set specific fields.
00068     """
00069     if args or kwds:
00070       super(BodyDraw, self).__init__(*args, **kwds)
00071       #message fields cannot be None, assign default values for those that are
00072       if self.header is None:
00073         self.header = std_msgs.msg.Header()
00074       if self.obst_loc is None:
00075         self.obst_loc = []
00076       if self.obst_rot is None:
00077         self.obst_rot = []
00078       if self.link_loc is None:
00079         self.link_loc = []
00080       if self.link_rot is None:
00081         self.link_rot = []
00082     else:
00083       self.header = std_msgs.msg.Header()
00084       self.obst_loc = []
00085       self.obst_rot = []
00086       self.link_loc = []
00087       self.link_rot = []
00088 
00089   def _get_types(self):
00090     """
00091     internal API method
00092     """
00093     return self._slot_types
00094 
00095   def serialize(self, buff):
00096     """
00097     serialize message into buffer
00098     :param buff: buffer, ``StringIO``
00099     """
00100     try:
00101       _x = self
00102       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00103       _x = self.header.frame_id
00104       length = len(_x)
00105       if python3 or type(_x) == unicode:
00106         _x = _x.encode('utf-8')
00107         length = len(_x)
00108       buff.write(struct.pack('<I%ss'%length, length, _x))
00109       length = len(self.obst_loc)
00110       buff.write(_struct_I.pack(length))
00111       for val1 in self.obst_loc:
00112         length = len(val1.data)
00113         buff.write(_struct_I.pack(length))
00114         pattern = '<%sd'%length
00115         buff.write(struct.pack(pattern, *val1.data))
00116       length = len(self.obst_rot)
00117       buff.write(_struct_I.pack(length))
00118       for val1 in self.obst_rot:
00119         length = len(val1.data)
00120         buff.write(_struct_I.pack(length))
00121         pattern = '<%sd'%length
00122         buff.write(struct.pack(pattern, *val1.data))
00123       length = len(self.link_loc)
00124       buff.write(_struct_I.pack(length))
00125       for val1 in self.link_loc:
00126         length = len(val1.data)
00127         buff.write(_struct_I.pack(length))
00128         pattern = '<%sd'%length
00129         buff.write(struct.pack(pattern, *val1.data))
00130       length = len(self.link_rot)
00131       buff.write(_struct_I.pack(length))
00132       for val1 in self.link_rot:
00133         length = len(val1.data)
00134         buff.write(_struct_I.pack(length))
00135         pattern = '<%sd'%length
00136         buff.write(struct.pack(pattern, *val1.data))
00137     except struct.error as se: self._check_types(se)
00138     except TypeError as te: self._check_types(te)
00139 
00140   def deserialize(self, str):
00141     """
00142     unpack serialized message in str into this message instance
00143     :param str: byte array of serialized message, ``str``
00144     """
00145     try:
00146       if self.header is None:
00147         self.header = std_msgs.msg.Header()
00148       if self.obst_loc is None:
00149         self.obst_loc = None
00150       if self.obst_rot is None:
00151         self.obst_rot = None
00152       if self.link_loc is None:
00153         self.link_loc = None
00154       if self.link_rot is None:
00155         self.link_rot = None
00156       end = 0
00157       _x = self
00158       start = end
00159       end += 12
00160       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00161       start = end
00162       end += 4
00163       (length,) = _struct_I.unpack(str[start:end])
00164       start = end
00165       end += length
00166       if python3:
00167         self.header.frame_id = str[start:end].decode('utf-8')
00168       else:
00169         self.header.frame_id = str[start:end]
00170       start = end
00171       end += 4
00172       (length,) = _struct_I.unpack(str[start:end])
00173       self.obst_loc = []
00174       for i in range(0, length):
00175         val1 = hrl_msgs.msg.FloatArrayBare()
00176         start = end
00177         end += 4
00178         (length,) = _struct_I.unpack(str[start:end])
00179         pattern = '<%sd'%length
00180         start = end
00181         end += struct.calcsize(pattern)
00182         val1.data = struct.unpack(pattern, str[start:end])
00183         self.obst_loc.append(val1)
00184       start = end
00185       end += 4
00186       (length,) = _struct_I.unpack(str[start:end])
00187       self.obst_rot = []
00188       for i in range(0, length):
00189         val1 = hrl_msgs.msg.FloatArrayBare()
00190         start = end
00191         end += 4
00192         (length,) = _struct_I.unpack(str[start:end])
00193         pattern = '<%sd'%length
00194         start = end
00195         end += struct.calcsize(pattern)
00196         val1.data = struct.unpack(pattern, str[start:end])
00197         self.obst_rot.append(val1)
00198       start = end
00199       end += 4
00200       (length,) = _struct_I.unpack(str[start:end])
00201       self.link_loc = []
00202       for i in range(0, length):
00203         val1 = hrl_msgs.msg.FloatArrayBare()
00204         start = end
00205         end += 4
00206         (length,) = _struct_I.unpack(str[start:end])
00207         pattern = '<%sd'%length
00208         start = end
00209         end += struct.calcsize(pattern)
00210         val1.data = struct.unpack(pattern, str[start:end])
00211         self.link_loc.append(val1)
00212       start = end
00213       end += 4
00214       (length,) = _struct_I.unpack(str[start:end])
00215       self.link_rot = []
00216       for i in range(0, length):
00217         val1 = hrl_msgs.msg.FloatArrayBare()
00218         start = end
00219         end += 4
00220         (length,) = _struct_I.unpack(str[start:end])
00221         pattern = '<%sd'%length
00222         start = end
00223         end += struct.calcsize(pattern)
00224         val1.data = struct.unpack(pattern, str[start:end])
00225         self.link_rot.append(val1)
00226       return self
00227     except struct.error as e:
00228       raise genpy.DeserializationError(e) #most likely buffer underfill
00229 
00230 
00231   def serialize_numpy(self, buff, numpy):
00232     """
00233     serialize message with numpy array types into buffer
00234     :param buff: buffer, ``StringIO``
00235     :param numpy: numpy python module
00236     """
00237     try:
00238       _x = self
00239       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00240       _x = self.header.frame_id
00241       length = len(_x)
00242       if python3 or type(_x) == unicode:
00243         _x = _x.encode('utf-8')
00244         length = len(_x)
00245       buff.write(struct.pack('<I%ss'%length, length, _x))
00246       length = len(self.obst_loc)
00247       buff.write(_struct_I.pack(length))
00248       for val1 in self.obst_loc:
00249         length = len(val1.data)
00250         buff.write(_struct_I.pack(length))
00251         pattern = '<%sd'%length
00252         buff.write(val1.data.tostring())
00253       length = len(self.obst_rot)
00254       buff.write(_struct_I.pack(length))
00255       for val1 in self.obst_rot:
00256         length = len(val1.data)
00257         buff.write(_struct_I.pack(length))
00258         pattern = '<%sd'%length
00259         buff.write(val1.data.tostring())
00260       length = len(self.link_loc)
00261       buff.write(_struct_I.pack(length))
00262       for val1 in self.link_loc:
00263         length = len(val1.data)
00264         buff.write(_struct_I.pack(length))
00265         pattern = '<%sd'%length
00266         buff.write(val1.data.tostring())
00267       length = len(self.link_rot)
00268       buff.write(_struct_I.pack(length))
00269       for val1 in self.link_rot:
00270         length = len(val1.data)
00271         buff.write(_struct_I.pack(length))
00272         pattern = '<%sd'%length
00273         buff.write(val1.data.tostring())
00274     except struct.error as se: self._check_types(se)
00275     except TypeError as te: self._check_types(te)
00276 
00277   def deserialize_numpy(self, str, numpy):
00278     """
00279     unpack serialized message in str into this message instance using numpy for array types
00280     :param str: byte array of serialized message, ``str``
00281     :param numpy: numpy python module
00282     """
00283     try:
00284       if self.header is None:
00285         self.header = std_msgs.msg.Header()
00286       if self.obst_loc is None:
00287         self.obst_loc = None
00288       if self.obst_rot is None:
00289         self.obst_rot = None
00290       if self.link_loc is None:
00291         self.link_loc = None
00292       if self.link_rot is None:
00293         self.link_rot = None
00294       end = 0
00295       _x = self
00296       start = end
00297       end += 12
00298       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00299       start = end
00300       end += 4
00301       (length,) = _struct_I.unpack(str[start:end])
00302       start = end
00303       end += length
00304       if python3:
00305         self.header.frame_id = str[start:end].decode('utf-8')
00306       else:
00307         self.header.frame_id = str[start:end]
00308       start = end
00309       end += 4
00310       (length,) = _struct_I.unpack(str[start:end])
00311       self.obst_loc = []
00312       for i in range(0, length):
00313         val1 = hrl_msgs.msg.FloatArrayBare()
00314         start = end
00315         end += 4
00316         (length,) = _struct_I.unpack(str[start:end])
00317         pattern = '<%sd'%length
00318         start = end
00319         end += struct.calcsize(pattern)
00320         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00321         self.obst_loc.append(val1)
00322       start = end
00323       end += 4
00324       (length,) = _struct_I.unpack(str[start:end])
00325       self.obst_rot = []
00326       for i in range(0, length):
00327         val1 = hrl_msgs.msg.FloatArrayBare()
00328         start = end
00329         end += 4
00330         (length,) = _struct_I.unpack(str[start:end])
00331         pattern = '<%sd'%length
00332         start = end
00333         end += struct.calcsize(pattern)
00334         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00335         self.obst_rot.append(val1)
00336       start = end
00337       end += 4
00338       (length,) = _struct_I.unpack(str[start:end])
00339       self.link_loc = []
00340       for i in range(0, length):
00341         val1 = hrl_msgs.msg.FloatArrayBare()
00342         start = end
00343         end += 4
00344         (length,) = _struct_I.unpack(str[start:end])
00345         pattern = '<%sd'%length
00346         start = end
00347         end += struct.calcsize(pattern)
00348         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00349         self.link_loc.append(val1)
00350       start = end
00351       end += 4
00352       (length,) = _struct_I.unpack(str[start:end])
00353       self.link_rot = []
00354       for i in range(0, length):
00355         val1 = hrl_msgs.msg.FloatArrayBare()
00356         start = end
00357         end += 4
00358         (length,) = _struct_I.unpack(str[start:end])
00359         pattern = '<%sd'%length
00360         start = end
00361         end += struct.calcsize(pattern)
00362         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00363         self.link_rot.append(val1)
00364       return self
00365     except struct.error as e:
00366       raise genpy.DeserializationError(e) #most likely buffer underfill
00367 
00368 _struct_I = genpy.struct_I
00369 _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