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