MRPT  1.9.9
TKLDParams.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "slam-precomp.h" // Precompiled headers
11 
14 #include <mrpt/slam/TKLDParams.h>
15 
16 using namespace mrpt::slam;
17 
18 /*---------------------------------------------------------------
19  TKLDParams
20  ---------------------------------------------------------------*/
22  : KLD_binSize_XY(0.2f),
23  KLD_binSize_PHI(DEG2RAD(5)),
24  KLD_delta(0.01f),
25  KLD_epsilon(0.02f),
26  KLD_minSampleSize(250),
27  KLD_maxSampleSize(100000),
28  KLD_minSamplesPerBin(0)
29 {
30 }
31 
32 /*---------------------------------------------------------------
33  dumpToTextStream
34  ---------------------------------------------------------------*/
35 void TKLDParams::dumpToTextStream(std::ostream& out) const
36 {
37  out << mrpt::format("\n----------- [TKLDParams] ------------ \n\n");
38 
39  out << mrpt::format(
40  "KLD_minSampleSize = %i\n", KLD_minSampleSize);
41  out << mrpt::format(
42  "KLD_maxSampleSize = %i\n", KLD_maxSampleSize);
43  out << mrpt::format(
44  "KLD_binSize_XY = %f m\n", KLD_binSize_XY);
45  out << mrpt::format(
46  "KLD_binSize_PHI = %f deg\n",
48  out << mrpt::format(
49  "KLD_delta = %f\n", KLD_delta);
50  out << mrpt::format(
51  "KLD_epsilon = %f\n", KLD_epsilon);
52  out << mrpt::format("\n");
53 }
54 
55 /*---------------------------------------------------------------
56  loadFromConfigFile
57  ---------------------------------------------------------------*/
59  const mrpt::config::CConfigFileBase& iniFile, const std::string& section)
60 {
63 
64  MRPT_LOAD_CONFIG_VAR(KLD_binSize_XY, double, iniFile, section);
66  MRPT_LOAD_CONFIG_VAR(KLD_delta, double, iniFile, section);
67  MRPT_LOAD_CONFIG_VAR(KLD_epsilon, double, iniFile, section);
69 }
double RAD2DEG(const double x)
Radians to degrees.
double DEG2RAD(const double x)
Degrees to radians.
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form, sending it to a std::ostream.
Definition: TKLDParams.cpp:35
unsigned int KLD_minSampleSize
Parameters for the KLD adaptive sample size algorithm (see Dieter Fox&#39;s papers), which is used only i...
Definition: TKLDParams.h:38
This class allows loading and storing values and vectors of different types from a configuration text...
double KLD_minSamplesPerBin
(Default: KLD_minSamplesPerBin=0) The minimum number of samples will be the maximum of KLD_minSampleS...
Definition: TKLDParams.h:43
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
Definition: TKLDParams.cpp:58
string iniFile(myDataDir+string("benchmark-options.ini"))
double KLD_binSize_XY
Parameters for the KLD adaptive sample size algorithm (see Dieter Fox&#39;s papers), which is used only i...
Definition: TKLDParams.h:32
GLsizei const GLchar ** string
Definition: glext.h:4101
unsigned int KLD_maxSampleSize
Definition: TKLDParams.h:38
#define MRPT_LOAD_CONFIG_VAR( variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Definition: format.cpp:16
#define MRPT_LOAD_CONFIG_VAR_DEGREES( variableName, configFileObject, sectionNameStr)
Loads a double variable, stored as radians but entered in the INI-file as degrees.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020