10 #include <gtest/gtest.h> 14 #include <test_mrpt_common.h> 18 using post_tester_t = std::function<void(mrpt::apps::RBPF_SLAM_App_Base&)>;
21 const std::string& ini_filename,
const std::string& rawlog_filename,
26 const auto ini_fil = mrpt::UNITTEST_BASEDIR +
27 "/share/mrpt/config_files/rbpf-slam/"s + ini_filename;
30 const auto rawlog_fil =
31 mrpt::UNITTEST_BASEDIR +
"/share/mrpt/datasets/"s + rawlog_filename;
39 const char*
argv[] = {
"rbpf-slam",
ini_fil.c_str(), rawlog_fil.c_str()};
45 "MappingApplication",
"logOutput_dir",
48 "MappingApplication",
"SHOW_PROGRESS_IN_WINDOW",
false);
51 app.
params.
write(
"MappingApplication",
"SAVE_3D_SCENE",
false);
52 app.
params.
write(
"MappingApplication",
"LOG_FREQUENCY", 0);
61 catch (
const std::exception& e)
69 EXPECT_EQ(o.out_estimated_path.size(), 224U);
72 "[3.4548 -18.0399 0.000000 -86.48 0.000000 0.000000]");
75 <<
"actual pose =" << p.asString()
76 <<
"\nexpected pose=" << p_gt.
asString();
80 EXPECT_EQ(o.out_estimated_path.size(), 99U);
83 "[1.938686 3.352273 0.000000 114.993417 0.000000 0.000000]");
86 <<
"actual pose =" << p.asString()
87 <<
"\nexpected pose=" << p_gt.
asString();
89 MRPT_TODO(
"Stricter unit tests: check for estimated landmark positions");
92 TEST(RBPF_SLAM_App, MapFromRawlog_Lidar2D_optimal_sampling)
97 "gridmapping_optimal_sampling.ini",
98 "2006-01ENE-21-SENA_Telecom Faculty_one_loop_only.rawlog",
102 TEST(RBPF_SLAM_App, MapFromRawlog_Lidar2D_gridICP)
107 "gridmapping_RBPF_grid_ICPbased_malaga.ini",
108 "2006-01ENE-21-SENA_Telecom Faculty_one_loop_only.rawlog",
112 TEST(RBPF_SLAM_App, MapFromRawlog_Lidar2D_pointsICP)
117 "gridmapping_RBPF_ICPbased_malaga.ini",
118 "2006-01ENE-21-SENA_Telecom Faculty_one_loop_only.rawlog",
122 TEST(RBPF_SLAM_App, MapFromRawlog_ROSLAM_MC)
127 "RO-SLAM_simulatedData_MC.ini",
"RO-SLAM_demo.rawlog",
131 TEST(RBPF_SLAM_App, MapFromRawlog_ROSLAM_SOG)
136 "RO-SLAM_simulatedData_SOG.ini",
"RO-SLAM_demo.rawlog",
EXPECT_LT(out.final_rmse, 3.0)
Instance of RBPF_SLAM_App_Base to run mapping from an offline dataset file.
void run()
Runs with the current parameter set.
EXPECT_TRUE(mrpt::system::fileExists(ini_fil))
static CPose3D FromString(const std::string &s)
TEST(RBPF_SLAM_App, MapFromRawlog_Lidar2D_optimal_sampling)
std::function< void(mrpt::apps::ICP_SLAM_App_Base &)> post_tester_t
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
void setMinLoggingLevel(const VerbosityLevel level)
Set the minimum logging level for which the incoming logs are going to be taken into account...
This class allows loading and storing values and vectors of different types from a configuration text...
std::string getTempFileName()
Returns the name of a proposed temporary file name.
void initialize(int argc, const char **argv)
Initializes the application from CLI parameters.
static auto tester_for_2006_01_21
const std::string ini_fil
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())
RBPF-SLAM virtual base class for application wrappers.
Traits for SE(n), rigid-body transformations in R^n space.
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[x y z yaw pitch roll]"...
mrpt::config::CConfigFileMemory params
Populated in initialize().
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
EXPECT_EQ(out.image_pair_was_used.size(), NUM_IMGS)
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...
MRPT_TODO("toPointCloud / calibration")
static auto tester_for_ROSLAM_demo
std::function< void(mrpt::config::CConfigFileBase &)> config_changer_t
CONTAINER::Scalar norm(const CONTAINER &v)
void generic_rbpf_slam_test(const std::string &ini_filename, const std::string &rawlog_filename, config_changer_t cfg_changer, post_tester_t post_tester)