00001 """autogenerated by genpy from cob_perception_msgs/PointCloud2Array.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 PointCloud2Array(genpy.Message):
00011 _md5sum = "bd792288e56da8dc0e9d1696ac4e856d"
00012 _type = "cob_perception_msgs/PointCloud2Array"
00013 _has_header = True
00014 _full_text = """Header header
00015 sensor_msgs/PointCloud2[] segments
00016
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data
00021 # in a particular coordinate frame.
00022 #
00023 # sequence ID: consecutively increasing ID
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034
00035 ================================================================================
00036 MSG: sensor_msgs/PointCloud2
00037 # This message holds a collection of N-dimensional points, which may
00038 # contain additional information such as normals, intensity, etc. The
00039 # point data is stored as a binary blob, its layout described by the
00040 # contents of the "fields" array.
00041
00042 # The point cloud data may be organized 2d (image-like) or 1d
00043 # (unordered). Point clouds organized as 2d images may be produced by
00044 # camera depth sensors such as stereo or time-of-flight.
00045
00046 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00047 # points).
00048 Header header
00049
00050 # 2D structure of the point cloud. If the cloud is unordered, height is
00051 # 1 and width is the length of the point cloud.
00052 uint32 height
00053 uint32 width
00054
00055 # Describes the channels and their layout in the binary data blob.
00056 PointField[] fields
00057
00058 bool is_bigendian # Is this data bigendian?
00059 uint32 point_step # Length of a point in bytes
00060 uint32 row_step # Length of a row in bytes
00061 uint8[] data # Actual point data, size is (row_step*height)
00062
00063 bool is_dense # True if there are no invalid points
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__ = ['header','segments']
00085 _slot_types = ['std_msgs/Header','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 header,segments
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(PointCloud2Array, self).__init__(*args, **kwds)
00103
00104 if self.header is None:
00105 self.header = std_msgs.msg.Header()
00106 if self.segments is None:
00107 self.segments = []
00108 else:
00109 self.header = std_msgs.msg.Header()
00110 self.segments = []
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_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00126 _x = self.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 length = len(self.segments)
00133 buff.write(_struct_I.pack(length))
00134 for val1 in self.segments:
00135 _v1 = val1.header
00136 buff.write(_struct_I.pack(_v1.seq))
00137 _v2 = _v1.stamp
00138 _x = _v2
00139 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00140 _x = _v1.frame_id
00141 length = len(_x)
00142 if python3 or type(_x) == unicode:
00143 _x = _x.encode('utf-8')
00144 length = len(_x)
00145 buff.write(struct.pack('<I%ss'%length, length, _x))
00146 _x = val1
00147 buff.write(_struct_2I.pack(_x.height, _x.width))
00148 length = len(val1.fields)
00149 buff.write(_struct_I.pack(length))
00150 for val2 in val1.fields:
00151 _x = val2.name
00152 length = len(_x)
00153 if python3 or type(_x) == unicode:
00154 _x = _x.encode('utf-8')
00155 length = len(_x)
00156 buff.write(struct.pack('<I%ss'%length, length, _x))
00157 _x = val2
00158 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00159 _x = val1
00160 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step))
00161 _x = val1.data
00162 length = len(_x)
00163
00164 if type(_x) in [list, tuple]:
00165 buff.write(struct.pack('<I%sB'%length, length, *_x))
00166 else:
00167 buff.write(struct.pack('<I%ss'%length, length, _x))
00168 buff.write(_struct_B.pack(val1.is_dense))
00169 except struct.error as se: self._check_types(se)
00170 except TypeError as te: self._check_types(te)
00171
00172 def deserialize(self, str):
00173 """
00174 unpack serialized message in str into this message instance
00175 :param str: byte array of serialized message, ``str``
00176 """
00177 try:
00178 if self.header is None:
00179 self.header = std_msgs.msg.Header()
00180 if self.segments is None:
00181 self.segments = None
00182 end = 0
00183 _x = self
00184 start = end
00185 end += 12
00186 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 start = end
00191 end += length
00192 if python3:
00193 self.header.frame_id = str[start:end].decode('utf-8')
00194 else:
00195 self.header.frame_id = str[start:end]
00196 start = end
00197 end += 4
00198 (length,) = _struct_I.unpack(str[start:end])
00199 self.segments = []
00200 for i in range(0, length):
00201 val1 = sensor_msgs.msg.PointCloud2()
00202 _v3 = val1.header
00203 start = end
00204 end += 4
00205 (_v3.seq,) = _struct_I.unpack(str[start:end])
00206 _v4 = _v3.stamp
00207 _x = _v4
00208 start = end
00209 end += 8
00210 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00211 start = end
00212 end += 4
00213 (length,) = _struct_I.unpack(str[start:end])
00214 start = end
00215 end += length
00216 if python3:
00217 _v3.frame_id = str[start:end].decode('utf-8')
00218 else:
00219 _v3.frame_id = str[start:end]
00220 _x = val1
00221 start = end
00222 end += 8
00223 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end])
00224 start = end
00225 end += 4
00226 (length,) = _struct_I.unpack(str[start:end])
00227 val1.fields = []
00228 for i in range(0, length):
00229 val2 = sensor_msgs.msg.PointField()
00230 start = end
00231 end += 4
00232 (length,) = _struct_I.unpack(str[start:end])
00233 start = end
00234 end += length
00235 if python3:
00236 val2.name = str[start:end].decode('utf-8')
00237 else:
00238 val2.name = str[start:end]
00239 _x = val2
00240 start = end
00241 end += 9
00242 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00243 val1.fields.append(val2)
00244 _x = val1
00245 start = end
00246 end += 9
00247 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end])
00248 val1.is_bigendian = bool(val1.is_bigendian)
00249 start = end
00250 end += 4
00251 (length,) = _struct_I.unpack(str[start:end])
00252 start = end
00253 end += length
00254 if python3:
00255 val1.data = str[start:end].decode('utf-8')
00256 else:
00257 val1.data = str[start:end]
00258 start = end
00259 end += 1
00260 (val1.is_dense,) = _struct_B.unpack(str[start:end])
00261 val1.is_dense = bool(val1.is_dense)
00262 self.segments.append(val1)
00263 return self
00264 except struct.error as e:
00265 raise genpy.DeserializationError(e)
00266
00267
00268 def serialize_numpy(self, buff, numpy):
00269 """
00270 serialize message with numpy array types into buffer
00271 :param buff: buffer, ``StringIO``
00272 :param numpy: numpy python module
00273 """
00274 try:
00275 _x = self
00276 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00277 _x = self.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 length = len(self.segments)
00284 buff.write(_struct_I.pack(length))
00285 for val1 in self.segments:
00286 _v5 = val1.header
00287 buff.write(_struct_I.pack(_v5.seq))
00288 _v6 = _v5.stamp
00289 _x = _v6
00290 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00291 _x = _v5.frame_id
00292 length = len(_x)
00293 if python3 or type(_x) == unicode:
00294 _x = _x.encode('utf-8')
00295 length = len(_x)
00296 buff.write(struct.pack('<I%ss'%length, length, _x))
00297 _x = val1
00298 buff.write(_struct_2I.pack(_x.height, _x.width))
00299 length = len(val1.fields)
00300 buff.write(_struct_I.pack(length))
00301 for val2 in val1.fields:
00302 _x = val2.name
00303 length = len(_x)
00304 if python3 or type(_x) == unicode:
00305 _x = _x.encode('utf-8')
00306 length = len(_x)
00307 buff.write(struct.pack('<I%ss'%length, length, _x))
00308 _x = val2
00309 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00310 _x = val1
00311 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step))
00312 _x = val1.data
00313 length = len(_x)
00314
00315 if type(_x) in [list, tuple]:
00316 buff.write(struct.pack('<I%sB'%length, length, *_x))
00317 else:
00318 buff.write(struct.pack('<I%ss'%length, length, _x))
00319 buff.write(_struct_B.pack(val1.is_dense))
00320 except struct.error as se: self._check_types(se)
00321 except TypeError as te: self._check_types(te)
00322
00323 def deserialize_numpy(self, str, numpy):
00324 """
00325 unpack serialized message in str into this message instance using numpy for array types
00326 :param str: byte array of serialized message, ``str``
00327 :param numpy: numpy python module
00328 """
00329 try:
00330 if self.header is None:
00331 self.header = std_msgs.msg.Header()
00332 if self.segments is None:
00333 self.segments = None
00334 end = 0
00335 _x = self
00336 start = end
00337 end += 12
00338 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00339 start = end
00340 end += 4
00341 (length,) = _struct_I.unpack(str[start:end])
00342 start = end
00343 end += length
00344 if python3:
00345 self.header.frame_id = str[start:end].decode('utf-8')
00346 else:
00347 self.header.frame_id = str[start:end]
00348 start = end
00349 end += 4
00350 (length,) = _struct_I.unpack(str[start:end])
00351 self.segments = []
00352 for i in range(0, length):
00353 val1 = sensor_msgs.msg.PointCloud2()
00354 _v7 = val1.header
00355 start = end
00356 end += 4
00357 (_v7.seq,) = _struct_I.unpack(str[start:end])
00358 _v8 = _v7.stamp
00359 _x = _v8
00360 start = end
00361 end += 8
00362 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00363 start = end
00364 end += 4
00365 (length,) = _struct_I.unpack(str[start:end])
00366 start = end
00367 end += length
00368 if python3:
00369 _v7.frame_id = str[start:end].decode('utf-8')
00370 else:
00371 _v7.frame_id = str[start:end]
00372 _x = val1
00373 start = end
00374 end += 8
00375 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end])
00376 start = end
00377 end += 4
00378 (length,) = _struct_I.unpack(str[start:end])
00379 val1.fields = []
00380 for i in range(0, length):
00381 val2 = sensor_msgs.msg.PointField()
00382 start = end
00383 end += 4
00384 (length,) = _struct_I.unpack(str[start:end])
00385 start = end
00386 end += length
00387 if python3:
00388 val2.name = str[start:end].decode('utf-8')
00389 else:
00390 val2.name = str[start:end]
00391 _x = val2
00392 start = end
00393 end += 9
00394 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00395 val1.fields.append(val2)
00396 _x = val1
00397 start = end
00398 end += 9
00399 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end])
00400 val1.is_bigendian = bool(val1.is_bigendian)
00401 start = end
00402 end += 4
00403 (length,) = _struct_I.unpack(str[start:end])
00404 start = end
00405 end += length
00406 if python3:
00407 val1.data = str[start:end].decode('utf-8')
00408 else:
00409 val1.data = str[start:end]
00410 start = end
00411 end += 1
00412 (val1.is_dense,) = _struct_B.unpack(str[start:end])
00413 val1.is_dense = bool(val1.is_dense)
00414 self.segments.append(val1)
00415 return self
00416 except struct.error as e:
00417 raise genpy.DeserializationError(e)
00418
00419 _struct_I = genpy.struct_I
00420 _struct_IBI = struct.Struct("<IBI")
00421 _struct_B = struct.Struct("<B")
00422 _struct_3I = struct.Struct("<3I")
00423 _struct_B2I = struct.Struct("<B2I")
00424 _struct_2I = struct.Struct("<2I")