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


srs_object_database_msgs
Author(s): Georg Arbeiter
autogenerated on Wed Nov 27 2013 14:14:38