scan.hh
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2010
4  * Mayte Lázaro, Alejandro R. Mosteo
5  *
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 
23 #ifndef SCAN_H_
24 #define SCAN_H_
25 
26 #include <vector>
27 #include "types.hh"
28 #include "uloc.hh"
29 
30 class Scan
31 {
32 public:
33 
36  Scan(double max_range,
37  double laser_x,
38  double laser_y,
39  double laser_angle,
40  double laser_noise_range,
41  double laser_noise_bearing);
42 
43  const Uloc & uloc(const int i) const; // read only access
44 
46  void SetLaserPose(double x, double y, double a);
47 
50  void SetLastScan(const DoublesVector& ranges,
51  const DoublesVector& bearings);
52 
53  int ScanCount(void) const;
54 
55  double phi(const int i) const;
56  double rho(const int i) const;
57 
58  const double kOutOfRange_;
59  const double kLaserNoiseRange_;
60  const double kLaserNoiseBearing_;
61 private:
62  Uloc AttachReferenceToScanPoint(double rho, double phi);
63 
64  void addUloc(Uloc u);
65  vector<Uloc> ulocs_;
66 
67  DoublesVector rho_; // Distance
68  DoublesVector phi_; // Bearing
69 
70  Transf xform_laser_to_robot_;
71 };
72 
73 #endif /* SCAN_H_ */
void SetLastScan(const DoublesVector &ranges, const DoublesVector &bearings)
Set last laser reading Removes out of range values and attaches the uncertainty model.
Definition: scan.cc:87
void SetLaserPose(double x, double y, double a)
Update laser pose.
Definition: scan.cc:41
Scan(double max_range, double laser_x, double laser_y, double laser_angle, double laser_noise_range, double laser_noise_bearing)
Provide laser parameters: maximum range and its pose on top of robot, and noise model.
Definition: scan.cc:27
Definition: transf.hh:36
Definition: uloc.hh:32
Definition: scan.hh:30