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