_ModelObjectInHandResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_create_object_model/ModelObjectInHandResult.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 import sensor_msgs.msg
00009 
00010 class ModelObjectInHandResult(genpy.Message):
00011   _md5sum = "351782e2c561b9d4a7b5319ccaaea551"
00012   _type = "pr2_create_object_model/ModelObjectInHandResult"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015 
00016 # the resulting object point cloud
00017 sensor_msgs/PointCloud2 cluster
00018 
00019 # the resulting collision name, if added to the collision map
00020 string collision_name
00021 
00022 
00023 ================================================================================
00024 MSG: sensor_msgs/PointCloud2
00025 # This message holds a collection of N-dimensional points, which may
00026 # contain additional information such as normals, intensity, etc. The
00027 # point data is stored as a binary blob, its layout described by the
00028 # contents of the "fields" array.
00029 
00030 # The point cloud data may be organized 2d (image-like) or 1d
00031 # (unordered). Point clouds organized as 2d images may be produced by
00032 # camera depth sensors such as stereo or time-of-flight.
00033 
00034 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00035 # points).
00036 Header header
00037 
00038 # 2D structure of the point cloud. If the cloud is unordered, height is
00039 # 1 and width is the length of the point cloud.
00040 uint32 height
00041 uint32 width
00042 
00043 # Describes the channels and their layout in the binary data blob.
00044 PointField[] fields
00045 
00046 bool    is_bigendian # Is this data bigendian?
00047 uint32  point_step   # Length of a point in bytes
00048 uint32  row_step     # Length of a row in bytes
00049 uint8[] data         # Actual point data, size is (row_step*height)
00050 
00051 bool is_dense        # True if there are no invalid points
00052 
00053 ================================================================================
00054 MSG: std_msgs/Header
00055 # Standard metadata for higher-level stamped data types.
00056 # This is generally used to communicate timestamped data 
00057 # in a particular coordinate frame.
00058 # 
00059 # sequence ID: consecutively increasing ID 
00060 uint32 seq
00061 #Two-integer timestamp that is expressed as:
00062 # * stamp.secs: seconds (stamp_secs) since epoch
00063 # * stamp.nsecs: nanoseconds since stamp_secs
00064 # time-handling sugar is provided by the client library
00065 time stamp
00066 #Frame this data is associated with
00067 # 0: no frame
00068 # 1: global frame
00069 string frame_id
00070 
00071 ================================================================================
00072 MSG: sensor_msgs/PointField
00073 # This message holds the description of one point entry in the
00074 # PointCloud2 message format.
00075 uint8 INT8    = 1
00076 uint8 UINT8   = 2
00077 uint8 INT16   = 3
00078 uint8 UINT16  = 4
00079 uint8 INT32   = 5
00080 uint8 UINT32  = 6
00081 uint8 FLOAT32 = 7
00082 uint8 FLOAT64 = 8
00083 
00084 string name      # Name of field
00085 uint32 offset    # Offset from start of point struct
00086 uint8  datatype  # Datatype enumeration, see above
00087 uint32 count     # How many elements in the field
00088 
00089 """
00090   __slots__ = ['cluster','collision_name']
00091   _slot_types = ['sensor_msgs/PointCloud2','string']
00092 
00093   def __init__(self, *args, **kwds):
00094     """
00095     Constructor. Any message fields that are implicitly/explicitly
00096     set to None will be assigned a default value. The recommend
00097     use is keyword arguments as this is more robust to future message
00098     changes.  You cannot mix in-order arguments and keyword arguments.
00099 
00100     The available fields are:
00101        cluster,collision_name
00102 
00103     :param args: complete set of field values, in .msg order
00104     :param kwds: use keyword arguments corresponding to message field names
00105     to set specific fields.
00106     """
00107     if args or kwds:
00108       super(ModelObjectInHandResult, self).__init__(*args, **kwds)
00109       #message fields cannot be None, assign default values for those that are
00110       if self.cluster is None:
00111         self.cluster = sensor_msgs.msg.PointCloud2()
00112       if self.collision_name is None:
00113         self.collision_name = ''
00114     else:
00115       self.cluster = sensor_msgs.msg.PointCloud2()
00116       self.collision_name = ''
00117 
00118   def _get_types(self):
00119     """
00120     internal API method
00121     """
00122     return self._slot_types
00123 
00124   def serialize(self, buff):
00125     """
00126     serialize message into buffer
00127     :param buff: buffer, ``StringIO``
00128     """
00129     try:
00130       _x = self
00131       buff.write(_struct_3I.pack(_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs))
00132       _x = self.cluster.header.frame_id
00133       length = len(_x)
00134       if python3 or type(_x) == unicode:
00135         _x = _x.encode('utf-8')
00136         length = len(_x)
00137       buff.write(struct.pack('<I%ss'%length, length, _x))
00138       _x = self
00139       buff.write(_struct_2I.pack(_x.cluster.height, _x.cluster.width))
00140       length = len(self.cluster.fields)
00141       buff.write(_struct_I.pack(length))
00142       for val1 in self.cluster.fields:
00143         _x = val1.name
00144         length = len(_x)
00145         if python3 or type(_x) == unicode:
00146           _x = _x.encode('utf-8')
00147           length = len(_x)
00148         buff.write(struct.pack('<I%ss'%length, length, _x))
00149         _x = val1
00150         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00151       _x = self
00152       buff.write(_struct_B2I.pack(_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step))
00153       _x = self.cluster.data
00154       length = len(_x)
00155       # - if encoded as a list instead, serialize as bytes instead of string
00156       if type(_x) in [list, tuple]:
00157         buff.write(struct.pack('<I%sB'%length, length, *_x))
00158       else:
00159         buff.write(struct.pack('<I%ss'%length, length, _x))
00160       buff.write(_struct_B.pack(self.cluster.is_dense))
00161       _x = self.collision_name
00162       length = len(_x)
00163       if python3 or type(_x) == unicode:
00164         _x = _x.encode('utf-8')
00165         length = len(_x)
00166       buff.write(struct.pack('<I%ss'%length, length, _x))
00167     except struct.error as se: self._check_types(se)
00168     except TypeError as te: self._check_types(te)
00169 
00170   def deserialize(self, str):
00171     """
00172     unpack serialized message in str into this message instance
00173     :param str: byte array of serialized message, ``str``
00174     """
00175     try:
00176       if self.cluster is None:
00177         self.cluster = sensor_msgs.msg.PointCloud2()
00178       end = 0
00179       _x = self
00180       start = end
00181       end += 12
00182       (_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00183       start = end
00184       end += 4
00185       (length,) = _struct_I.unpack(str[start:end])
00186       start = end
00187       end += length
00188       if python3:
00189         self.cluster.header.frame_id = str[start:end].decode('utf-8')
00190       else:
00191         self.cluster.header.frame_id = str[start:end]
00192       _x = self
00193       start = end
00194       end += 8
00195       (_x.cluster.height, _x.cluster.width,) = _struct_2I.unpack(str[start:end])
00196       start = end
00197       end += 4
00198       (length,) = _struct_I.unpack(str[start:end])
00199       self.cluster.fields = []
00200       for i in range(0, length):
00201         val1 = sensor_msgs.msg.PointField()
00202         start = end
00203         end += 4
00204         (length,) = _struct_I.unpack(str[start:end])
00205         start = end
00206         end += length
00207         if python3:
00208           val1.name = str[start:end].decode('utf-8')
00209         else:
00210           val1.name = str[start:end]
00211         _x = val1
00212         start = end
00213         end += 9
00214         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00215         self.cluster.fields.append(val1)
00216       _x = self
00217       start = end
00218       end += 9
00219       (_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step,) = _struct_B2I.unpack(str[start:end])
00220       self.cluster.is_bigendian = bool(self.cluster.is_bigendian)
00221       start = end
00222       end += 4
00223       (length,) = _struct_I.unpack(str[start:end])
00224       start = end
00225       end += length
00226       if python3:
00227         self.cluster.data = str[start:end].decode('utf-8')
00228       else:
00229         self.cluster.data = str[start:end]
00230       start = end
00231       end += 1
00232       (self.cluster.is_dense,) = _struct_B.unpack(str[start:end])
00233       self.cluster.is_dense = bool(self.cluster.is_dense)
00234       start = end
00235       end += 4
00236       (length,) = _struct_I.unpack(str[start:end])
00237       start = end
00238       end += length
00239       if python3:
00240         self.collision_name = str[start:end].decode('utf-8')
00241       else:
00242         self.collision_name = str[start:end]
00243       return self
00244     except struct.error as e:
00245       raise genpy.DeserializationError(e) #most likely buffer underfill
00246 
00247 
00248   def serialize_numpy(self, buff, numpy):
00249     """
00250     serialize message with numpy array types into buffer
00251     :param buff: buffer, ``StringIO``
00252     :param numpy: numpy python module
00253     """
00254     try:
00255       _x = self
00256       buff.write(_struct_3I.pack(_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs))
00257       _x = self.cluster.header.frame_id
00258       length = len(_x)
00259       if python3 or type(_x) == unicode:
00260         _x = _x.encode('utf-8')
00261         length = len(_x)
00262       buff.write(struct.pack('<I%ss'%length, length, _x))
00263       _x = self
00264       buff.write(_struct_2I.pack(_x.cluster.height, _x.cluster.width))
00265       length = len(self.cluster.fields)
00266       buff.write(_struct_I.pack(length))
00267       for val1 in self.cluster.fields:
00268         _x = val1.name
00269         length = len(_x)
00270         if python3 or type(_x) == unicode:
00271           _x = _x.encode('utf-8')
00272           length = len(_x)
00273         buff.write(struct.pack('<I%ss'%length, length, _x))
00274         _x = val1
00275         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00276       _x = self
00277       buff.write(_struct_B2I.pack(_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step))
00278       _x = self.cluster.data
00279       length = len(_x)
00280       # - if encoded as a list instead, serialize as bytes instead of string
00281       if type(_x) in [list, tuple]:
00282         buff.write(struct.pack('<I%sB'%length, length, *_x))
00283       else:
00284         buff.write(struct.pack('<I%ss'%length, length, _x))
00285       buff.write(_struct_B.pack(self.cluster.is_dense))
00286       _x = self.collision_name
00287       length = len(_x)
00288       if python3 or type(_x) == unicode:
00289         _x = _x.encode('utf-8')
00290         length = len(_x)
00291       buff.write(struct.pack('<I%ss'%length, length, _x))
00292     except struct.error as se: self._check_types(se)
00293     except TypeError as te: self._check_types(te)
00294 
00295   def deserialize_numpy(self, str, numpy):
00296     """
00297     unpack serialized message in str into this message instance using numpy for array types
00298     :param str: byte array of serialized message, ``str``
00299     :param numpy: numpy python module
00300     """
00301     try:
00302       if self.cluster is None:
00303         self.cluster = sensor_msgs.msg.PointCloud2()
00304       end = 0
00305       _x = self
00306       start = end
00307       end += 12
00308       (_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00309       start = end
00310       end += 4
00311       (length,) = _struct_I.unpack(str[start:end])
00312       start = end
00313       end += length
00314       if python3:
00315         self.cluster.header.frame_id = str[start:end].decode('utf-8')
00316       else:
00317         self.cluster.header.frame_id = str[start:end]
00318       _x = self
00319       start = end
00320       end += 8
00321       (_x.cluster.height, _x.cluster.width,) = _struct_2I.unpack(str[start:end])
00322       start = end
00323       end += 4
00324       (length,) = _struct_I.unpack(str[start:end])
00325       self.cluster.fields = []
00326       for i in range(0, length):
00327         val1 = sensor_msgs.msg.PointField()
00328         start = end
00329         end += 4
00330         (length,) = _struct_I.unpack(str[start:end])
00331         start = end
00332         end += length
00333         if python3:
00334           val1.name = str[start:end].decode('utf-8')
00335         else:
00336           val1.name = str[start:end]
00337         _x = val1
00338         start = end
00339         end += 9
00340         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00341         self.cluster.fields.append(val1)
00342       _x = self
00343       start = end
00344       end += 9
00345       (_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step,) = _struct_B2I.unpack(str[start:end])
00346       self.cluster.is_bigendian = bool(self.cluster.is_bigendian)
00347       start = end
00348       end += 4
00349       (length,) = _struct_I.unpack(str[start:end])
00350       start = end
00351       end += length
00352       if python3:
00353         self.cluster.data = str[start:end].decode('utf-8')
00354       else:
00355         self.cluster.data = str[start:end]
00356       start = end
00357       end += 1
00358       (self.cluster.is_dense,) = _struct_B.unpack(str[start:end])
00359       self.cluster.is_dense = bool(self.cluster.is_dense)
00360       start = end
00361       end += 4
00362       (length,) = _struct_I.unpack(str[start:end])
00363       start = end
00364       end += length
00365       if python3:
00366         self.collision_name = str[start:end].decode('utf-8')
00367       else:
00368         self.collision_name = str[start:end]
00369       return self
00370     except struct.error as e:
00371       raise genpy.DeserializationError(e) #most likely buffer underfill
00372 
00373 _struct_I = genpy.struct_I
00374 _struct_IBI = struct.Struct("<IBI")
00375 _struct_3I = struct.Struct("<3I")
00376 _struct_B = struct.Struct("<B")
00377 _struct_2I = struct.Struct("<2I")
00378 _struct_B2I = struct.Struct("<B2I")


pr2_create_object_model
Author(s): Kaijen Hsiao
autogenerated on Fri Jan 3 2014 11:50:03