_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       if python3:
00215         self.pcl.data = str[start:end].decode('utf-8')
00216       else:
00217         self.pcl.data = str[start:end]
00218       start = end
00219       end += 1
00220       (self.pcl.is_dense,) = _struct_B.unpack(str[start:end])
00221       self.pcl.is_dense = bool(self.pcl.is_dense)
00222       return self
00223     except struct.error as e:
00224       raise genpy.DeserializationError(e) #most likely buffer underfill
00225 
00226 
00227   def serialize_numpy(self, buff, numpy):
00228     """
00229     serialize message with numpy array types into buffer
00230     :param buff: buffer, ``StringIO``
00231     :param numpy: numpy python module
00232     """
00233     try:
00234       _x = self
00235       buff.write(_struct_i3I.pack(_x.objectId, _x.pcl.header.seq, _x.pcl.header.stamp.secs, _x.pcl.header.stamp.nsecs))
00236       _x = self.pcl.header.frame_id
00237       length = len(_x)
00238       if python3 or type(_x) == unicode:
00239         _x = _x.encode('utf-8')
00240         length = len(_x)
00241       buff.write(struct.pack('<I%ss'%length, length, _x))
00242       _x = self
00243       buff.write(_struct_2I.pack(_x.pcl.height, _x.pcl.width))
00244       length = len(self.pcl.fields)
00245       buff.write(_struct_I.pack(length))
00246       for val1 in self.pcl.fields:
00247         _x = val1.name
00248         length = len(_x)
00249         if python3 or type(_x) == unicode:
00250           _x = _x.encode('utf-8')
00251           length = len(_x)
00252         buff.write(struct.pack('<I%ss'%length, length, _x))
00253         _x = val1
00254         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00255       _x = self
00256       buff.write(_struct_B2I.pack(_x.pcl.is_bigendian, _x.pcl.point_step, _x.pcl.row_step))
00257       _x = self.pcl.data
00258       length = len(_x)
00259       # - if encoded as a list instead, serialize as bytes instead of string
00260       if type(_x) in [list, tuple]:
00261         buff.write(struct.pack('<I%sB'%length, length, *_x))
00262       else:
00263         buff.write(struct.pack('<I%ss'%length, length, _x))
00264       buff.write(_struct_B.pack(self.pcl.is_dense))
00265     except struct.error as se: self._check_types(se)
00266     except TypeError as te: self._check_types(te)
00267 
00268   def deserialize_numpy(self, str, numpy):
00269     """
00270     unpack serialized message in str into this message instance using numpy for array types
00271     :param str: byte array of serialized message, ``str``
00272     :param numpy: numpy python module
00273     """
00274     try:
00275       if self.pcl is None:
00276         self.pcl = sensor_msgs.msg.PointCloud2()
00277       end = 0
00278       _x = self
00279       start = end
00280       end += 16
00281       (_x.objectId, _x.pcl.header.seq, _x.pcl.header.stamp.secs, _x.pcl.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end])
00282       start = end
00283       end += 4
00284       (length,) = _struct_I.unpack(str[start:end])
00285       start = end
00286       end += length
00287       if python3:
00288         self.pcl.header.frame_id = str[start:end].decode('utf-8')
00289       else:
00290         self.pcl.header.frame_id = str[start:end]
00291       _x = self
00292       start = end
00293       end += 8
00294       (_x.pcl.height, _x.pcl.width,) = _struct_2I.unpack(str[start:end])
00295       start = end
00296       end += 4
00297       (length,) = _struct_I.unpack(str[start:end])
00298       self.pcl.fields = []
00299       for i in range(0, length):
00300         val1 = sensor_msgs.msg.PointField()
00301         start = end
00302         end += 4
00303         (length,) = _struct_I.unpack(str[start:end])
00304         start = end
00305         end += length
00306         if python3:
00307           val1.name = str[start:end].decode('utf-8')
00308         else:
00309           val1.name = str[start:end]
00310         _x = val1
00311         start = end
00312         end += 9
00313         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00314         self.pcl.fields.append(val1)
00315       _x = self
00316       start = end
00317       end += 9
00318       (_x.pcl.is_bigendian, _x.pcl.point_step, _x.pcl.row_step,) = _struct_B2I.unpack(str[start:end])
00319       self.pcl.is_bigendian = bool(self.pcl.is_bigendian)
00320       start = end
00321       end += 4
00322       (length,) = _struct_I.unpack(str[start:end])
00323       start = end
00324       end += length
00325       if python3:
00326         self.pcl.data = str[start:end].decode('utf-8')
00327       else:
00328         self.pcl.data = str[start:end]
00329       start = end
00330       end += 1
00331       (self.pcl.is_dense,) = _struct_B.unpack(str[start:end])
00332       self.pcl.is_dense = bool(self.pcl.is_dense)
00333       return self
00334     except struct.error as e:
00335       raise genpy.DeserializationError(e) #most likely buffer underfill
00336 
00337 _struct_I = genpy.struct_I
00338 _struct_IBI = struct.Struct("<IBI")
00339 _struct_i3I = struct.Struct("<i3I")
00340 _struct_B = struct.Struct("<B")
00341 _struct_2I = struct.Struct("<2I")
00342 _struct_B2I = struct.Struct("<B2I")


srs_object_database_msgs
Author(s): Georg Arbeiter
autogenerated on Sun Jan 5 2014 11:36:25