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