00001 """autogenerated by genmsg_py from LocalizedScan.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import sensor_msgs.msg
00007 import std_msgs.msg
00008
00009 class LocalizedScan(roslib.message.Message):
00010 _md5sum = "a4d676ce9bf4274df95bd1940071f796"
00011 _type = "laser_slam/LocalizedScan"
00012 _has_header = True
00013 _full_text = """# The reference frame and time point w.r.t which sensor pose is stored
00014 # Note that header.stamp might be different from scan.header.stamp
00015 Header header
00016
00017 # Original scan
00018 sensor_msgs/LaserScan scan
00019
00020 # Point cloud in sensor frame at timepoint header.stamp, corrected for robot movement
00021 sensor_msgs/PointCloud cloud
00022
00023 # Pose of sensor in reference frame
00024 geometry_msgs/Pose sensor_pose
00025
00026 # Barycenter of cloud in ref frame
00027 geometry_msgs/Point barycenter
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: sensor_msgs/LaserScan
00048 # Single scan from a planar laser range-finder
00049 #
00050 # If you have another ranging device with different behavior (e.g. a sonar
00051 # array), please find or create a different message, since applications
00052 # will make fairly laser-specific assumptions about this data
00053
00054 Header header # timestamp in the header is the acquisition time of
00055 # the first ray in the scan.
00056 #
00057 # in frame frame_id, angles are measured around
00058 # the positive Z axis (counterclockwise, if Z is up)
00059 # with zero angle being forward along the x axis
00060
00061 float32 angle_min # start angle of the scan [rad]
00062 float32 angle_max # end angle of the scan [rad]
00063 float32 angle_increment # angular distance between measurements [rad]
00064
00065 float32 time_increment # time between measurements [seconds] - if your scanner
00066 # is moving, this will be used in interpolating position
00067 # of 3d points
00068 float32 scan_time # time between scans [seconds]
00069
00070 float32 range_min # minimum range value [m]
00071 float32 range_max # maximum range value [m]
00072
00073 float32[] ranges # range data [m] (Note: values < range_min or > range_max should be discarded)
00074 float32[] intensities # intensity data [device-specific units]. If your
00075 # device does not provide intensities, please leave
00076 # the array empty.
00077
00078 ================================================================================
00079 MSG: sensor_msgs/PointCloud
00080 # This message holds a collection of 3d points, plus optional additional
00081 # information about each point.
00082
00083 # Time of sensor data acquisition, coordinate frame ID.
00084 Header header
00085
00086 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00087 # in the frame given in the header.
00088 geometry_msgs/Point32[] points
00089
00090 # Each channel should have the same number of elements as points array,
00091 # and the data in each channel should correspond 1:1 with each point.
00092 # Channel names in common practice are listed in ChannelFloat32.msg.
00093 ChannelFloat32[] channels
00094
00095 ================================================================================
00096 MSG: geometry_msgs/Point32
00097 # This contains the position of a point in free space(with 32 bits of precision).
00098 # It is recommeded to use Point wherever possible instead of Point32.
00099 #
00100 # This recommendation is to promote interoperability.
00101 #
00102 # This message is designed to take up less space when sending
00103 # lots of points at once, as in the case of a PointCloud.
00104
00105 float32 x
00106 float32 y
00107 float32 z
00108 ================================================================================
00109 MSG: sensor_msgs/ChannelFloat32
00110 # This message is used by the PointCloud message to hold optional data
00111 # associated with each point in the cloud. The length of the values
00112 # array should be the same as the length of the points array in the
00113 # PointCloud, and each value should be associated with the corresponding
00114 # point.
00115
00116 # Channel names in existing practice include:
00117 # "u", "v" - row and column (respectively) in the left stereo image.
00118 # This is opposite to usual conventions but remains for
00119 # historical reasons. The newer PointCloud2 message has no
00120 # such problem.
00121 # "rgb" - For point clouds produced by color stereo cameras. uint8
00122 # (R,G,B) values packed into the least significant 24 bits,
00123 # in order.
00124 # "intensity" - laser or pixel intensity.
00125 # "distance"
00126
00127 # The channel name should give semantics of the channel (e.g.
00128 # "intensity" instead of "value").
00129 string name
00130
00131 # The values array should be 1-1 with the elements of the associated
00132 # PointCloud.
00133 float32[] values
00134
00135 ================================================================================
00136 MSG: geometry_msgs/Pose
00137 # A representation of pose in free space, composed of postion and orientation.
00138 Point position
00139 Quaternion orientation
00140
00141 ================================================================================
00142 MSG: geometry_msgs/Point
00143 # This contains the position of a point in free space
00144 float64 x
00145 float64 y
00146 float64 z
00147
00148 ================================================================================
00149 MSG: geometry_msgs/Quaternion
00150 # This represents an orientation in free space in quaternion form.
00151
00152 float64 x
00153 float64 y
00154 float64 z
00155 float64 w
00156
00157 """
00158 __slots__ = ['header','scan','cloud','sensor_pose','barycenter']
00159 _slot_types = ['Header','sensor_msgs/LaserScan','sensor_msgs/PointCloud','geometry_msgs/Pose','geometry_msgs/Point']
00160
00161 def __init__(self, *args, **kwds):
00162 """
00163 Constructor. Any message fields that are implicitly/explicitly
00164 set to None will be assigned a default value. The recommend
00165 use is keyword arguments as this is more robust to future message
00166 changes. You cannot mix in-order arguments and keyword arguments.
00167
00168 The available fields are:
00169 header,scan,cloud,sensor_pose,barycenter
00170
00171 @param args: complete set of field values, in .msg order
00172 @param kwds: use keyword arguments corresponding to message field names
00173 to set specific fields.
00174 """
00175 if args or kwds:
00176 super(LocalizedScan, self).__init__(*args, **kwds)
00177 #message fields cannot be None, assign default values for those that are
00178 if self.header is None:
00179 self.header = std_msgs.msg._Header.Header()
00180 if self.scan is None:
00181 self.scan = sensor_msgs.msg.LaserScan()
00182 if self.cloud is None:
00183 self.cloud = sensor_msgs.msg.PointCloud()
00184 if self.sensor_pose is None:
00185 self.sensor_pose = geometry_msgs.msg.Pose()
00186 if self.barycenter is None:
00187 self.barycenter = geometry_msgs.msg.Point()
00188 else:
00189 self.header = std_msgs.msg._Header.Header()
00190 self.scan = sensor_msgs.msg.LaserScan()
00191 self.cloud = sensor_msgs.msg.PointCloud()
00192 self.sensor_pose = geometry_msgs.msg.Pose()
00193 self.barycenter = geometry_msgs.msg.Point()
00194
00195 def _get_types(self):
00196 """
00197 internal API method
00198 """
00199 return self._slot_types
00200
00201 def serialize(self, buff):
00202 """
00203 serialize message into buffer
00204 @param buff: buffer
00205 @type buff: StringIO
00206 """
00207 try:
00208 _x = self
00209 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00210 _x = self.header.frame_id
00211 length = len(_x)
00212 buff.write(struct.pack('<I%ss'%length, length, _x))
00213 _x = self
00214 buff.write(_struct_3I.pack(_x.scan.header.seq, _x.scan.header.stamp.secs, _x.scan.header.stamp.nsecs))
00215 _x = self.scan.header.frame_id
00216 length = len(_x)
00217 buff.write(struct.pack('<I%ss'%length, length, _x))
00218 _x = self
00219 buff.write(_struct_7f.pack(_x.scan.angle_min, _x.scan.angle_max, _x.scan.angle_increment, _x.scan.time_increment, _x.scan.scan_time, _x.scan.range_min, _x.scan.range_max))
00220 length = len(self.scan.ranges)
00221 buff.write(_struct_I.pack(length))
00222 pattern = '<%sf'%length
00223 buff.write(struct.pack(pattern, *self.scan.ranges))
00224 length = len(self.scan.intensities)
00225 buff.write(_struct_I.pack(length))
00226 pattern = '<%sf'%length
00227 buff.write(struct.pack(pattern, *self.scan.intensities))
00228 _x = self
00229 buff.write(_struct_3I.pack(_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs))
00230 _x = self.cloud.header.frame_id
00231 length = len(_x)
00232 buff.write(struct.pack('<I%ss'%length, length, _x))
00233 length = len(self.cloud.points)
00234 buff.write(_struct_I.pack(length))
00235 for val1 in self.cloud.points:
00236 _x = val1
00237 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00238 length = len(self.cloud.channels)
00239 buff.write(_struct_I.pack(length))
00240 for val1 in self.cloud.channels:
00241 _x = val1.name
00242 length = len(_x)
00243 buff.write(struct.pack('<I%ss'%length, length, _x))
00244 length = len(val1.values)
00245 buff.write(_struct_I.pack(length))
00246 pattern = '<%sf'%length
00247 buff.write(struct.pack(pattern, *val1.values))
00248 _x = self
00249 buff.write(_struct_10d.pack(_x.sensor_pose.position.x, _x.sensor_pose.position.y, _x.sensor_pose.position.z, _x.sensor_pose.orientation.x, _x.sensor_pose.orientation.y, _x.sensor_pose.orientation.z, _x.sensor_pose.orientation.w, _x.barycenter.x, _x.barycenter.y, _x.barycenter.z))
00250 except struct.error, se: self._check_types(se)
00251 except TypeError, te: self._check_types(te)
00252
00253 def deserialize(self, str):
00254 """
00255 unpack serialized message in str into this message instance
00256 @param str: byte array of serialized message
00257 @type str: str
00258 """
00259 try:
00260 if self.header is None:
00261 self.header = std_msgs.msg._Header.Header()
00262 if self.scan is None:
00263 self.scan = sensor_msgs.msg.LaserScan()
00264 if self.cloud is None:
00265 self.cloud = sensor_msgs.msg.PointCloud()
00266 if self.sensor_pose is None:
00267 self.sensor_pose = geometry_msgs.msg.Pose()
00268 if self.barycenter is None:
00269 self.barycenter = geometry_msgs.msg.Point()
00270 end = 0
00271 _x = self
00272 start = end
00273 end += 12
00274 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00275 start = end
00276 end += 4
00277 (length,) = _struct_I.unpack(str[start:end])
00278 start = end
00279 end += length
00280 self.header.frame_id = str[start:end]
00281 _x = self
00282 start = end
00283 end += 12
00284 (_x.scan.header.seq, _x.scan.header.stamp.secs, _x.scan.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00285 start = end
00286 end += 4
00287 (length,) = _struct_I.unpack(str[start:end])
00288 start = end
00289 end += length
00290 self.scan.header.frame_id = str[start:end]
00291 _x = self
00292 start = end
00293 end += 28
00294 (_x.scan.angle_min, _x.scan.angle_max, _x.scan.angle_increment, _x.scan.time_increment, _x.scan.scan_time, _x.scan.range_min, _x.scan.range_max,) = _struct_7f.unpack(str[start:end])
00295 start = end
00296 end += 4
00297 (length,) = _struct_I.unpack(str[start:end])
00298 pattern = '<%sf'%length
00299 start = end
00300 end += struct.calcsize(pattern)
00301 self.scan.ranges = struct.unpack(pattern, str[start:end])
00302 start = end
00303 end += 4
00304 (length,) = _struct_I.unpack(str[start:end])
00305 pattern = '<%sf'%length
00306 start = end
00307 end += struct.calcsize(pattern)
00308 self.scan.intensities = struct.unpack(pattern, str[start:end])
00309 _x = self
00310 start = end
00311 end += 12
00312 (_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00313 start = end
00314 end += 4
00315 (length,) = _struct_I.unpack(str[start:end])
00316 start = end
00317 end += length
00318 self.cloud.header.frame_id = str[start:end]
00319 start = end
00320 end += 4
00321 (length,) = _struct_I.unpack(str[start:end])
00322 self.cloud.points = []
00323 for i in xrange(0, length):
00324 val1 = geometry_msgs.msg.Point32()
00325 _x = val1
00326 start = end
00327 end += 12
00328 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00329 self.cloud.points.append(val1)
00330 start = end
00331 end += 4
00332 (length,) = _struct_I.unpack(str[start:end])
00333 self.cloud.channels = []
00334 for i in xrange(0, length):
00335 val1 = sensor_msgs.msg.ChannelFloat32()
00336 start = end
00337 end += 4
00338 (length,) = _struct_I.unpack(str[start:end])
00339 start = end
00340 end += length
00341 val1.name = str[start:end]
00342 start = end
00343 end += 4
00344 (length,) = _struct_I.unpack(str[start:end])
00345 pattern = '<%sf'%length
00346 start = end
00347 end += struct.calcsize(pattern)
00348 val1.values = struct.unpack(pattern, str[start:end])
00349 self.cloud.channels.append(val1)
00350 _x = self
00351 start = end
00352 end += 80
00353 (_x.sensor_pose.position.x, _x.sensor_pose.position.y, _x.sensor_pose.position.z, _x.sensor_pose.orientation.x, _x.sensor_pose.orientation.y, _x.sensor_pose.orientation.z, _x.sensor_pose.orientation.w, _x.barycenter.x, _x.barycenter.y, _x.barycenter.z,) = _struct_10d.unpack(str[start:end])
00354 return self
00355 except struct.error, e:
00356 raise roslib.message.DeserializationError(e) #most likely buffer underfill
00357
00358
00359 def serialize_numpy(self, buff, numpy):
00360 """
00361 serialize message with numpy array types into buffer
00362 @param buff: buffer
00363 @type buff: StringIO
00364 @param numpy: numpy python module
00365 @type numpy module
00366 """
00367 try:
00368 _x = self
00369 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00370 _x = self.header.frame_id
00371 length = len(_x)
00372 buff.write(struct.pack('<I%ss'%length, length, _x))
00373 _x = self
00374 buff.write(_struct_3I.pack(_x.scan.header.seq, _x.scan.header.stamp.secs, _x.scan.header.stamp.nsecs))
00375 _x = self.scan.header.frame_id
00376 length = len(_x)
00377 buff.write(struct.pack('<I%ss'%length, length, _x))
00378 _x = self
00379 buff.write(_struct_7f.pack(_x.scan.angle_min, _x.scan.angle_max, _x.scan.angle_increment, _x.scan.time_increment, _x.scan.scan_time, _x.scan.range_min, _x.scan.range_max))
00380 length = len(self.scan.ranges)
00381 buff.write(_struct_I.pack(length))
00382 pattern = '<%sf'%length
00383 buff.write(self.scan.ranges.tostring())
00384 length = len(self.scan.intensities)
00385 buff.write(_struct_I.pack(length))
00386 pattern = '<%sf'%length
00387 buff.write(self.scan.intensities.tostring())
00388 _x = self
00389 buff.write(_struct_3I.pack(_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs))
00390 _x = self.cloud.header.frame_id
00391 length = len(_x)
00392 buff.write(struct.pack('<I%ss'%length, length, _x))
00393 length = len(self.cloud.points)
00394 buff.write(_struct_I.pack(length))
00395 for val1 in self.cloud.points:
00396 _x = val1
00397 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00398 length = len(self.cloud.channels)
00399 buff.write(_struct_I.pack(length))
00400 for val1 in self.cloud.channels:
00401 _x = val1.name
00402 length = len(_x)
00403 buff.write(struct.pack('<I%ss'%length, length, _x))
00404 length = len(val1.values)
00405 buff.write(_struct_I.pack(length))
00406 pattern = '<%sf'%length
00407 buff.write(val1.values.tostring())
00408 _x = self
00409 buff.write(_struct_10d.pack(_x.sensor_pose.position.x, _x.sensor_pose.position.y, _x.sensor_pose.position.z, _x.sensor_pose.orientation.x, _x.sensor_pose.orientation.y, _x.sensor_pose.orientation.z, _x.sensor_pose.orientation.w, _x.barycenter.x, _x.barycenter.y, _x.barycenter.z))
00410 except struct.error, se: self._check_types(se)
00411 except TypeError, te: self._check_types(te)
00412
00413 def deserialize_numpy(self, str, numpy):
00414 """
00415 unpack serialized message in str into this message instance using numpy for array types
00416 @param str: byte array of serialized message
00417 @type str: str
00418 @param numpy: numpy python module
00419 @type numpy: module
00420 """
00421 try:
00422 if self.header is None:
00423 self.header = std_msgs.msg._Header.Header()
00424 if self.scan is None:
00425 self.scan = sensor_msgs.msg.LaserScan()
00426 if self.cloud is None:
00427 self.cloud = sensor_msgs.msg.PointCloud()
00428 if self.sensor_pose is None:
00429 self.sensor_pose = geometry_msgs.msg.Pose()
00430 if self.barycenter is None:
00431 self.barycenter = geometry_msgs.msg.Point()
00432 end = 0
00433 _x = self
00434 start = end
00435 end += 12
00436 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00437 start = end
00438 end += 4
00439 (length,) = _struct_I.unpack(str[start:end])
00440 start = end
00441 end += length
00442 self.header.frame_id = str[start:end]
00443 _x = self
00444 start = end
00445 end += 12
00446 (_x.scan.header.seq, _x.scan.header.stamp.secs, _x.scan.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00447 start = end
00448 end += 4
00449 (length,) = _struct_I.unpack(str[start:end])
00450 start = end
00451 end += length
00452 self.scan.header.frame_id = str[start:end]
00453 _x = self
00454 start = end
00455 end += 28
00456 (_x.scan.angle_min, _x.scan.angle_max, _x.scan.angle_increment, _x.scan.time_increment, _x.scan.scan_time, _x.scan.range_min, _x.scan.range_max,) = _struct_7f.unpack(str[start:end])
00457 start = end
00458 end += 4
00459 (length,) = _struct_I.unpack(str[start:end])
00460 pattern = '<%sf'%length
00461 start = end
00462 end += struct.calcsize(pattern)
00463 self.scan.ranges = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00464 start = end
00465 end += 4
00466 (length,) = _struct_I.unpack(str[start:end])
00467 pattern = '<%sf'%length
00468 start = end
00469 end += struct.calcsize(pattern)
00470 self.scan.intensities = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00471 _x = self
00472 start = end
00473 end += 12
00474 (_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00475 start = end
00476 end += 4
00477 (length,) = _struct_I.unpack(str[start:end])
00478 start = end
00479 end += length
00480 self.cloud.header.frame_id = str[start:end]
00481 start = end
00482 end += 4
00483 (length,) = _struct_I.unpack(str[start:end])
00484 self.cloud.points = []
00485 for i in xrange(0, length):
00486 val1 = geometry_msgs.msg.Point32()
00487 _x = val1
00488 start = end
00489 end += 12
00490 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00491 self.cloud.points.append(val1)
00492 start = end
00493 end += 4
00494 (length,) = _struct_I.unpack(str[start:end])
00495 self.cloud.channels = []
00496 for i in xrange(0, length):
00497 val1 = sensor_msgs.msg.ChannelFloat32()
00498 start = end
00499 end += 4
00500 (length,) = _struct_I.unpack(str[start:end])
00501 start = end
00502 end += length
00503 val1.name = str[start:end]
00504 start = end
00505 end += 4
00506 (length,) = _struct_I.unpack(str[start:end])
00507 pattern = '<%sf'%length
00508 start = end
00509 end += struct.calcsize(pattern)
00510 val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00511 self.cloud.channels.append(val1)
00512 _x = self
00513 start = end
00514 end += 80
00515 (_x.sensor_pose.position.x, _x.sensor_pose.position.y, _x.sensor_pose.position.z, _x.sensor_pose.orientation.x, _x.sensor_pose.orientation.y, _x.sensor_pose.orientation.z, _x.sensor_pose.orientation.w, _x.barycenter.x, _x.barycenter.y, _x.barycenter.z,) = _struct_10d.unpack(str[start:end])
00516 return self
00517 except struct.error, e:
00518 raise roslib.message.DeserializationError(e) #most likely buffer underfill
00519
00520 _struct_I = roslib.message.struct_I
00521 _struct_7f = struct.Struct("<7f")
00522 _struct_3I = struct.Struct("<3I")
00523 _struct_3f = struct.Struct("<3f")
00524 _struct_10d = struct.Struct("<10d")