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