Go to the documentation of this file.
28 int main(
int argc,
char** argv)
31 string rawlog_file, sensorLabel;
32 int enoseID, sensorType, indexMonitoredSensor,
35 bool have_estimation, apply_delay;
40 cout <<
"Using configuration from './CONFIG_MOXmodel.ini'" << endl;
43 rawlog_file = conf.read_string(
"",
"rawlog_file",
"",
true);
44 sensorLabel = conf.read_string(
"",
"sensorLabel",
"Full_MCEnose",
true);
45 enoseID = conf.read_int(
"",
"enoseID", 0,
true);
47 conf.read_string(
"",
"sensorType",
"-1",
true);
48 stringstream convert(sensorType_str);
49 convert >> std::hex >> sensorType;
52 apply_delay = conf.read_bool(
"",
"apply_delay",
false,
true);
53 delay_value = conf.read_int(
"",
"delay_value", 0,
true);
56 MOSmodel.
a_rise = conf.read_float(
"",
"a_rise", 0.0,
true);
57 MOSmodel.
b_rise = conf.read_float(
"",
"b_rise", 0.0,
true);
58 MOSmodel.
a_decay = conf.read_float(
"",
"a_decay", 0.0,
true);
59 MOSmodel.
b_decay = conf.read_float(
"",
"b_decay", 0.0,
true);
60 MOSmodel.
winNoise_size = conf.read_int(
"",
"winNoise_size", 0,
true);
61 MOSmodel.
decimate_value = conf.read_int(
"",
"decimate_value", 0,
true);
64 indexMonitoredSensor = -1;
68 cout <<
"Configuration file (ini) cannot be found\n" << endl;
75 cout <<
"Processing Rawlog " << rawlog_file << endl;
76 cout <<
"Obtaining MOXmodel from " << sensorLabel <<
"(" << enoseID
77 <<
") - sensor " << sensorType << endl;
81 file_input.
open(rawlog_file);
82 file_output.
open(
"MOX_model_output.rawlog");
85 cout <<
"Error opening rawlog file" << endl;
101 std::dynamic_pointer_cast<CObservationGasSensors>(o);
106 obs->timestamp - delay_value * 10000000;
108 if (obs->sensorLabel == sensorLabel)
118 obs->m_readings[enoseID].readingsVoltage);
123 if (indexMonitoredSensor == -1)
127 for (indexMonitoredSensor = 0;
128 indexMonitoredSensor <
129 (int)obs->m_readings[enoseID]
131 indexMonitoredSensor++)
133 if (obs->m_readings[enoseID].sensorTypes.at(
134 indexMonitoredSensor) ==
135 std::vector<int>::value_type(
141 if (indexMonitoredSensor <
142 (
int)obs->m_readings[enoseID]
146 obs->m_readings[enoseID].readingsVoltage.at(
147 indexMonitoredSensor);
152 cout <<
"sensorType not found. Computing the "
156 obs->m_readings[enoseID].readingsVoltage);
162 obs->m_readings[enoseID].eNosePoseOnTheRobot;
163 float MOXmodel_estimation = raw_reading;
169 MOXmodel_estimation, MOXmodel_timestamp);
182 MOXmodel_estimation);
191 obs_GDM->timestamp = MOXmodel_timestamp;
192 obs_GDM->m_readings.push_back(gd_est);
206 cout <<
"Exception: " << e.what() << endl;
float a_rise
tau = a*AMPLITUDE +b (linear relationship)
float b_rise
tau = a*AMPLITUDE +b (linear relationship)
float temperature
Sensed temperature in Celcius (valid if hasTemperature=true only)
std::string sensorLabel
An arbitrary label that can be used to identify the sensor.
std::shared_ptr< CSerializable > Ptr
size_t winNoise_size
The size of the mobile average window used to reduce noise on sensor reagings.
double mean(const CONTAINER &v)
Computes the mean value of a vector.
Declares a class within "CObservationGasSensors" that represents a set of gas concentration readings ...
std::shared_ptr< T > make_aligned_shared(Args &&... args)
Creates a shared_ptr with aligned memory via aligned_allocator_cpp11<>.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
std::vector< int > sensorTypes
The kind of sensors in the array (size of "sensorTypes" is the same that the size of "readingsVoltage...
This namespace contains representation of robot actions and observations.
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
std::vector< float > readingsVoltage
The set of readings (in volts) from the array of sensors (size of "sensorTypes" is the same that the ...
math::TPose3D eNosePoseOnTheRobot
The pose of the sensors on the robot.
Saves data to a file and transparently compress the data using the given compression level.
float a_decay
tau = a*AMPLITUDE +b (linear relationship)
bool isActive
True if the input to this chamber/enose is poluted air, False if clean air.
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::rtti::CObject) is of the give...
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
bool hasTemperature
Must be true for "temperature" to contain a valid measurement.
The structure for each e-nose.
Declares a class derived from "CObservation" that represents a set of readings from gas sensors.
bool fileOpenCorrectly() const
Returns true if the file was open without errors.
void close()
Close the file.
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream,...
bool open(const std::string &fileName, int compress_level=1)
Open a file for write, choosing the compression level.
float b_decay
tau = a*AMPLITUDE +b (linear relationship)
This class allows loading and storing values and vectors of different types from "....
This base provides a set of functions for maths stuff.
GLsizei const GLchar ** string
bool get_GasDistribution_estimation(float &reading, mrpt::system::TTimeStamp ×tamp)
Obtain an estimation of the gas distribution based on raw sensor readings
std::shared_ptr< CObservationGasSensors > Ptr
int decimate_value
[useMOSmodel] The decimate frecuency applied after noise filtering
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |