MIRA
RangeScan.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * and
5  * Neuroinformatics and Cognitive Robotics Labs (NICR) at TU Ilmenau, GERMANY
6  * All rights reserved.
7  *
8  * Contact: info@mira-project.org
9  *
10  * Commercial Usage:
11  * Licensees holding valid commercial licenses may use this file in
12  * accordance with the commercial license agreement provided with the
13  * software or, alternatively, in accordance with the terms contained in
14  * a written agreement between you and MLAB or NICR.
15  *
16  * GNU General Public License Usage:
17  * Alternatively, this file may be used under the terms of the GNU
18  * General Public License version 3.0 as published by the Free Software
19  * Foundation and appearing in the file LICENSE.GPL3 included in the
20  * packaging of this file. Please review the following information to
21  * ensure the GNU General Public License version 3.0 requirements will be
22  * met: http://www.gnu.org/copyleft/gpl.html.
23  * Alternatively you may (at your option) use any later version of the GNU
24  * General Public License if such license has been publicly approved by
25  * MLAB and NICR (or its successors, if any).
26  *
27  * IN NO EVENT SHALL "MLAB" OR "NICR" BE LIABLE TO ANY PARTY FOR DIRECT,
28  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
29  * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLAB" OR
30  * "NICR" HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * "MLAB" AND "NICR" SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
33  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
34  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
35  * ON AN "AS IS" BASIS, AND "MLAB" AND "NICR" HAVE NO OBLIGATION TO
36  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
37  */
38 
47 #ifndef _MIRA_RANGESCAN_H_
48 #define _MIRA_RANGESCAN_H_
49 
50 #include <serialization/adapters/std/vector>
51 #include <platform/Types.h>
52 #include <robot/RangeScanInfo.h>
53 
54 namespace mira { namespace robot {
55 
57 
63 class RangeScan : public RangeScanInfo
64 {
65 public:
69  enum RangeCode
70  {
71  Valid = 0,
74 
75  // Invalid is the first enum that indicates a measurement that really
76  // is not usable. Other enums (like Masked) that also indicate an
77  // unusable measurement must follow below.
78 
81 
82  InvalidUser = 1000
83  };
84 
85 public:
88 
89  RangeScan() {}
90 
100  RangeScan(std::size_t scans) :
101  range(scans), valid(scans) {}
102 
103  template<typename Reflector>
104  void reflect(Reflector& r)
105  {
107 
108  r.member("Range", range, "The range scan vector. Values in meter");
109  r.member("Valid", valid, "Valid range scans (value=0 for valid scans) "
110  "referenced to the elements in the range scan vector");
111  r.member("Certainty", certainty, "Optional certainty values for each "
112  "scan referenced to the appropriate scan vector element");
113  r.member("Reflectance", reflectance, "Optional reflectance values for "
114  "each scan referenced to the appropriate scan vector element");
115  }
116 
118 
119 public:
120 
122  std::vector<float> range;
123 
128  std::vector<uint16> valid;
129 
132  std::vector<float> certainty;
133 
136  std::vector<float> reflectance;
137 };
138 
140 
141 }}
142 
143 #endif
The first range code for device specific codes.
Definition: RangeScan.h:82
This class represents 2D range scans e.g.
Definition: RangeScan.h:63
std::vector< float > certainty
Optional certainty values for each scan referenced to the appropriate scan vector element...
Definition: RangeScan.h:132
RangeScan(std::size_t scans)
Construct a new range scan object with a given number of scans.
Definition: RangeScan.h:100
std::vector< float > range
The range scans. Values in meter.
Definition: RangeScan.h:122
RangeScan()
Definition: RangeScan.h:89
#define MIRA_REFLECT_BASE(reflector, BaseClass)
Information about configuration of 2D range scans.
std::vector< float > reflectance
Optional reflectance values for each scan referenced to the appropriate scan vector element...
Definition: RangeScan.h:136
This class stores information about the configuration and geometry of 2D range scans e...
Definition: RangeScanInfo.h:66
Scan is masked out and therefore not used.
Definition: RangeScan.h:80
Scan is invalid.
Definition: RangeScan.h:79
Scan is valid.
Definition: RangeScan.h:71
void reflect(Reflector &r)
Definition: RangeScan.h:104
std::vector< uint16 > valid
Information if a scan is valid.
Definition: RangeScan.h:128
Scan is below the minimum scan range of the sensor.
Definition: RangeScan.h:72
RangeCode
Codes used for single scans to signal if they are valid.
Definition: RangeScan.h:69
Scan is above the maximum scan range of the sensor.
Definition: RangeScan.h:73