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


pr2_tilt_laser_interface
Author(s): Radu Rusu, Wim Meeussen, Vijay Pradeep
autogenerated on Sat Dec 28 2013 17:25:13