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