$search
00001 """autogenerated by genmsg_py from ScanMap.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import flirtlib_ros.msg 00006 import geometry_msgs.msg 00007 import std_msgs.msg 00008 import sensor_msgs.msg 00009 00010 class ScanMap(roslib.message.Message): 00011 _md5sum = "026e963f013904b1ec1b7676cf837306" 00012 _type = "flirtlib_ros/ScanMap" 00013 _has_header = False #flag to mark the presence of a Header object 00014 _full_text = """RefScanRos[] scans 00015 ================================================================================ 00016 MSG: flirtlib_ros/RefScanRos 00017 sensor_msgs/LaserScan scan 00018 geometry_msgs/Pose pose 00019 InterestPointRos[] pts 00020 ================================================================================ 00021 MSG: sensor_msgs/LaserScan 00022 # Single scan from a planar laser range-finder 00023 # 00024 # If you have another ranging device with different behavior (e.g. a sonar 00025 # array), please find or create a different message, since applications 00026 # will make fairly laser-specific assumptions about this data 00027 00028 Header header # timestamp in the header is the acquisition time of 00029 # the first ray in the scan. 00030 # 00031 # in frame frame_id, angles are measured around 00032 # the positive Z axis (counterclockwise, if Z is up) 00033 # with zero angle being forward along the x axis 00034 00035 float32 angle_min # start angle of the scan [rad] 00036 float32 angle_max # end angle of the scan [rad] 00037 float32 angle_increment # angular distance between measurements [rad] 00038 00039 float32 time_increment # time between measurements [seconds] - if your scanner 00040 # is moving, this will be used in interpolating position 00041 # of 3d points 00042 float32 scan_time # time between scans [seconds] 00043 00044 float32 range_min # minimum range value [m] 00045 float32 range_max # maximum range value [m] 00046 00047 float32[] ranges # range data [m] (Note: values < range_min or > range_max should be discarded) 00048 float32[] intensities # intensity data [device-specific units]. If your 00049 # device does not provide intensities, please leave 00050 # the array empty. 00051 00052 ================================================================================ 00053 MSG: std_msgs/Header 00054 # Standard metadata for higher-level stamped data types. 00055 # This is generally used to communicate timestamped data 00056 # in a particular coordinate frame. 00057 # 00058 # sequence ID: consecutively increasing ID 00059 uint32 seq 00060 #Two-integer timestamp that is expressed as: 00061 # * stamp.secs: seconds (stamp_secs) since epoch 00062 # * stamp.nsecs: nanoseconds since stamp_secs 00063 # time-handling sugar is provided by the client library 00064 time stamp 00065 #Frame this data is associated with 00066 # 0: no frame 00067 # 1: global frame 00068 string frame_id 00069 00070 ================================================================================ 00071 MSG: geometry_msgs/Pose 00072 # A representation of pose in free space, composed of postion and orientation. 00073 Point position 00074 Quaternion orientation 00075 00076 ================================================================================ 00077 MSG: geometry_msgs/Point 00078 # This contains the position of a point in free space 00079 float64 x 00080 float64 y 00081 float64 z 00082 00083 ================================================================================ 00084 MSG: geometry_msgs/Quaternion 00085 # This represents an orientation in free space in quaternion form. 00086 00087 float64 x 00088 float64 y 00089 float64 z 00090 float64 w 00091 00092 ================================================================================ 00093 MSG: flirtlib_ros/InterestPointRos 00094 # Corresponds to the InterestPoint type in flirtlib 00095 # Includes both the point location and optionally a descriptor 00096 00097 geometry_msgs/Pose2D pose 00098 00099 geometry_msgs/Point[] support_points 00100 00101 float32 scale 00102 00103 uint32 scale_level 00104 00105 DescriptorRos descriptor 00106 00107 00108 ================================================================================ 00109 MSG: geometry_msgs/Pose2D 00110 # This expresses a position and orientation on a 2D manifold. 00111 00112 float64 x 00113 float64 y 00114 float64 theta 00115 ================================================================================ 00116 MSG: flirtlib_ros/DescriptorRos 00117 # Confirms to the Descriptor type in flirtlib 00118 # For now, we only allow the beta grid descriptor 00119 00120 Vector[] hist 00121 Vector[] variance 00122 Vector[] hit 00123 Vector[] miss 00124 00125 ================================================================================ 00126 MSG: flirtlib_ros/Vector 00127 # Vector message type used by a bunch of the flirtlib messages 00128 00129 float64[] vec 00130 """ 00131 __slots__ = ['scans'] 00132 _slot_types = ['flirtlib_ros/RefScanRos[]'] 00133 00134 def __init__(self, *args, **kwds): 00135 """ 00136 Constructor. Any message fields that are implicitly/explicitly 00137 set to None will be assigned a default value. The recommend 00138 use is keyword arguments as this is more robust to future message 00139 changes. You cannot mix in-order arguments and keyword arguments. 00140 00141 The available fields are: 00142 scans 00143 00144 @param args: complete set of field values, in .msg order 00145 @param kwds: use keyword arguments corresponding to message field names 00146 to set specific fields. 00147 """ 00148 if args or kwds: 00149 super(ScanMap, self).__init__(*args, **kwds) 00150 #message fields cannot be None, assign default values for those that are 00151 if self.scans is None: 00152 self.scans = [] 00153 else: 00154 self.scans = [] 00155 00156 def _get_types(self): 00157 """ 00158 internal API method 00159 """ 00160 return self._slot_types 00161 00162 def serialize(self, buff): 00163 """ 00164 serialize message into buffer 00165 @param buff: buffer 00166 @type buff: StringIO 00167 """ 00168 try: 00169 length = len(self.scans) 00170 buff.write(_struct_I.pack(length)) 00171 for val1 in self.scans: 00172 _v1 = val1.scan 00173 _v2 = _v1.header 00174 buff.write(_struct_I.pack(_v2.seq)) 00175 _v3 = _v2.stamp 00176 _x = _v3 00177 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00178 _x = _v2.frame_id 00179 length = len(_x) 00180 buff.write(struct.pack('<I%ss'%length, length, _x)) 00181 _x = _v1 00182 buff.write(_struct_7f.pack(_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.scan_time, _x.range_min, _x.range_max)) 00183 length = len(_v1.ranges) 00184 buff.write(_struct_I.pack(length)) 00185 pattern = '<%sf'%length 00186 buff.write(struct.pack(pattern, *_v1.ranges)) 00187 length = len(_v1.intensities) 00188 buff.write(_struct_I.pack(length)) 00189 pattern = '<%sf'%length 00190 buff.write(struct.pack(pattern, *_v1.intensities)) 00191 _v4 = val1.pose 00192 _v5 = _v4.position 00193 _x = _v5 00194 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00195 _v6 = _v4.orientation 00196 _x = _v6 00197 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00198 length = len(val1.pts) 00199 buff.write(_struct_I.pack(length)) 00200 for val2 in val1.pts: 00201 _v7 = val2.pose 00202 _x = _v7 00203 buff.write(_struct_3d.pack(_x.x, _x.y, _x.theta)) 00204 length = len(val2.support_points) 00205 buff.write(_struct_I.pack(length)) 00206 for val3 in val2.support_points: 00207 _x = val3 00208 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00209 _x = val2 00210 buff.write(_struct_fI.pack(_x.scale, _x.scale_level)) 00211 _v8 = val2.descriptor 00212 length = len(_v8.hist) 00213 buff.write(_struct_I.pack(length)) 00214 for val4 in _v8.hist: 00215 length = len(val4.vec) 00216 buff.write(_struct_I.pack(length)) 00217 pattern = '<%sd'%length 00218 buff.write(struct.pack(pattern, *val4.vec)) 00219 length = len(_v8.variance) 00220 buff.write(_struct_I.pack(length)) 00221 for val4 in _v8.variance: 00222 length = len(val4.vec) 00223 buff.write(_struct_I.pack(length)) 00224 pattern = '<%sd'%length 00225 buff.write(struct.pack(pattern, *val4.vec)) 00226 length = len(_v8.hit) 00227 buff.write(_struct_I.pack(length)) 00228 for val4 in _v8.hit: 00229 length = len(val4.vec) 00230 buff.write(_struct_I.pack(length)) 00231 pattern = '<%sd'%length 00232 buff.write(struct.pack(pattern, *val4.vec)) 00233 length = len(_v8.miss) 00234 buff.write(_struct_I.pack(length)) 00235 for val4 in _v8.miss: 00236 length = len(val4.vec) 00237 buff.write(_struct_I.pack(length)) 00238 pattern = '<%sd'%length 00239 buff.write(struct.pack(pattern, *val4.vec)) 00240 except struct.error as se: self._check_types(se) 00241 except TypeError as te: self._check_types(te) 00242 00243 def deserialize(self, str): 00244 """ 00245 unpack serialized message in str into this message instance 00246 @param str: byte array of serialized message 00247 @type str: str 00248 """ 00249 try: 00250 end = 0 00251 start = end 00252 end += 4 00253 (length,) = _struct_I.unpack(str[start:end]) 00254 self.scans = [] 00255 for i in range(0, length): 00256 val1 = flirtlib_ros.msg.RefScanRos() 00257 _v9 = val1.scan 00258 _v10 = _v9.header 00259 start = end 00260 end += 4 00261 (_v10.seq,) = _struct_I.unpack(str[start:end]) 00262 _v11 = _v10.stamp 00263 _x = _v11 00264 start = end 00265 end += 8 00266 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00267 start = end 00268 end += 4 00269 (length,) = _struct_I.unpack(str[start:end]) 00270 start = end 00271 end += length 00272 _v10.frame_id = str[start:end] 00273 _x = _v9 00274 start = end 00275 end += 28 00276 (_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.scan_time, _x.range_min, _x.range_max,) = _struct_7f.unpack(str[start:end]) 00277 start = end 00278 end += 4 00279 (length,) = _struct_I.unpack(str[start:end]) 00280 pattern = '<%sf'%length 00281 start = end 00282 end += struct.calcsize(pattern) 00283 _v9.ranges = struct.unpack(pattern, str[start:end]) 00284 start = end 00285 end += 4 00286 (length,) = _struct_I.unpack(str[start:end]) 00287 pattern = '<%sf'%length 00288 start = end 00289 end += struct.calcsize(pattern) 00290 _v9.intensities = struct.unpack(pattern, str[start:end]) 00291 _v12 = val1.pose 00292 _v13 = _v12.position 00293 _x = _v13 00294 start = end 00295 end += 24 00296 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00297 _v14 = _v12.orientation 00298 _x = _v14 00299 start = end 00300 end += 32 00301 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00302 start = end 00303 end += 4 00304 (length,) = _struct_I.unpack(str[start:end]) 00305 val1.pts = [] 00306 for i in range(0, length): 00307 val2 = flirtlib_ros.msg.InterestPointRos() 00308 _v15 = val2.pose 00309 _x = _v15 00310 start = end 00311 end += 24 00312 (_x.x, _x.y, _x.theta,) = _struct_3d.unpack(str[start:end]) 00313 start = end 00314 end += 4 00315 (length,) = _struct_I.unpack(str[start:end]) 00316 val2.support_points = [] 00317 for i in range(0, length): 00318 val3 = geometry_msgs.msg.Point() 00319 _x = val3 00320 start = end 00321 end += 24 00322 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00323 val2.support_points.append(val3) 00324 _x = val2 00325 start = end 00326 end += 8 00327 (_x.scale, _x.scale_level,) = _struct_fI.unpack(str[start:end]) 00328 _v16 = val2.descriptor 00329 start = end 00330 end += 4 00331 (length,) = _struct_I.unpack(str[start:end]) 00332 _v16.hist = [] 00333 for i in range(0, length): 00334 val4 = flirtlib_ros.msg.Vector() 00335 start = end 00336 end += 4 00337 (length,) = _struct_I.unpack(str[start:end]) 00338 pattern = '<%sd'%length 00339 start = end 00340 end += struct.calcsize(pattern) 00341 val4.vec = struct.unpack(pattern, str[start:end]) 00342 _v16.hist.append(val4) 00343 start = end 00344 end += 4 00345 (length,) = _struct_I.unpack(str[start:end]) 00346 _v16.variance = [] 00347 for i in range(0, length): 00348 val4 = flirtlib_ros.msg.Vector() 00349 start = end 00350 end += 4 00351 (length,) = _struct_I.unpack(str[start:end]) 00352 pattern = '<%sd'%length 00353 start = end 00354 end += struct.calcsize(pattern) 00355 val4.vec = struct.unpack(pattern, str[start:end]) 00356 _v16.variance.append(val4) 00357 start = end 00358 end += 4 00359 (length,) = _struct_I.unpack(str[start:end]) 00360 _v16.hit = [] 00361 for i in range(0, length): 00362 val4 = flirtlib_ros.msg.Vector() 00363 start = end 00364 end += 4 00365 (length,) = _struct_I.unpack(str[start:end]) 00366 pattern = '<%sd'%length 00367 start = end 00368 end += struct.calcsize(pattern) 00369 val4.vec = struct.unpack(pattern, str[start:end]) 00370 _v16.hit.append(val4) 00371 start = end 00372 end += 4 00373 (length,) = _struct_I.unpack(str[start:end]) 00374 _v16.miss = [] 00375 for i in range(0, length): 00376 val4 = flirtlib_ros.msg.Vector() 00377 start = end 00378 end += 4 00379 (length,) = _struct_I.unpack(str[start:end]) 00380 pattern = '<%sd'%length 00381 start = end 00382 end += struct.calcsize(pattern) 00383 val4.vec = struct.unpack(pattern, str[start:end]) 00384 _v16.miss.append(val4) 00385 val1.pts.append(val2) 00386 self.scans.append(val1) 00387 return self 00388 except struct.error as e: 00389 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00390 00391 00392 def serialize_numpy(self, buff, numpy): 00393 """ 00394 serialize message with numpy array types into buffer 00395 @param buff: buffer 00396 @type buff: StringIO 00397 @param numpy: numpy python module 00398 @type numpy module 00399 """ 00400 try: 00401 length = len(self.scans) 00402 buff.write(_struct_I.pack(length)) 00403 for val1 in self.scans: 00404 _v17 = val1.scan 00405 _v18 = _v17.header 00406 buff.write(_struct_I.pack(_v18.seq)) 00407 _v19 = _v18.stamp 00408 _x = _v19 00409 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00410 _x = _v18.frame_id 00411 length = len(_x) 00412 buff.write(struct.pack('<I%ss'%length, length, _x)) 00413 _x = _v17 00414 buff.write(_struct_7f.pack(_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.scan_time, _x.range_min, _x.range_max)) 00415 length = len(_v17.ranges) 00416 buff.write(_struct_I.pack(length)) 00417 pattern = '<%sf'%length 00418 buff.write(_v17.ranges.tostring()) 00419 length = len(_v17.intensities) 00420 buff.write(_struct_I.pack(length)) 00421 pattern = '<%sf'%length 00422 buff.write(_v17.intensities.tostring()) 00423 _v20 = val1.pose 00424 _v21 = _v20.position 00425 _x = _v21 00426 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00427 _v22 = _v20.orientation 00428 _x = _v22 00429 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00430 length = len(val1.pts) 00431 buff.write(_struct_I.pack(length)) 00432 for val2 in val1.pts: 00433 _v23 = val2.pose 00434 _x = _v23 00435 buff.write(_struct_3d.pack(_x.x, _x.y, _x.theta)) 00436 length = len(val2.support_points) 00437 buff.write(_struct_I.pack(length)) 00438 for val3 in val2.support_points: 00439 _x = val3 00440 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00441 _x = val2 00442 buff.write(_struct_fI.pack(_x.scale, _x.scale_level)) 00443 _v24 = val2.descriptor 00444 length = len(_v24.hist) 00445 buff.write(_struct_I.pack(length)) 00446 for val4 in _v24.hist: 00447 length = len(val4.vec) 00448 buff.write(_struct_I.pack(length)) 00449 pattern = '<%sd'%length 00450 buff.write(val4.vec.tostring()) 00451 length = len(_v24.variance) 00452 buff.write(_struct_I.pack(length)) 00453 for val4 in _v24.variance: 00454 length = len(val4.vec) 00455 buff.write(_struct_I.pack(length)) 00456 pattern = '<%sd'%length 00457 buff.write(val4.vec.tostring()) 00458 length = len(_v24.hit) 00459 buff.write(_struct_I.pack(length)) 00460 for val4 in _v24.hit: 00461 length = len(val4.vec) 00462 buff.write(_struct_I.pack(length)) 00463 pattern = '<%sd'%length 00464 buff.write(val4.vec.tostring()) 00465 length = len(_v24.miss) 00466 buff.write(_struct_I.pack(length)) 00467 for val4 in _v24.miss: 00468 length = len(val4.vec) 00469 buff.write(_struct_I.pack(length)) 00470 pattern = '<%sd'%length 00471 buff.write(val4.vec.tostring()) 00472 except struct.error as se: self._check_types(se) 00473 except TypeError as te: self._check_types(te) 00474 00475 def deserialize_numpy(self, str, numpy): 00476 """ 00477 unpack serialized message in str into this message instance using numpy for array types 00478 @param str: byte array of serialized message 00479 @type str: str 00480 @param numpy: numpy python module 00481 @type numpy: module 00482 """ 00483 try: 00484 end = 0 00485 start = end 00486 end += 4 00487 (length,) = _struct_I.unpack(str[start:end]) 00488 self.scans = [] 00489 for i in range(0, length): 00490 val1 = flirtlib_ros.msg.RefScanRos() 00491 _v25 = val1.scan 00492 _v26 = _v25.header 00493 start = end 00494 end += 4 00495 (_v26.seq,) = _struct_I.unpack(str[start:end]) 00496 _v27 = _v26.stamp 00497 _x = _v27 00498 start = end 00499 end += 8 00500 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00501 start = end 00502 end += 4 00503 (length,) = _struct_I.unpack(str[start:end]) 00504 start = end 00505 end += length 00506 _v26.frame_id = str[start:end] 00507 _x = _v25 00508 start = end 00509 end += 28 00510 (_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.scan_time, _x.range_min, _x.range_max,) = _struct_7f.unpack(str[start:end]) 00511 start = end 00512 end += 4 00513 (length,) = _struct_I.unpack(str[start:end]) 00514 pattern = '<%sf'%length 00515 start = end 00516 end += struct.calcsize(pattern) 00517 _v25.ranges = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00518 start = end 00519 end += 4 00520 (length,) = _struct_I.unpack(str[start:end]) 00521 pattern = '<%sf'%length 00522 start = end 00523 end += struct.calcsize(pattern) 00524 _v25.intensities = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00525 _v28 = val1.pose 00526 _v29 = _v28.position 00527 _x = _v29 00528 start = end 00529 end += 24 00530 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00531 _v30 = _v28.orientation 00532 _x = _v30 00533 start = end 00534 end += 32 00535 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00536 start = end 00537 end += 4 00538 (length,) = _struct_I.unpack(str[start:end]) 00539 val1.pts = [] 00540 for i in range(0, length): 00541 val2 = flirtlib_ros.msg.InterestPointRos() 00542 _v31 = val2.pose 00543 _x = _v31 00544 start = end 00545 end += 24 00546 (_x.x, _x.y, _x.theta,) = _struct_3d.unpack(str[start:end]) 00547 start = end 00548 end += 4 00549 (length,) = _struct_I.unpack(str[start:end]) 00550 val2.support_points = [] 00551 for i in range(0, length): 00552 val3 = geometry_msgs.msg.Point() 00553 _x = val3 00554 start = end 00555 end += 24 00556 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00557 val2.support_points.append(val3) 00558 _x = val2 00559 start = end 00560 end += 8 00561 (_x.scale, _x.scale_level,) = _struct_fI.unpack(str[start:end]) 00562 _v32 = val2.descriptor 00563 start = end 00564 end += 4 00565 (length,) = _struct_I.unpack(str[start:end]) 00566 _v32.hist = [] 00567 for i in range(0, length): 00568 val4 = flirtlib_ros.msg.Vector() 00569 start = end 00570 end += 4 00571 (length,) = _struct_I.unpack(str[start:end]) 00572 pattern = '<%sd'%length 00573 start = end 00574 end += struct.calcsize(pattern) 00575 val4.vec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00576 _v32.hist.append(val4) 00577 start = end 00578 end += 4 00579 (length,) = _struct_I.unpack(str[start:end]) 00580 _v32.variance = [] 00581 for i in range(0, length): 00582 val4 = flirtlib_ros.msg.Vector() 00583 start = end 00584 end += 4 00585 (length,) = _struct_I.unpack(str[start:end]) 00586 pattern = '<%sd'%length 00587 start = end 00588 end += struct.calcsize(pattern) 00589 val4.vec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00590 _v32.variance.append(val4) 00591 start = end 00592 end += 4 00593 (length,) = _struct_I.unpack(str[start:end]) 00594 _v32.hit = [] 00595 for i in range(0, length): 00596 val4 = flirtlib_ros.msg.Vector() 00597 start = end 00598 end += 4 00599 (length,) = _struct_I.unpack(str[start:end]) 00600 pattern = '<%sd'%length 00601 start = end 00602 end += struct.calcsize(pattern) 00603 val4.vec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00604 _v32.hit.append(val4) 00605 start = end 00606 end += 4 00607 (length,) = _struct_I.unpack(str[start:end]) 00608 _v32.miss = [] 00609 for i in range(0, length): 00610 val4 = flirtlib_ros.msg.Vector() 00611 start = end 00612 end += 4 00613 (length,) = _struct_I.unpack(str[start:end]) 00614 pattern = '<%sd'%length 00615 start = end 00616 end += struct.calcsize(pattern) 00617 val4.vec = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00618 _v32.miss.append(val4) 00619 val1.pts.append(val2) 00620 self.scans.append(val1) 00621 return self 00622 except struct.error as e: 00623 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00624 00625 _struct_I = roslib.message.struct_I 00626 _struct_7f = struct.Struct("<7f") 00627 _struct_fI = struct.Struct("<fI") 00628 _struct_4d = struct.Struct("<4d") 00629 _struct_2I = struct.Struct("<2I") 00630 _struct_3d = struct.Struct("<3d")