Go to the documentation of this file.
10 #include <gtest/gtest.h>
14 #include <test_mrpt_common.h>
24 const std::string& ini_filename,
const std::string& rawlog_filename,
28 using namespace std::string_literals;
30 const auto ini_fil = mrpt::UNITTEST_BASEDIR +
31 "/share/mrpt/config_files/pf-localization/"s +
35 const auto rawlog_fil =
36 mrpt::UNITTEST_BASEDIR +
"/share/mrpt/datasets/"s + rawlog_filename;
40 mrpt::UNITTEST_BASEDIR +
"/share/mrpt/datasets/"s + map_filename;
48 const char*
argv[] = {
"pf-localization-slam",
ini_fil.c_str(),
75 catch (
const std::exception& e)
86 EXPECT_EQ(o.out_estimated_path.size(), 37U);
87 if (o.out_estimated_path.empty())
return;
91 "[15.89 -10.0 0.000000 4.8 0.000000 0.000000]");
103 std::cerr <<
"Final pose mismatch (will retry N times):\n"
112 TEST(MonteCarloLocalization_Rawlog, RunForSampleDataset_2D)
114 using namespace std::string_literals;
115 for (
int tries = 0; tries < 5; tries++)
118 "localization_demo.ini",
"localization_demo.rawlog",
119 "localization_demo.simplemap.gz",
130 TEST(MonteCarloLocalization_Rawlog, RunForSampleDataset_3D)
132 using namespace std::string_literals;
133 for (
int tries = 0; tries < 5; tries++)
136 "localization_demo.ini",
"localization_demo.rawlog",
137 "localization_demo.simplemap.gz",
static auto tester_for_localization_demo
void initialize(int argc, const char **argv)
Initializes the application from CLI parameters.
void write(const std::string §ion, const std::string &name, enum_t value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string())
std::function< void(mrpt::apps::ICP_SLAM_App_Base &)> post_tester_t
bool allow_quit_on_esc_key
If true, will watch the keyboard and quit when ESC is pushed.
MonteCarlo (Particle filter) localization wrapper class for CLI or custom applications: virtual base ...
bool fill_out_estimated_path
Whether to populate out_estimated_path.
const std::string ini_fil
std::function< void(mrpt::config::CConfigFileBase &)> config_changer_t
std::string getTempFileName()
Returns the name of a proposed temporary file name.
static TPose3D FromString(const std::string &s)
MonteCarlo (Particle filter) localization wrapper class, reading from a rawlog dataset.
void run()
Runs with the current parameter set.
This class allows loading and storing values and vectors of different types from a configuration text...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void setMinLoggingLevel(const VerbosityLevel level)
Set the minimum logging level for which the incoming logs are going to be taken into account.
EXPECT_EQ(out.image_pair_was_used.size(), NUM_IMGS)
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
void generic_pf_test(const std::string &ini_filename, const std::string &rawlog_filename, const std::string &map_filename, config_changer_t cfg_changer, post_tester_t post_tester)
constexpr static auto sect
Default name of the main configuration section in INI files for this app.
static bool tester_result_ok
Traits for SE(n), rigid-body transformations in R^n space.
TEST(MonteCarloLocalization_Rawlog, RunForSampleDataset_2D)
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
#define ASSERT_FILE_EXISTS_(FIL)
mrpt::config::CConfigFileMemory params
Populated in initialize().
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[x y z yaw pitch roll]",...
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 15:49:54 UTC 2020 | |