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