Main MRPT website > C++ reference for 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-2017, 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 
12 #include <mrpt/utils/CStream.h>
14 #include <mrpt/slam/TKLDParams.h>
15 
16 using namespace mrpt::slam;
17 using namespace mrpt::utils;
18 
19 /*---------------------------------------------------------------
20  TKLDParams
21  ---------------------------------------------------------------*/
23  : KLD_binSize_XY(0.2f),
24  KLD_binSize_PHI(DEG2RAD(5)),
25  KLD_delta(0.01f),
26  KLD_epsilon(0.02f),
27  KLD_minSampleSize(250),
28  KLD_maxSampleSize(100000),
29  KLD_minSamplesPerBin(0)
30 {
31 }
32 
33 /*---------------------------------------------------------------
34  dumpToTextStream
35  ---------------------------------------------------------------*/
37 {
38  out.printf("\n----------- [TKLDParams] ------------ \n\n");
39 
40  out.printf(
41  "KLD_minSampleSize = %i\n", KLD_minSampleSize);
42  out.printf(
43  "KLD_maxSampleSize = %i\n", KLD_maxSampleSize);
44  out.printf(
45  "KLD_binSize_XY = %f m\n", KLD_binSize_XY);
46  out.printf(
47  "KLD_binSize_PHI = %f deg\n",
49  out.printf("KLD_delta = %f\n", KLD_delta);
50  out.printf("KLD_epsilon = %f\n", KLD_epsilon);
51  out.printf("\n");
52 }
53 
54 /*---------------------------------------------------------------
55  loadFromConfigFile
56  ---------------------------------------------------------------*/
58  const mrpt::utils::CConfigFileBase& iniFile, const std::string& section)
59 {
60  MRPT_LOAD_CONFIG_VAR(KLD_minSampleSize, int, iniFile, section);
61  MRPT_LOAD_CONFIG_VAR(KLD_maxSampleSize, int, iniFile, section);
62 
63  MRPT_LOAD_CONFIG_VAR(KLD_binSize_XY, double, iniFile, section);
65  MRPT_LOAD_CONFIG_VAR(KLD_delta, double, iniFile, section);
66  MRPT_LOAD_CONFIG_VAR(KLD_epsilon, double, iniFile, section);
67  MRPT_LOAD_CONFIG_VAR(KLD_minSamplesPerBin, double, iniFile, section);
68 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
void dumpToTextStream(mrpt::utils::CStream &out) const override
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
Definition: TKLDParams.cpp:36
This class allows loading and storing values and vectors of different types from a configuration text...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
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:41
double KLD_minSamplesPerBin
(Default: KLD_minSamplesPerBin=0) The minimum number of samples will be the maximum of KLD_minSampleS...
Definition: TKLDParams.h:46
void loadFromConfigFile(const mrpt::utils::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:57
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:35
#define DEG2RAD
GLsizei const GLchar ** string
Definition: glext.h:4101
unsigned int KLD_maxSampleSize
Definition: TKLDParams.h:41
#define RAD2DEG
#define MRPT_LOAD_CONFIG_VAR_DEGREES( variableName, configFileObject, sectionNameStr)
Loads a double variable, stored as radians but entered in the INI-file as degrees.
#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...
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
Definition: CStream.cpp:597



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019