$search
00001 """autogenerated by genmsg_py from UpdateMapRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import sensor_msgs.msg 00007 import cob_3d_mapping_msgs.msg 00008 import std_msgs.msg 00009 00010 class UpdateMapRequest(roslib.message.Message): 00011 _md5sum = "f0bf8d67881fb4de54c9e8a9fee43e78" 00012 _type = "cob_3d_mapping_msgs/UpdateMapRequest" 00013 _has_header = False #flag to mark the presence of a Header object 00014 _full_text = """cob_3d_mapping_msgs/ShapeArray map 00015 00016 ================================================================================ 00017 MSG: cob_3d_mapping_msgs/ShapeArray 00018 # An array of poses with a header for global reference. 00019 00020 Header header 00021 00022 cob_3d_mapping_msgs/Shape[] shapes 00023 ================================================================================ 00024 MSG: std_msgs/Header 00025 # Standard metadata for higher-level stamped data types. 00026 # This is generally used to communicate timestamped data 00027 # in a particular coordinate frame. 00028 # 00029 # sequence ID: consecutively increasing ID 00030 uint32 seq 00031 #Two-integer timestamp that is expressed as: 00032 # * stamp.secs: seconds (stamp_secs) since epoch 00033 # * stamp.nsecs: nanoseconds since stamp_secs 00034 # time-handling sugar is provided by the client library 00035 time stamp 00036 #Frame this data is associated with 00037 # 0: no frame 00038 # 1: global frame 00039 string frame_id 00040 00041 ================================================================================ 00042 MSG: cob_3d_mapping_msgs/Shape 00043 Header header 00044 00045 uint8 POLYGON=0 00046 uint8 LINE=1 00047 uint8 CURVED=2 00048 uint8 MESH=3 00049 uint8 OTHER=4 00050 uint8 CYLINDER=5 00051 # potential extensions: SPHERE, CYLINDER, BOX 00052 00053 uint8 type 00054 00055 00056 int32 id 00057 # define shape parameters 00058 # for plane 00059 # normal vector = params[0],params[1],params[2] 00060 # d = params[3] 00061 # for line 00062 # direction vector = params[0],params[1],params[2] 00063 # 00064 #for cylinder 00065 # symmetry axis = params[0],params[1],params[2] 00066 # z axis = params[3], params[4], params[5] 00067 # origin = params[6], params[7], params[8] 00068 # radius = params[9] 00069 # 00070 float64[] params 00071 00072 sensor_msgs/PointCloud2[] points 00073 00074 #### define mesh #### 00075 # each three entries form a triangle; indices of points are stored 00076 int32[] vertices 00077 00078 geometry_msgs/Point32 centroid 00079 std_msgs/ColorRGBA color 00080 bool[] holes 00081 00082 ================================================================================ 00083 MSG: sensor_msgs/PointCloud2 00084 # This message holds a collection of N-dimensional points, which may 00085 # contain additional information such as normals, intensity, etc. The 00086 # point data is stored as a binary blob, its layout described by the 00087 # contents of the "fields" array. 00088 00089 # The point cloud data may be organized 2d (image-like) or 1d 00090 # (unordered). Point clouds organized as 2d images may be produced by 00091 # camera depth sensors such as stereo or time-of-flight. 00092 00093 # Time of sensor data acquisition, and the coordinate frame ID (for 3d 00094 # points). 00095 Header header 00096 00097 # 2D structure of the point cloud. If the cloud is unordered, height is 00098 # 1 and width is the length of the point cloud. 00099 uint32 height 00100 uint32 width 00101 00102 # Describes the channels and their layout in the binary data blob. 00103 PointField[] fields 00104 00105 bool is_bigendian # Is this data bigendian? 00106 uint32 point_step # Length of a point in bytes 00107 uint32 row_step # Length of a row in bytes 00108 uint8[] data # Actual point data, size is (row_step*height) 00109 00110 bool is_dense # True if there are no invalid points 00111 00112 ================================================================================ 00113 MSG: sensor_msgs/PointField 00114 # This message holds the description of one point entry in the 00115 # PointCloud2 message format. 00116 uint8 INT8 = 1 00117 uint8 UINT8 = 2 00118 uint8 INT16 = 3 00119 uint8 UINT16 = 4 00120 uint8 INT32 = 5 00121 uint8 UINT32 = 6 00122 uint8 FLOAT32 = 7 00123 uint8 FLOAT64 = 8 00124 00125 string name # Name of field 00126 uint32 offset # Offset from start of point struct 00127 uint8 datatype # Datatype enumeration, see above 00128 uint32 count # How many elements in the field 00129 00130 ================================================================================ 00131 MSG: geometry_msgs/Point32 00132 # This contains the position of a point in free space(with 32 bits of precision). 00133 # It is recommeded to use Point wherever possible instead of Point32. 00134 # 00135 # This recommendation is to promote interoperability. 00136 # 00137 # This message is designed to take up less space when sending 00138 # lots of points at once, as in the case of a PointCloud. 00139 00140 float32 x 00141 float32 y 00142 float32 z 00143 ================================================================================ 00144 MSG: std_msgs/ColorRGBA 00145 float32 r 00146 float32 g 00147 float32 b 00148 float32 a 00149 00150 """ 00151 __slots__ = ['map'] 00152 _slot_types = ['cob_3d_mapping_msgs/ShapeArray'] 00153 00154 def __init__(self, *args, **kwds): 00155 """ 00156 Constructor. Any message fields that are implicitly/explicitly 00157 set to None will be assigned a default value. The recommend 00158 use is keyword arguments as this is more robust to future message 00159 changes. You cannot mix in-order arguments and keyword arguments. 00160 00161 The available fields are: 00162 map 00163 00164 @param args: complete set of field values, in .msg order 00165 @param kwds: use keyword arguments corresponding to message field names 00166 to set specific fields. 00167 """ 00168 if args or kwds: 00169 super(UpdateMapRequest, self).__init__(*args, **kwds) 00170 #message fields cannot be None, assign default values for those that are 00171 if self.map is None: 00172 self.map = cob_3d_mapping_msgs.msg.ShapeArray() 00173 else: 00174 self.map = cob_3d_mapping_msgs.msg.ShapeArray() 00175 00176 def _get_types(self): 00177 """ 00178 internal API method 00179 """ 00180 return self._slot_types 00181 00182 def serialize(self, buff): 00183 """ 00184 serialize message into buffer 00185 @param buff: buffer 00186 @type buff: StringIO 00187 """ 00188 try: 00189 _x = self 00190 buff.write(_struct_3I.pack(_x.map.header.seq, _x.map.header.stamp.secs, _x.map.header.stamp.nsecs)) 00191 _x = self.map.header.frame_id 00192 length = len(_x) 00193 buff.write(struct.pack('<I%ss'%length, length, _x)) 00194 length = len(self.map.shapes) 00195 buff.write(_struct_I.pack(length)) 00196 for val1 in self.map.shapes: 00197 _v1 = val1.header 00198 buff.write(_struct_I.pack(_v1.seq)) 00199 _v2 = _v1.stamp 00200 _x = _v2 00201 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00202 _x = _v1.frame_id 00203 length = len(_x) 00204 buff.write(struct.pack('<I%ss'%length, length, _x)) 00205 _x = val1 00206 buff.write(_struct_Bi.pack(_x.type, _x.id)) 00207 length = len(val1.params) 00208 buff.write(_struct_I.pack(length)) 00209 pattern = '<%sd'%length 00210 buff.write(struct.pack(pattern, *val1.params)) 00211 length = len(val1.points) 00212 buff.write(_struct_I.pack(length)) 00213 for val2 in val1.points: 00214 _v3 = val2.header 00215 buff.write(_struct_I.pack(_v3.seq)) 00216 _v4 = _v3.stamp 00217 _x = _v4 00218 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00219 _x = _v3.frame_id 00220 length = len(_x) 00221 buff.write(struct.pack('<I%ss'%length, length, _x)) 00222 _x = val2 00223 buff.write(_struct_2I.pack(_x.height, _x.width)) 00224 length = len(val2.fields) 00225 buff.write(_struct_I.pack(length)) 00226 for val3 in val2.fields: 00227 _x = val3.name 00228 length = len(_x) 00229 buff.write(struct.pack('<I%ss'%length, length, _x)) 00230 _x = val3 00231 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00232 _x = val2 00233 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 00234 _x = val2.data 00235 length = len(_x) 00236 # - if encoded as a list instead, serialize as bytes instead of string 00237 if type(_x) in [list, tuple]: 00238 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00239 else: 00240 buff.write(struct.pack('<I%ss'%length, length, _x)) 00241 buff.write(_struct_B.pack(val2.is_dense)) 00242 length = len(val1.vertices) 00243 buff.write(_struct_I.pack(length)) 00244 pattern = '<%si'%length 00245 buff.write(struct.pack(pattern, *val1.vertices)) 00246 _v5 = val1.centroid 00247 _x = _v5 00248 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00249 _v6 = val1.color 00250 _x = _v6 00251 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00252 length = len(val1.holes) 00253 buff.write(_struct_I.pack(length)) 00254 pattern = '<%sB'%length 00255 buff.write(struct.pack(pattern, *val1.holes)) 00256 except struct.error as se: self._check_types(se) 00257 except TypeError as te: self._check_types(te) 00258 00259 def deserialize(self, str): 00260 """ 00261 unpack serialized message in str into this message instance 00262 @param str: byte array of serialized message 00263 @type str: str 00264 """ 00265 try: 00266 if self.map is None: 00267 self.map = cob_3d_mapping_msgs.msg.ShapeArray() 00268 end = 0 00269 _x = self 00270 start = end 00271 end += 12 00272 (_x.map.header.seq, _x.map.header.stamp.secs, _x.map.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00273 start = end 00274 end += 4 00275 (length,) = _struct_I.unpack(str[start:end]) 00276 start = end 00277 end += length 00278 self.map.header.frame_id = str[start:end] 00279 start = end 00280 end += 4 00281 (length,) = _struct_I.unpack(str[start:end]) 00282 self.map.shapes = [] 00283 for i in range(0, length): 00284 val1 = cob_3d_mapping_msgs.msg.Shape() 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 += 5 00303 (_x.type, _x.id,) = _struct_Bi.unpack(str[start:end]) 00304 start = end 00305 end += 4 00306 (length,) = _struct_I.unpack(str[start:end]) 00307 pattern = '<%sd'%length 00308 start = end 00309 end += struct.calcsize(pattern) 00310 val1.params = struct.unpack(pattern, str[start:end]) 00311 start = end 00312 end += 4 00313 (length,) = _struct_I.unpack(str[start:end]) 00314 val1.points = [] 00315 for i in range(0, length): 00316 val2 = sensor_msgs.msg.PointCloud2() 00317 _v9 = val2.header 00318 start = end 00319 end += 4 00320 (_v9.seq,) = _struct_I.unpack(str[start:end]) 00321 _v10 = _v9.stamp 00322 _x = _v10 00323 start = end 00324 end += 8 00325 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00326 start = end 00327 end += 4 00328 (length,) = _struct_I.unpack(str[start:end]) 00329 start = end 00330 end += length 00331 _v9.frame_id = str[start:end] 00332 _x = val2 00333 start = end 00334 end += 8 00335 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00336 start = end 00337 end += 4 00338 (length,) = _struct_I.unpack(str[start:end]) 00339 val2.fields = [] 00340 for i in range(0, length): 00341 val3 = sensor_msgs.msg.PointField() 00342 start = end 00343 end += 4 00344 (length,) = _struct_I.unpack(str[start:end]) 00345 start = end 00346 end += length 00347 val3.name = str[start:end] 00348 _x = val3 00349 start = end 00350 end += 9 00351 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00352 val2.fields.append(val3) 00353 _x = val2 00354 start = end 00355 end += 9 00356 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 00357 val2.is_bigendian = bool(val2.is_bigendian) 00358 start = end 00359 end += 4 00360 (length,) = _struct_I.unpack(str[start:end]) 00361 start = end 00362 end += length 00363 val2.data = str[start:end] 00364 start = end 00365 end += 1 00366 (val2.is_dense,) = _struct_B.unpack(str[start:end]) 00367 val2.is_dense = bool(val2.is_dense) 00368 val1.points.append(val2) 00369 start = end 00370 end += 4 00371 (length,) = _struct_I.unpack(str[start:end]) 00372 pattern = '<%si'%length 00373 start = end 00374 end += struct.calcsize(pattern) 00375 val1.vertices = struct.unpack(pattern, str[start:end]) 00376 _v11 = val1.centroid 00377 _x = _v11 00378 start = end 00379 end += 12 00380 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00381 _v12 = val1.color 00382 _x = _v12 00383 start = end 00384 end += 16 00385 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00386 start = end 00387 end += 4 00388 (length,) = _struct_I.unpack(str[start:end]) 00389 pattern = '<%sB'%length 00390 start = end 00391 end += struct.calcsize(pattern) 00392 val1.holes = struct.unpack(pattern, str[start:end]) 00393 val1.holes = map(bool, val1.holes) 00394 self.map.shapes.append(val1) 00395 return self 00396 except struct.error as e: 00397 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00398 00399 00400 def serialize_numpy(self, buff, numpy): 00401 """ 00402 serialize message with numpy array types into buffer 00403 @param buff: buffer 00404 @type buff: StringIO 00405 @param numpy: numpy python module 00406 @type numpy module 00407 """ 00408 try: 00409 _x = self 00410 buff.write(_struct_3I.pack(_x.map.header.seq, _x.map.header.stamp.secs, _x.map.header.stamp.nsecs)) 00411 _x = self.map.header.frame_id 00412 length = len(_x) 00413 buff.write(struct.pack('<I%ss'%length, length, _x)) 00414 length = len(self.map.shapes) 00415 buff.write(_struct_I.pack(length)) 00416 for val1 in self.map.shapes: 00417 _v13 = val1.header 00418 buff.write(_struct_I.pack(_v13.seq)) 00419 _v14 = _v13.stamp 00420 _x = _v14 00421 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00422 _x = _v13.frame_id 00423 length = len(_x) 00424 buff.write(struct.pack('<I%ss'%length, length, _x)) 00425 _x = val1 00426 buff.write(_struct_Bi.pack(_x.type, _x.id)) 00427 length = len(val1.params) 00428 buff.write(_struct_I.pack(length)) 00429 pattern = '<%sd'%length 00430 buff.write(val1.params.tostring()) 00431 length = len(val1.points) 00432 buff.write(_struct_I.pack(length)) 00433 for val2 in val1.points: 00434 _v15 = val2.header 00435 buff.write(_struct_I.pack(_v15.seq)) 00436 _v16 = _v15.stamp 00437 _x = _v16 00438 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00439 _x = _v15.frame_id 00440 length = len(_x) 00441 buff.write(struct.pack('<I%ss'%length, length, _x)) 00442 _x = val2 00443 buff.write(_struct_2I.pack(_x.height, _x.width)) 00444 length = len(val2.fields) 00445 buff.write(_struct_I.pack(length)) 00446 for val3 in val2.fields: 00447 _x = val3.name 00448 length = len(_x) 00449 buff.write(struct.pack('<I%ss'%length, length, _x)) 00450 _x = val3 00451 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00452 _x = val2 00453 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 00454 _x = val2.data 00455 length = len(_x) 00456 # - if encoded as a list instead, serialize as bytes instead of string 00457 if type(_x) in [list, tuple]: 00458 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00459 else: 00460 buff.write(struct.pack('<I%ss'%length, length, _x)) 00461 buff.write(_struct_B.pack(val2.is_dense)) 00462 length = len(val1.vertices) 00463 buff.write(_struct_I.pack(length)) 00464 pattern = '<%si'%length 00465 buff.write(val1.vertices.tostring()) 00466 _v17 = val1.centroid 00467 _x = _v17 00468 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00469 _v18 = val1.color 00470 _x = _v18 00471 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00472 length = len(val1.holes) 00473 buff.write(_struct_I.pack(length)) 00474 pattern = '<%sB'%length 00475 buff.write(val1.holes.tostring()) 00476 except struct.error as se: self._check_types(se) 00477 except TypeError as te: self._check_types(te) 00478 00479 def deserialize_numpy(self, str, numpy): 00480 """ 00481 unpack serialized message in str into this message instance using numpy for array types 00482 @param str: byte array of serialized message 00483 @type str: str 00484 @param numpy: numpy python module 00485 @type numpy: module 00486 """ 00487 try: 00488 if self.map is None: 00489 self.map = cob_3d_mapping_msgs.msg.ShapeArray() 00490 end = 0 00491 _x = self 00492 start = end 00493 end += 12 00494 (_x.map.header.seq, _x.map.header.stamp.secs, _x.map.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00495 start = end 00496 end += 4 00497 (length,) = _struct_I.unpack(str[start:end]) 00498 start = end 00499 end += length 00500 self.map.header.frame_id = str[start:end] 00501 start = end 00502 end += 4 00503 (length,) = _struct_I.unpack(str[start:end]) 00504 self.map.shapes = [] 00505 for i in range(0, length): 00506 val1 = cob_3d_mapping_msgs.msg.Shape() 00507 _v19 = val1.header 00508 start = end 00509 end += 4 00510 (_v19.seq,) = _struct_I.unpack(str[start:end]) 00511 _v20 = _v19.stamp 00512 _x = _v20 00513 start = end 00514 end += 8 00515 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00516 start = end 00517 end += 4 00518 (length,) = _struct_I.unpack(str[start:end]) 00519 start = end 00520 end += length 00521 _v19.frame_id = str[start:end] 00522 _x = val1 00523 start = end 00524 end += 5 00525 (_x.type, _x.id,) = _struct_Bi.unpack(str[start:end]) 00526 start = end 00527 end += 4 00528 (length,) = _struct_I.unpack(str[start:end]) 00529 pattern = '<%sd'%length 00530 start = end 00531 end += struct.calcsize(pattern) 00532 val1.params = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00533 start = end 00534 end += 4 00535 (length,) = _struct_I.unpack(str[start:end]) 00536 val1.points = [] 00537 for i in range(0, length): 00538 val2 = sensor_msgs.msg.PointCloud2() 00539 _v21 = val2.header 00540 start = end 00541 end += 4 00542 (_v21.seq,) = _struct_I.unpack(str[start:end]) 00543 _v22 = _v21.stamp 00544 _x = _v22 00545 start = end 00546 end += 8 00547 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00548 start = end 00549 end += 4 00550 (length,) = _struct_I.unpack(str[start:end]) 00551 start = end 00552 end += length 00553 _v21.frame_id = str[start:end] 00554 _x = val2 00555 start = end 00556 end += 8 00557 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00558 start = end 00559 end += 4 00560 (length,) = _struct_I.unpack(str[start:end]) 00561 val2.fields = [] 00562 for i in range(0, length): 00563 val3 = sensor_msgs.msg.PointField() 00564 start = end 00565 end += 4 00566 (length,) = _struct_I.unpack(str[start:end]) 00567 start = end 00568 end += length 00569 val3.name = str[start:end] 00570 _x = val3 00571 start = end 00572 end += 9 00573 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00574 val2.fields.append(val3) 00575 _x = val2 00576 start = end 00577 end += 9 00578 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 00579 val2.is_bigendian = bool(val2.is_bigendian) 00580 start = end 00581 end += 4 00582 (length,) = _struct_I.unpack(str[start:end]) 00583 start = end 00584 end += length 00585 val2.data = str[start:end] 00586 start = end 00587 end += 1 00588 (val2.is_dense,) = _struct_B.unpack(str[start:end]) 00589 val2.is_dense = bool(val2.is_dense) 00590 val1.points.append(val2) 00591 start = end 00592 end += 4 00593 (length,) = _struct_I.unpack(str[start:end]) 00594 pattern = '<%si'%length 00595 start = end 00596 end += struct.calcsize(pattern) 00597 val1.vertices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00598 _v23 = val1.centroid 00599 _x = _v23 00600 start = end 00601 end += 12 00602 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00603 _v24 = val1.color 00604 _x = _v24 00605 start = end 00606 end += 16 00607 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00608 start = end 00609 end += 4 00610 (length,) = _struct_I.unpack(str[start:end]) 00611 pattern = '<%sB'%length 00612 start = end 00613 end += struct.calcsize(pattern) 00614 val1.holes = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length) 00615 val1.holes = map(bool, val1.holes) 00616 self.map.shapes.append(val1) 00617 return self 00618 except struct.error as e: 00619 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00620 00621 _struct_I = roslib.message.struct_I 00622 _struct_IBI = struct.Struct("<IBI") 00623 _struct_B = struct.Struct("<B") 00624 _struct_Bi = struct.Struct("<Bi") 00625 _struct_3f = struct.Struct("<3f") 00626 _struct_3I = struct.Struct("<3I") 00627 _struct_B2I = struct.Struct("<B2I") 00628 _struct_4f = struct.Struct("<4f") 00629 _struct_2I = struct.Struct("<2I") 00630 """autogenerated by genmsg_py from UpdateMapResponse.msg. Do not edit.""" 00631 import roslib.message 00632 import struct 00633 00634 import geometry_msgs.msg 00635 import sensor_msgs.msg 00636 import cob_3d_mapping_msgs.msg 00637 import std_msgs.msg 00638 00639 class UpdateMapResponse(roslib.message.Message): 00640 _md5sum = "f0bf8d67881fb4de54c9e8a9fee43e78" 00641 _type = "cob_3d_mapping_msgs/UpdateMapResponse" 00642 _has_header = False #flag to mark the presence of a Header object 00643 _full_text = """cob_3d_mapping_msgs/ShapeArray map 00644 00645 00646 ================================================================================ 00647 MSG: cob_3d_mapping_msgs/ShapeArray 00648 # An array of poses with a header for global reference. 00649 00650 Header header 00651 00652 cob_3d_mapping_msgs/Shape[] shapes 00653 ================================================================================ 00654 MSG: std_msgs/Header 00655 # Standard metadata for higher-level stamped data types. 00656 # This is generally used to communicate timestamped data 00657 # in a particular coordinate frame. 00658 # 00659 # sequence ID: consecutively increasing ID 00660 uint32 seq 00661 #Two-integer timestamp that is expressed as: 00662 # * stamp.secs: seconds (stamp_secs) since epoch 00663 # * stamp.nsecs: nanoseconds since stamp_secs 00664 # time-handling sugar is provided by the client library 00665 time stamp 00666 #Frame this data is associated with 00667 # 0: no frame 00668 # 1: global frame 00669 string frame_id 00670 00671 ================================================================================ 00672 MSG: cob_3d_mapping_msgs/Shape 00673 Header header 00674 00675 uint8 POLYGON=0 00676 uint8 LINE=1 00677 uint8 CURVED=2 00678 uint8 MESH=3 00679 uint8 OTHER=4 00680 uint8 CYLINDER=5 00681 # potential extensions: SPHERE, CYLINDER, BOX 00682 00683 uint8 type 00684 00685 00686 int32 id 00687 # define shape parameters 00688 # for plane 00689 # normal vector = params[0],params[1],params[2] 00690 # d = params[3] 00691 # for line 00692 # direction vector = params[0],params[1],params[2] 00693 # 00694 #for cylinder 00695 # symmetry axis = params[0],params[1],params[2] 00696 # z axis = params[3], params[4], params[5] 00697 # origin = params[6], params[7], params[8] 00698 # radius = params[9] 00699 # 00700 float64[] params 00701 00702 sensor_msgs/PointCloud2[] points 00703 00704 #### define mesh #### 00705 # each three entries form a triangle; indices of points are stored 00706 int32[] vertices 00707 00708 geometry_msgs/Point32 centroid 00709 std_msgs/ColorRGBA color 00710 bool[] holes 00711 00712 ================================================================================ 00713 MSG: sensor_msgs/PointCloud2 00714 # This message holds a collection of N-dimensional points, which may 00715 # contain additional information such as normals, intensity, etc. The 00716 # point data is stored as a binary blob, its layout described by the 00717 # contents of the "fields" array. 00718 00719 # The point cloud data may be organized 2d (image-like) or 1d 00720 # (unordered). Point clouds organized as 2d images may be produced by 00721 # camera depth sensors such as stereo or time-of-flight. 00722 00723 # Time of sensor data acquisition, and the coordinate frame ID (for 3d 00724 # points). 00725 Header header 00726 00727 # 2D structure of the point cloud. If the cloud is unordered, height is 00728 # 1 and width is the length of the point cloud. 00729 uint32 height 00730 uint32 width 00731 00732 # Describes the channels and their layout in the binary data blob. 00733 PointField[] fields 00734 00735 bool is_bigendian # Is this data bigendian? 00736 uint32 point_step # Length of a point in bytes 00737 uint32 row_step # Length of a row in bytes 00738 uint8[] data # Actual point data, size is (row_step*height) 00739 00740 bool is_dense # True if there are no invalid points 00741 00742 ================================================================================ 00743 MSG: sensor_msgs/PointField 00744 # This message holds the description of one point entry in the 00745 # PointCloud2 message format. 00746 uint8 INT8 = 1 00747 uint8 UINT8 = 2 00748 uint8 INT16 = 3 00749 uint8 UINT16 = 4 00750 uint8 INT32 = 5 00751 uint8 UINT32 = 6 00752 uint8 FLOAT32 = 7 00753 uint8 FLOAT64 = 8 00754 00755 string name # Name of field 00756 uint32 offset # Offset from start of point struct 00757 uint8 datatype # Datatype enumeration, see above 00758 uint32 count # How many elements in the field 00759 00760 ================================================================================ 00761 MSG: geometry_msgs/Point32 00762 # This contains the position of a point in free space(with 32 bits of precision). 00763 # It is recommeded to use Point wherever possible instead of Point32. 00764 # 00765 # This recommendation is to promote interoperability. 00766 # 00767 # This message is designed to take up less space when sending 00768 # lots of points at once, as in the case of a PointCloud. 00769 00770 float32 x 00771 float32 y 00772 float32 z 00773 ================================================================================ 00774 MSG: std_msgs/ColorRGBA 00775 float32 r 00776 float32 g 00777 float32 b 00778 float32 a 00779 00780 """ 00781 __slots__ = ['map'] 00782 _slot_types = ['cob_3d_mapping_msgs/ShapeArray'] 00783 00784 def __init__(self, *args, **kwds): 00785 """ 00786 Constructor. Any message fields that are implicitly/explicitly 00787 set to None will be assigned a default value. The recommend 00788 use is keyword arguments as this is more robust to future message 00789 changes. You cannot mix in-order arguments and keyword arguments. 00790 00791 The available fields are: 00792 map 00793 00794 @param args: complete set of field values, in .msg order 00795 @param kwds: use keyword arguments corresponding to message field names 00796 to set specific fields. 00797 """ 00798 if args or kwds: 00799 super(UpdateMapResponse, self).__init__(*args, **kwds) 00800 #message fields cannot be None, assign default values for those that are 00801 if self.map is None: 00802 self.map = cob_3d_mapping_msgs.msg.ShapeArray() 00803 else: 00804 self.map = cob_3d_mapping_msgs.msg.ShapeArray() 00805 00806 def _get_types(self): 00807 """ 00808 internal API method 00809 """ 00810 return self._slot_types 00811 00812 def serialize(self, buff): 00813 """ 00814 serialize message into buffer 00815 @param buff: buffer 00816 @type buff: StringIO 00817 """ 00818 try: 00819 _x = self 00820 buff.write(_struct_3I.pack(_x.map.header.seq, _x.map.header.stamp.secs, _x.map.header.stamp.nsecs)) 00821 _x = self.map.header.frame_id 00822 length = len(_x) 00823 buff.write(struct.pack('<I%ss'%length, length, _x)) 00824 length = len(self.map.shapes) 00825 buff.write(_struct_I.pack(length)) 00826 for val1 in self.map.shapes: 00827 _v25 = val1.header 00828 buff.write(_struct_I.pack(_v25.seq)) 00829 _v26 = _v25.stamp 00830 _x = _v26 00831 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00832 _x = _v25.frame_id 00833 length = len(_x) 00834 buff.write(struct.pack('<I%ss'%length, length, _x)) 00835 _x = val1 00836 buff.write(_struct_Bi.pack(_x.type, _x.id)) 00837 length = len(val1.params) 00838 buff.write(_struct_I.pack(length)) 00839 pattern = '<%sd'%length 00840 buff.write(struct.pack(pattern, *val1.params)) 00841 length = len(val1.points) 00842 buff.write(_struct_I.pack(length)) 00843 for val2 in val1.points: 00844 _v27 = val2.header 00845 buff.write(_struct_I.pack(_v27.seq)) 00846 _v28 = _v27.stamp 00847 _x = _v28 00848 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00849 _x = _v27.frame_id 00850 length = len(_x) 00851 buff.write(struct.pack('<I%ss'%length, length, _x)) 00852 _x = val2 00853 buff.write(_struct_2I.pack(_x.height, _x.width)) 00854 length = len(val2.fields) 00855 buff.write(_struct_I.pack(length)) 00856 for val3 in val2.fields: 00857 _x = val3.name 00858 length = len(_x) 00859 buff.write(struct.pack('<I%ss'%length, length, _x)) 00860 _x = val3 00861 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00862 _x = val2 00863 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 00864 _x = val2.data 00865 length = len(_x) 00866 # - if encoded as a list instead, serialize as bytes instead of string 00867 if type(_x) in [list, tuple]: 00868 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00869 else: 00870 buff.write(struct.pack('<I%ss'%length, length, _x)) 00871 buff.write(_struct_B.pack(val2.is_dense)) 00872 length = len(val1.vertices) 00873 buff.write(_struct_I.pack(length)) 00874 pattern = '<%si'%length 00875 buff.write(struct.pack(pattern, *val1.vertices)) 00876 _v29 = val1.centroid 00877 _x = _v29 00878 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00879 _v30 = val1.color 00880 _x = _v30 00881 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00882 length = len(val1.holes) 00883 buff.write(_struct_I.pack(length)) 00884 pattern = '<%sB'%length 00885 buff.write(struct.pack(pattern, *val1.holes)) 00886 except struct.error as se: self._check_types(se) 00887 except TypeError as te: self._check_types(te) 00888 00889 def deserialize(self, str): 00890 """ 00891 unpack serialized message in str into this message instance 00892 @param str: byte array of serialized message 00893 @type str: str 00894 """ 00895 try: 00896 if self.map is None: 00897 self.map = cob_3d_mapping_msgs.msg.ShapeArray() 00898 end = 0 00899 _x = self 00900 start = end 00901 end += 12 00902 (_x.map.header.seq, _x.map.header.stamp.secs, _x.map.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00903 start = end 00904 end += 4 00905 (length,) = _struct_I.unpack(str[start:end]) 00906 start = end 00907 end += length 00908 self.map.header.frame_id = str[start:end] 00909 start = end 00910 end += 4 00911 (length,) = _struct_I.unpack(str[start:end]) 00912 self.map.shapes = [] 00913 for i in range(0, length): 00914 val1 = cob_3d_mapping_msgs.msg.Shape() 00915 _v31 = val1.header 00916 start = end 00917 end += 4 00918 (_v31.seq,) = _struct_I.unpack(str[start:end]) 00919 _v32 = _v31.stamp 00920 _x = _v32 00921 start = end 00922 end += 8 00923 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00924 start = end 00925 end += 4 00926 (length,) = _struct_I.unpack(str[start:end]) 00927 start = end 00928 end += length 00929 _v31.frame_id = str[start:end] 00930 _x = val1 00931 start = end 00932 end += 5 00933 (_x.type, _x.id,) = _struct_Bi.unpack(str[start:end]) 00934 start = end 00935 end += 4 00936 (length,) = _struct_I.unpack(str[start:end]) 00937 pattern = '<%sd'%length 00938 start = end 00939 end += struct.calcsize(pattern) 00940 val1.params = struct.unpack(pattern, str[start:end]) 00941 start = end 00942 end += 4 00943 (length,) = _struct_I.unpack(str[start:end]) 00944 val1.points = [] 00945 for i in range(0, length): 00946 val2 = sensor_msgs.msg.PointCloud2() 00947 _v33 = val2.header 00948 start = end 00949 end += 4 00950 (_v33.seq,) = _struct_I.unpack(str[start:end]) 00951 _v34 = _v33.stamp 00952 _x = _v34 00953 start = end 00954 end += 8 00955 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00956 start = end 00957 end += 4 00958 (length,) = _struct_I.unpack(str[start:end]) 00959 start = end 00960 end += length 00961 _v33.frame_id = str[start:end] 00962 _x = val2 00963 start = end 00964 end += 8 00965 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00966 start = end 00967 end += 4 00968 (length,) = _struct_I.unpack(str[start:end]) 00969 val2.fields = [] 00970 for i in range(0, length): 00971 val3 = sensor_msgs.msg.PointField() 00972 start = end 00973 end += 4 00974 (length,) = _struct_I.unpack(str[start:end]) 00975 start = end 00976 end += length 00977 val3.name = str[start:end] 00978 _x = val3 00979 start = end 00980 end += 9 00981 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00982 val2.fields.append(val3) 00983 _x = val2 00984 start = end 00985 end += 9 00986 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 00987 val2.is_bigendian = bool(val2.is_bigendian) 00988 start = end 00989 end += 4 00990 (length,) = _struct_I.unpack(str[start:end]) 00991 start = end 00992 end += length 00993 val2.data = str[start:end] 00994 start = end 00995 end += 1 00996 (val2.is_dense,) = _struct_B.unpack(str[start:end]) 00997 val2.is_dense = bool(val2.is_dense) 00998 val1.points.append(val2) 00999 start = end 01000 end += 4 01001 (length,) = _struct_I.unpack(str[start:end]) 01002 pattern = '<%si'%length 01003 start = end 01004 end += struct.calcsize(pattern) 01005 val1.vertices = struct.unpack(pattern, str[start:end]) 01006 _v35 = val1.centroid 01007 _x = _v35 01008 start = end 01009 end += 12 01010 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 01011 _v36 = val1.color 01012 _x = _v36 01013 start = end 01014 end += 16 01015 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 01016 start = end 01017 end += 4 01018 (length,) = _struct_I.unpack(str[start:end]) 01019 pattern = '<%sB'%length 01020 start = end 01021 end += struct.calcsize(pattern) 01022 val1.holes = struct.unpack(pattern, str[start:end]) 01023 val1.holes = map(bool, val1.holes) 01024 self.map.shapes.append(val1) 01025 return self 01026 except struct.error as e: 01027 raise roslib.message.DeserializationError(e) #most likely buffer underfill 01028 01029 01030 def serialize_numpy(self, buff, numpy): 01031 """ 01032 serialize message with numpy array types into buffer 01033 @param buff: buffer 01034 @type buff: StringIO 01035 @param numpy: numpy python module 01036 @type numpy module 01037 """ 01038 try: 01039 _x = self 01040 buff.write(_struct_3I.pack(_x.map.header.seq, _x.map.header.stamp.secs, _x.map.header.stamp.nsecs)) 01041 _x = self.map.header.frame_id 01042 length = len(_x) 01043 buff.write(struct.pack('<I%ss'%length, length, _x)) 01044 length = len(self.map.shapes) 01045 buff.write(_struct_I.pack(length)) 01046 for val1 in self.map.shapes: 01047 _v37 = val1.header 01048 buff.write(_struct_I.pack(_v37.seq)) 01049 _v38 = _v37.stamp 01050 _x = _v38 01051 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01052 _x = _v37.frame_id 01053 length = len(_x) 01054 buff.write(struct.pack('<I%ss'%length, length, _x)) 01055 _x = val1 01056 buff.write(_struct_Bi.pack(_x.type, _x.id)) 01057 length = len(val1.params) 01058 buff.write(_struct_I.pack(length)) 01059 pattern = '<%sd'%length 01060 buff.write(val1.params.tostring()) 01061 length = len(val1.points) 01062 buff.write(_struct_I.pack(length)) 01063 for val2 in val1.points: 01064 _v39 = val2.header 01065 buff.write(_struct_I.pack(_v39.seq)) 01066 _v40 = _v39.stamp 01067 _x = _v40 01068 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01069 _x = _v39.frame_id 01070 length = len(_x) 01071 buff.write(struct.pack('<I%ss'%length, length, _x)) 01072 _x = val2 01073 buff.write(_struct_2I.pack(_x.height, _x.width)) 01074 length = len(val2.fields) 01075 buff.write(_struct_I.pack(length)) 01076 for val3 in val2.fields: 01077 _x = val3.name 01078 length = len(_x) 01079 buff.write(struct.pack('<I%ss'%length, length, _x)) 01080 _x = val3 01081 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 01082 _x = val2 01083 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 01084 _x = val2.data 01085 length = len(_x) 01086 # - if encoded as a list instead, serialize as bytes instead of string 01087 if type(_x) in [list, tuple]: 01088 buff.write(struct.pack('<I%sB'%length, length, *_x)) 01089 else: 01090 buff.write(struct.pack('<I%ss'%length, length, _x)) 01091 buff.write(_struct_B.pack(val2.is_dense)) 01092 length = len(val1.vertices) 01093 buff.write(_struct_I.pack(length)) 01094 pattern = '<%si'%length 01095 buff.write(val1.vertices.tostring()) 01096 _v41 = val1.centroid 01097 _x = _v41 01098 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 01099 _v42 = val1.color 01100 _x = _v42 01101 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 01102 length = len(val1.holes) 01103 buff.write(_struct_I.pack(length)) 01104 pattern = '<%sB'%length 01105 buff.write(val1.holes.tostring()) 01106 except struct.error as se: self._check_types(se) 01107 except TypeError as te: self._check_types(te) 01108 01109 def deserialize_numpy(self, str, numpy): 01110 """ 01111 unpack serialized message in str into this message instance using numpy for array types 01112 @param str: byte array of serialized message 01113 @type str: str 01114 @param numpy: numpy python module 01115 @type numpy: module 01116 """ 01117 try: 01118 if self.map is None: 01119 self.map = cob_3d_mapping_msgs.msg.ShapeArray() 01120 end = 0 01121 _x = self 01122 start = end 01123 end += 12 01124 (_x.map.header.seq, _x.map.header.stamp.secs, _x.map.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 01125 start = end 01126 end += 4 01127 (length,) = _struct_I.unpack(str[start:end]) 01128 start = end 01129 end += length 01130 self.map.header.frame_id = str[start:end] 01131 start = end 01132 end += 4 01133 (length,) = _struct_I.unpack(str[start:end]) 01134 self.map.shapes = [] 01135 for i in range(0, length): 01136 val1 = cob_3d_mapping_msgs.msg.Shape() 01137 _v43 = val1.header 01138 start = end 01139 end += 4 01140 (_v43.seq,) = _struct_I.unpack(str[start:end]) 01141 _v44 = _v43.stamp 01142 _x = _v44 01143 start = end 01144 end += 8 01145 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01146 start = end 01147 end += 4 01148 (length,) = _struct_I.unpack(str[start:end]) 01149 start = end 01150 end += length 01151 _v43.frame_id = str[start:end] 01152 _x = val1 01153 start = end 01154 end += 5 01155 (_x.type, _x.id,) = _struct_Bi.unpack(str[start:end]) 01156 start = end 01157 end += 4 01158 (length,) = _struct_I.unpack(str[start:end]) 01159 pattern = '<%sd'%length 01160 start = end 01161 end += struct.calcsize(pattern) 01162 val1.params = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 01163 start = end 01164 end += 4 01165 (length,) = _struct_I.unpack(str[start:end]) 01166 val1.points = [] 01167 for i in range(0, length): 01168 val2 = sensor_msgs.msg.PointCloud2() 01169 _v45 = val2.header 01170 start = end 01171 end += 4 01172 (_v45.seq,) = _struct_I.unpack(str[start:end]) 01173 _v46 = _v45.stamp 01174 _x = _v46 01175 start = end 01176 end += 8 01177 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01178 start = end 01179 end += 4 01180 (length,) = _struct_I.unpack(str[start:end]) 01181 start = end 01182 end += length 01183 _v45.frame_id = str[start:end] 01184 _x = val2 01185 start = end 01186 end += 8 01187 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 01188 start = end 01189 end += 4 01190 (length,) = _struct_I.unpack(str[start:end]) 01191 val2.fields = [] 01192 for i in range(0, length): 01193 val3 = sensor_msgs.msg.PointField() 01194 start = end 01195 end += 4 01196 (length,) = _struct_I.unpack(str[start:end]) 01197 start = end 01198 end += length 01199 val3.name = str[start:end] 01200 _x = val3 01201 start = end 01202 end += 9 01203 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 01204 val2.fields.append(val3) 01205 _x = val2 01206 start = end 01207 end += 9 01208 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 01209 val2.is_bigendian = bool(val2.is_bigendian) 01210 start = end 01211 end += 4 01212 (length,) = _struct_I.unpack(str[start:end]) 01213 start = end 01214 end += length 01215 val2.data = str[start:end] 01216 start = end 01217 end += 1 01218 (val2.is_dense,) = _struct_B.unpack(str[start:end]) 01219 val2.is_dense = bool(val2.is_dense) 01220 val1.points.append(val2) 01221 start = end 01222 end += 4 01223 (length,) = _struct_I.unpack(str[start:end]) 01224 pattern = '<%si'%length 01225 start = end 01226 end += struct.calcsize(pattern) 01227 val1.vertices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 01228 _v47 = val1.centroid 01229 _x = _v47 01230 start = end 01231 end += 12 01232 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 01233 _v48 = val1.color 01234 _x = _v48 01235 start = end 01236 end += 16 01237 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 01238 start = end 01239 end += 4 01240 (length,) = _struct_I.unpack(str[start:end]) 01241 pattern = '<%sB'%length 01242 start = end 01243 end += struct.calcsize(pattern) 01244 val1.holes = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length) 01245 val1.holes = map(bool, val1.holes) 01246 self.map.shapes.append(val1) 01247 return self 01248 except struct.error as e: 01249 raise roslib.message.DeserializationError(e) #most likely buffer underfill 01250 01251 _struct_I = roslib.message.struct_I 01252 _struct_IBI = struct.Struct("<IBI") 01253 _struct_B = struct.Struct("<B") 01254 _struct_Bi = struct.Struct("<Bi") 01255 _struct_3f = struct.Struct("<3f") 01256 _struct_3I = struct.Struct("<3I") 01257 _struct_B2I = struct.Struct("<B2I") 01258 _struct_4f = struct.Struct("<4f") 01259 _struct_2I = struct.Struct("<2I") 01260 class UpdateMap(roslib.message.ServiceDefinition): 01261 _type = 'cob_3d_mapping_msgs/UpdateMap' 01262 _md5sum = 'c7e75b0cd41a377fc820044b5753691c' 01263 _request_class = UpdateMapRequest 01264 _response_class = UpdateMapResponse