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


map_msgs
Author(s): Stéphane Magnenat
autogenerated on Fri May 31 2013 08:22:01