RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
EnvSensor.h
1/*
2Copyright (c) 2010-2018, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the Universite de Sherbrooke nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifndef CORELIB_INCLUDE_RTABMAP_CORE_ENVSENSOR_H_
29#define CORELIB_INCLUDE_RTABMAP_CORE_ENVSENSOR_H_
30
31#include <map>
32
33namespace rtabmap {
34
51{
52public:
77
78public:
81 type_(kUndefined),
82 value_(0.0),
83 stamp_(0.0)
84 {}
85
92 EnvSensor(const Type & type, const double & value,const double & stamp = 0) :
93 type_(type),
94 value_(value),
95 stamp_(stamp)
96 {}
97
98 virtual ~EnvSensor() {}
99
101 const Type & type() const {return type_;}
103 const double & value() const {return value_;}
105 const double & stamp() const {return stamp_;}
106
107private:
108 Type type_;
109 double value_;
110 double stamp_;
111};
112
114typedef std::map<EnvSensor::Type, EnvSensor> EnvSensors;
115
116}
117
118#endif /* CORELIB_INCLUDE_RTABMAP_CORE_ENVSENSOR_H_ */
Single environmental measurement (type, value, timestamp).
Definition EnvSensor.h:51
const double & stamp() const
Definition EnvSensor.h:105
Type
Environmental sensor channel identifier.
Definition EnvSensor.h:59
@ kWifiSignalStrength
Wi‑Fi signal strength (dBm).
Definition EnvSensor.h:61
@ kCustomSensor8
User-defined sensor slot 8.
Definition EnvSensor.h:74
@ kAmbientAirPressure
Ambient air pressure (hPa).
Definition EnvSensor.h:63
@ kCustomSensor4
User-defined sensor slot 4.
Definition EnvSensor.h:70
@ kCustomSensor9
User-defined sensor slot 9.
Definition EnvSensor.h:75
@ kCustomSensor3
User-defined sensor slot 3.
Definition EnvSensor.h:69
@ kAmbientRelativeHumidity
Relative humidity (%).
Definition EnvSensor.h:65
@ kCustomSensor1
User-defined sensor slot 1.
Definition EnvSensor.h:67
@ kAmbientLight
Ambient illuminance (lx).
Definition EnvSensor.h:64
@ kCustomSensor2
User-defined sensor slot 2.
Definition EnvSensor.h:68
@ kAmbientTemperature
Ambient temperature (°C).
Definition EnvSensor.h:62
@ kUndefined
Uninitialized / unknown channel.
Definition EnvSensor.h:60
@ kCustomSensor7
User-defined sensor slot 7.
Definition EnvSensor.h:73
@ kCustomSensor6
User-defined sensor slot 6.
Definition EnvSensor.h:72
@ kCustomSensor5
User-defined sensor slot 5.
Definition EnvSensor.h:71
const double & value() const
Definition EnvSensor.h:103
EnvSensor()
Default constructor: kUndefined type, zero value and stamp.
Definition EnvSensor.h:80
EnvSensor(const Type &type, const double &value, const double &stamp=0)
Constructs a reading with the given type, value, and optional stamp.
Definition EnvSensor.h:92
const Type & type() const
Definition EnvSensor.h:101
std::map< EnvSensor::Type, EnvSensor > EnvSensors
Map of environmental readings keyed by EnvSensor::Type (at most one per type).
Definition EnvSensor.h:114