$search
00001 """autogenerated by genmsg_py from TableObjectClusterResult.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 TableObjectClusterResult(roslib.message.Message): 00009 _md5sum = "2c8e5a484f41a0aac9855792591d7d4c" 00010 _type = "cob_3d_mapping_msgs/TableObjectClusterResult" 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 #result definition 00014 sensor_msgs/PointCloud2[] bounding_boxes 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__ = ['bounding_boxes'] 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 bounding_boxes 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(TableObjectClusterResult, self).__init__(*args, **kwds) 00102 #message fields cannot be None, assign default values for those that are 00103 if self.bounding_boxes is None: 00104 self.bounding_boxes = [] 00105 else: 00106 self.bounding_boxes = [] 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 00118 @type buff: StringIO 00119 """ 00120 try: 00121 length = len(self.bounding_boxes) 00122 buff.write(_struct_I.pack(length)) 00123 for val1 in self.bounding_boxes: 00124 _v1 = val1.header 00125 buff.write(_struct_I.pack(_v1.seq)) 00126 _v2 = _v1.stamp 00127 _x = _v2 00128 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00129 _x = _v1.frame_id 00130 length = len(_x) 00131 buff.write(struct.pack('<I%ss'%length, length, _x)) 00132 _x = val1 00133 buff.write(_struct_2I.pack(_x.height, _x.width)) 00134 length = len(val1.fields) 00135 buff.write(_struct_I.pack(length)) 00136 for val2 in val1.fields: 00137 _x = val2.name 00138 length = len(_x) 00139 buff.write(struct.pack('<I%ss'%length, length, _x)) 00140 _x = val2 00141 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00142 _x = val1 00143 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 00144 _x = val1.data 00145 length = len(_x) 00146 # - if encoded as a list instead, serialize as bytes instead of string 00147 if type(_x) in [list, tuple]: 00148 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00149 else: 00150 buff.write(struct.pack('<I%ss'%length, length, _x)) 00151 buff.write(_struct_B.pack(val1.is_dense)) 00152 except struct.error as se: self._check_types(se) 00153 except TypeError as te: self._check_types(te) 00154 00155 def deserialize(self, str): 00156 """ 00157 unpack serialized message in str into this message instance 00158 @param str: byte array of serialized message 00159 @type str: str 00160 """ 00161 try: 00162 end = 0 00163 start = end 00164 end += 4 00165 (length,) = _struct_I.unpack(str[start:end]) 00166 self.bounding_boxes = [] 00167 for i in range(0, length): 00168 val1 = sensor_msgs.msg.PointCloud2() 00169 _v3 = val1.header 00170 start = end 00171 end += 4 00172 (_v3.seq,) = _struct_I.unpack(str[start:end]) 00173 _v4 = _v3.stamp 00174 _x = _v4 00175 start = end 00176 end += 8 00177 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00178 start = end 00179 end += 4 00180 (length,) = _struct_I.unpack(str[start:end]) 00181 start = end 00182 end += length 00183 _v3.frame_id = str[start:end] 00184 _x = val1 00185 start = end 00186 end += 8 00187 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00188 start = end 00189 end += 4 00190 (length,) = _struct_I.unpack(str[start:end]) 00191 val1.fields = [] 00192 for i in range(0, length): 00193 val2 = sensor_msgs.msg.PointField() 00194 start = end 00195 end += 4 00196 (length,) = _struct_I.unpack(str[start:end]) 00197 start = end 00198 end += length 00199 val2.name = str[start:end] 00200 _x = val2 00201 start = end 00202 end += 9 00203 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00204 val1.fields.append(val2) 00205 _x = val1 00206 start = end 00207 end += 9 00208 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 00209 val1.is_bigendian = bool(val1.is_bigendian) 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 start = end 00214 end += length 00215 val1.data = str[start:end] 00216 start = end 00217 end += 1 00218 (val1.is_dense,) = _struct_B.unpack(str[start:end]) 00219 val1.is_dense = bool(val1.is_dense) 00220 self.bounding_boxes.append(val1) 00221 return self 00222 except struct.error as e: 00223 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00224 00225 00226 def serialize_numpy(self, buff, numpy): 00227 """ 00228 serialize message with numpy array types into buffer 00229 @param buff: buffer 00230 @type buff: StringIO 00231 @param numpy: numpy python module 00232 @type numpy module 00233 """ 00234 try: 00235 length = len(self.bounding_boxes) 00236 buff.write(_struct_I.pack(length)) 00237 for val1 in self.bounding_boxes: 00238 _v5 = val1.header 00239 buff.write(_struct_I.pack(_v5.seq)) 00240 _v6 = _v5.stamp 00241 _x = _v6 00242 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00243 _x = _v5.frame_id 00244 length = len(_x) 00245 buff.write(struct.pack('<I%ss'%length, length, _x)) 00246 _x = val1 00247 buff.write(_struct_2I.pack(_x.height, _x.width)) 00248 length = len(val1.fields) 00249 buff.write(_struct_I.pack(length)) 00250 for val2 in val1.fields: 00251 _x = val2.name 00252 length = len(_x) 00253 buff.write(struct.pack('<I%ss'%length, length, _x)) 00254 _x = val2 00255 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00256 _x = val1 00257 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 00258 _x = val1.data 00259 length = len(_x) 00260 # - if encoded as a list instead, serialize as bytes instead of string 00261 if type(_x) in [list, tuple]: 00262 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00263 else: 00264 buff.write(struct.pack('<I%ss'%length, length, _x)) 00265 buff.write(_struct_B.pack(val1.is_dense)) 00266 except struct.error as se: self._check_types(se) 00267 except TypeError as te: self._check_types(te) 00268 00269 def deserialize_numpy(self, str, numpy): 00270 """ 00271 unpack serialized message in str into this message instance using numpy for array types 00272 @param str: byte array of serialized message 00273 @type str: str 00274 @param numpy: numpy python module 00275 @type numpy: module 00276 """ 00277 try: 00278 end = 0 00279 start = end 00280 end += 4 00281 (length,) = _struct_I.unpack(str[start:end]) 00282 self.bounding_boxes = [] 00283 for i in range(0, length): 00284 val1 = sensor_msgs.msg.PointCloud2() 00285 _v7 = val1.header 00286 start = end 00287 end += 4 00288 (_v7.seq,) = _struct_I.unpack(str[start:end]) 00289 _v8 = _v7.stamp 00290 _x = _v8 00291 start = end 00292 end += 8 00293 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00294 start = end 00295 end += 4 00296 (length,) = _struct_I.unpack(str[start:end]) 00297 start = end 00298 end += length 00299 _v7.frame_id = str[start:end] 00300 _x = val1 00301 start = end 00302 end += 8 00303 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00304 start = end 00305 end += 4 00306 (length,) = _struct_I.unpack(str[start:end]) 00307 val1.fields = [] 00308 for i in range(0, length): 00309 val2 = sensor_msgs.msg.PointField() 00310 start = end 00311 end += 4 00312 (length,) = _struct_I.unpack(str[start:end]) 00313 start = end 00314 end += length 00315 val2.name = str[start:end] 00316 _x = val2 00317 start = end 00318 end += 9 00319 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00320 val1.fields.append(val2) 00321 _x = val1 00322 start = end 00323 end += 9 00324 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 00325 val1.is_bigendian = bool(val1.is_bigendian) 00326 start = end 00327 end += 4 00328 (length,) = _struct_I.unpack(str[start:end]) 00329 start = end 00330 end += length 00331 val1.data = str[start:end] 00332 start = end 00333 end += 1 00334 (val1.is_dense,) = _struct_B.unpack(str[start:end]) 00335 val1.is_dense = bool(val1.is_dense) 00336 self.bounding_boxes.append(val1) 00337 return self 00338 except struct.error as e: 00339 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00340 00341 _struct_I = roslib.message.struct_I 00342 _struct_IBI = struct.Struct("<IBI") 00343 _struct_B = struct.Struct("<B") 00344 _struct_2I = struct.Struct("<2I") 00345 _struct_B2I = struct.Struct("<B2I")