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


pr2_create_object_model
Author(s): Kaijen Hsiao
autogenerated on Mon Oct 6 2014 11:49:24