10 #include <gtest/gtest.h> 13 #include <test_mrpt_common.h> 19 const std::string& ini_filename,
const std::string& rawlog_filename,
24 const auto ini_fil = mrpt::UNITTEST_BASEDIR +
25 "/share/mrpt/config_files/kf-slam/"s + ini_filename;
28 const auto rawlog_fil =
29 mrpt::UNITTEST_BASEDIR +
"/share/mrpt/datasets/"s + rawlog_filename;
37 const char*
argv[] = {
"kf-slam",
ini_fil.c_str(), rawlog_fil.c_str()};
44 "MappingApplication",
"logOutput_dir",
53 catch (
const std::exception& e)
60 TEST(KFSLAMApp, EKF_SLAM_3D)
63 "EKF-SLAM_6D_test.ini",
"kf-slam_6D_demo.rawlog",
66 c.
write(
"MappingApplication",
"SHOW_3D_LIVE",
false);
67 c.
write(
"MappingApplication",
"SAVE_3D_SCENES",
true);
71 TEST(KFSLAMApp, EKF_SLAM_2D)
74 "EKF-SLAM_test_2d.ini",
"kf-slam_demo.rawlog",
77 c.
write(
"MappingApplication",
"SHOW_3D_LIVE",
false);
78 c.
write(
"MappingApplication",
"SAVE_3D_SCENES",
true);
82 TEST(KFSLAMApp, EKF_SLAM_3D_data_assoc_JCBB_Maha)
85 "EKF-SLAM_6D_test_datassoc.ini",
"kf-slam_6D_demo_DA.rawlog",
88 c.
write(
"RangeBearingKFSLAM",
"data_assoc_method",
"assocJCBB");
89 c.
write(
"RangeBearingKFSLAM",
"data_assoc_metric",
"metricMaha");
91 c.
write(
"MappingApplication",
"SHOW_3D_LIVE",
false);
92 c.
write(
"MappingApplication",
"SAVE_3D_SCENES",
false);
96 TEST(KFSLAMApp, EKF_SLAM_3D_data_assoc_NN_Maha)
99 "EKF-SLAM_6D_test_datassoc.ini",
"kf-slam_6D_demo_DA.rawlog",
102 c.
write(
"RangeBearingKFSLAM",
"data_assoc_method",
"assocNN");
103 c.
write(
"RangeBearingKFSLAM",
"data_assoc_metric",
"metricMaha");
105 c.
write(
"MappingApplication",
"SHOW_3D_LIVE",
false);
106 c.
write(
"MappingApplication",
"SAVE_3D_SCENES",
false);
EXPECT_LT(out.final_rmse, 3.0)
EXPECT_TRUE(mrpt::system::fileExists(ini_fil))
EKF-SLAM application wrapper class.
void initialize(int argc, const char **argv)
Initializes the application from CLI parameters.
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...
mrpt::config::CConfigFileMemory params
Populated in initialize().
void run()
Runs with the current parameter set.
TEST(KFSLAMApp, EKF_SLAM_3D)
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 generic_kf_slam_test(const std::string &ini_filename, const std::string &rawlog_filename, config_changer_t cfg_changer)
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())
double loc_error_wrt_gt
Average localization error, when supplied with a ground-truth file.
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...
std::function< void(mrpt::config::CConfigFileBase &)> config_changer_t