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