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