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