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