MRPT
1.9.9
|
Manage variables and methods related to applications executing graphSLAM using the mrpt-graphslam API.
CGraphSlamHandler class instances deal with the following:
Definition at line 34 of file CGraphSlamHandler.h.
#include <mrpt/graphslam/apps_related/CGraphSlamHandler.h>
Public Member Functions | |
CGraphSlamHandler (mrpt::system::COutputLogger *logger, mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_T > *options_checker, const bool enable_visuals=true) | |
~CGraphSlamHandler () | |
void | setFNames (const std::string &ini_fname, const std::string &rawlog_fname, const std::string &ground_truth_fname=std::string()) |
Set the relevant filenames for instantiating CGraphSlamEngine instance. More... | |
void | printParams () const |
Print in a formatted manner the general configuraiton variables for the current graphSLAM execution. More... | |
void | initVisualization () |
Initialize visualization (e.g. More... | |
void | execute () |
Method to be called for parsing the rawlog file provided and for running graphSLAM using that information. More... | |
void | initEngine (const std::string &node_reg_str, const std::string &edge_reg_str, const std::string &optimizer_str) |
void | setResultsDirName (const std::string &dirname) |
Override the results directory filename that was initially set in the .ini file. More... | |
void | getParamsAsString (std::string *str) const |
Fetch the general configuraiton variables for the current graphSLAM execution. More... | |
std::string | getParamsAsString () const |
Protected Member Functions | |
void | initOutputDir (const std::string &output_dir_fname="graphslam_results") |
Initialize (clean up and create new files) the output directory. More... | |
bool | queryObserverForEvents () |
Query the CWindowObserver instance for any pressed keys that might be of interest (e.g. More... | |
void | readConfigFname (const std::string &fname) |
Read configuration variables for the current graphSLAM execution from a .ini file. More... | |
void | saveResults (const std::string &output_dir_fname) |
void | saveMap (const std::string &fname) |
Protected Attributes | |
std::string | m_output_dir_fname |
bool | m_user_decides_about_output_dir |
bool | m_save_graph |
bool | m_save_3DScene |
bool | m_save_map |
std::string | m_ini_fname |
std::string | m_rawlog_fname |
std::string | m_gt_fname |
std::string | m_save_graph_fname |
std::string | m_save_3DScene_fname |
std::string | m_save_map_fname |
mrpt::graphslam::CGraphSlamEngine< GRAPH_T > * | m_engine = nullptr |
mrpt::graphslam::CWindowManager * | m_win_manager = nullptr |
mrpt::graphslam::CWindowObserver * | m_win_observer = nullptr |
mrpt::gui::CDisplayWindow3D * | m_win = nullptr |
mrpt::system::COutputLogger * | m_logger |
mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_T > * | m_options_checker |
TUserOptionsChecker instance whose task is to evaluate the Registration Decider, Optimizer instances that are given by the user. More... | |
bool | m_do_save_results = true |
bool | m_has_set_fnames = false |
bool | m_enable_visuals |
CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler | ( | mrpt::system::COutputLogger * | logger, |
mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_T > * | options_checker, | ||
const bool | enable_visuals = true |
||
) |
Definition at line 18 of file CGraphSlamHandler_impl.h.
References ASSERTDEB_, CGraphSlamHandler< GRAPH_T >::initVisualization(), CGraphSlamHandler< GRAPH_T >::m_enable_visuals, CGraphSlamHandler< GRAPH_T >::m_logger, and CGraphSlamHandler< GRAPH_T >::m_options_checker.
CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler | ( | ) |
Definition at line 37 of file CGraphSlamHandler_impl.h.
References mrpt::gui::CDisplayWindow3D::forceRepaint(), CGraphSlamHandler< GRAPH_T >::initOutputDir(), mrpt::gui::CBaseGUIWindow::isOpen(), mrpt::system::COutputLogger::logFmt(), mrpt::system::LVL_DEBUG, mrpt::system::LVL_INFO, mrpt::system::LVL_WARN, CGraphSlamHandler< GRAPH_T >::m_do_save_results, CGraphSlamHandler< GRAPH_T >::m_enable_visuals, CGraphSlamHandler< GRAPH_T >::m_engine, CGraphSlamHandler< GRAPH_T >::m_logger, CGraphSlamHandler< GRAPH_T >::m_output_dir_fname, CGraphSlamHandler< GRAPH_T >::m_win, CGraphSlamHandler< GRAPH_T >::m_win_manager, CGraphSlamHandler< GRAPH_T >::m_win_observer, CGraphSlamHandler< GRAPH_T >::queryObserverForEvents(), and CGraphSlamHandler< GRAPH_T >::saveResults().
void CGraphSlamHandler< GRAPH_T >::execute | ( | ) |
Method to be called for parsing the rawlog file provided and for running graphSLAM using that information.
Definition at line 377 of file CGraphSlamHandler_impl.h.
References mrpt::serialization::archiveFrom(), ASSERTDEB_, mrpt::system::COutputLogger::logFmt(), mrpt::system::LVL_WARN, CGraphSlamHandler< GRAPH_T >::m_engine, CGraphSlamHandler< GRAPH_T >::m_logger, and CGraphSlamHandler< GRAPH_T >::m_rawlog_fname.
void CGraphSlamHandler< GRAPH_T >::getParamsAsString | ( | std::string * | str | ) | const |
Fetch the general configuraiton variables for the current graphSLAM execution.
Definition at line 283 of file CGraphSlamHandler_impl.h.
References ASSERTDEB_, CGraphSlamHandler< GRAPH_T >::m_output_dir_fname, CGraphSlamHandler< GRAPH_T >::m_rawlog_fname, CGraphSlamHandler< GRAPH_T >::m_save_3DScene, CGraphSlamHandler< GRAPH_T >::m_save_3DScene_fname, CGraphSlamHandler< GRAPH_T >::m_save_graph, CGraphSlamHandler< GRAPH_T >::m_save_graph_fname, and CGraphSlamHandler< GRAPH_T >::m_user_decides_about_output_dir.
std::string CGraphSlamHandler< GRAPH_T >::getParamsAsString | ( | ) | const |
Definition at line 319 of file CGraphSlamHandler_impl.h.
Referenced by CGraphSlamHandler< GRAPH_T >::printParams().
void CGraphSlamHandler< GRAPH_T >::initEngine | ( | const std::string & | node_reg_str, |
const std::string & | edge_reg_str, | ||
const std::string & | optimizer_str | ||
) |
Definition at line 246 of file CGraphSlamHandler_impl.h.
References ASSERTDEB_, ASSERTDEBMSG_, mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_t >::checkOptimizerExists(), mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_t >::checkRegistrationDeciderExists(), mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_t >::edge_regs_map, CGraphSlamHandler< GRAPH_T >::m_engine, CGraphSlamHandler< GRAPH_T >::m_gt_fname, CGraphSlamHandler< GRAPH_T >::m_has_set_fnames, CGraphSlamHandler< GRAPH_T >::m_ini_fname, CGraphSlamHandler< GRAPH_T >::m_options_checker, CGraphSlamHandler< GRAPH_T >::m_rawlog_fname, CGraphSlamHandler< GRAPH_T >::m_win_manager, mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_t >::node_regs_map, and mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_t >::optimizers_map.
|
protected |
Initialize (clean up and create new files) the output directory.
If directory already exists (most probably from previous runs), the user is given 3 options:
User can also set the .ini parameter user_decides_about_output_dir flag to false, if he doesn't care about the previous results directory. In this case the 1st choice is picked.
[in] | Name | of the output directory to be used |
Definition at line 100 of file CGraphSlamHandler_impl.h.
References ASSERTDEBMSG_, mrpt::system::createDirectory(), mrpt::system::deleteFilesInDirectory(), mrpt::system::directoryExists(), mrpt::system::fileNameStripInvalidChars(), getCurrentTime(), mrpt::system::COutputLogger::logFmt(), mrpt::system::LVL_INFO, CGraphSlamHandler< GRAPH_T >::m_logger, CGraphSlamHandler< GRAPH_T >::m_user_decides_about_output_dir, MRPT_END, MRPT_START, mrpt::system::renameFile(), mrpt::system::timeToString(), and mrpt::system::trim().
Referenced by CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
void CGraphSlamHandler< GRAPH_T >::initVisualization | ( | ) |
Initialize visualization (e.g.
the CDisplayWindow instance that shows the overall graphSLAM execution)
Definition at line 405 of file CGraphSlamHandler_impl.h.
References mrpt::gui::CDisplayWindow3D::get3DSceneAndLock(), mrpt::system::COutputLogger::logFmt(), mrpt::system::LVL_DEBUG, CGraphSlamHandler< GRAPH_T >::m_logger, CGraphSlamHandler< GRAPH_T >::m_win, CGraphSlamHandler< GRAPH_T >::m_win_manager, CGraphSlamHandler< GRAPH_T >::m_win_observer, mrpt::system::CObserver::observeBegin(), mrpt::graphslam::CWindowManager::setCDisplayWindow3DPtr(), mrpt::gui::CDisplayWindow3D::setPos(), mrpt::graphslam::CWindowManager::setWindowObserverPtr(), and mrpt::gui::CDisplayWindow3D::unlockAccess3DScene().
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler().
void CGraphSlamHandler< GRAPH_T >::printParams | ( | ) | const |
Print in a formatted manner the general configuraiton variables for the current graphSLAM execution.
Definition at line 276 of file CGraphSlamHandler_impl.h.
References CGraphSlamHandler< GRAPH_T >::getParamsAsString(), and CGraphSlamHandler< GRAPH_T >::m_engine.
|
protected |
Query the CWindowObserver instance for any pressed keys that might be of interest (e.g.
<C-c>)
Definition at line 434 of file CGraphSlamHandler_impl.h.
References CGraphSlamHandler< GRAPH_T >::m_win_observer, and mrpt::graphslam::CWindowObserver::returnEventsStruct().
Referenced by CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Read configuration variables for the current graphSLAM execution from a .ini file.
Definition at line 216 of file CGraphSlamHandler_impl.h.
References ASSERTDEBMSG_, mrpt::system::fileExists(), mrpt::format(), mrpt::system::COutputLogger::logFmt(), mrpt::system::LVL_INFO, CGraphSlamHandler< GRAPH_T >::m_logger, CGraphSlamHandler< GRAPH_T >::m_output_dir_fname, CGraphSlamHandler< GRAPH_T >::m_save_3DScene, CGraphSlamHandler< GRAPH_T >::m_save_3DScene_fname, CGraphSlamHandler< GRAPH_T >::m_save_graph, CGraphSlamHandler< GRAPH_T >::m_save_graph_fname, CGraphSlamHandler< GRAPH_T >::m_save_map, CGraphSlamHandler< GRAPH_T >::m_save_map_fname, CGraphSlamHandler< GRAPH_T >::m_user_decides_about_output_dir, mrpt::config::CConfigFileBase::read_bool(), and mrpt::config::CConfigFileBase::read_string().
Referenced by CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 367 of file CGraphSlamHandler_impl.h.
References mrpt::maps::COccupancyGridMap2D::Create(), and CGraphSlamHandler< GRAPH_T >::m_engine.
Referenced by CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 336 of file CGraphSlamHandler_impl.h.
References ASSERTDEB_, mrpt::system::COutputLogger::logFmt(), mrpt::system::LVL_INFO, CGraphSlamHandler< GRAPH_T >::m_enable_visuals, CGraphSlamHandler< GRAPH_T >::m_engine, CGraphSlamHandler< GRAPH_T >::m_logger, CGraphSlamHandler< GRAPH_T >::m_save_3DScene, CGraphSlamHandler< GRAPH_T >::m_save_3DScene_fname, CGraphSlamHandler< GRAPH_T >::m_save_graph, CGraphSlamHandler< GRAPH_T >::m_save_graph_fname, CGraphSlamHandler< GRAPH_T >::m_save_map, CGraphSlamHandler< GRAPH_T >::m_save_map_fname, and CGraphSlamHandler< GRAPH_T >::saveMap().
Referenced by CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
void CGraphSlamHandler< GRAPH_T >::setFNames | ( | const std::string & | ini_fname, |
const std::string & | rawlog_fname, | ||
const std::string & | ground_truth_fname = std::string() |
||
) |
Set the relevant filenames for instantiating CGraphSlamEngine instance.
Definition at line 202 of file CGraphSlamHandler_impl.h.
References CGraphSlamHandler< GRAPH_T >::m_gt_fname, CGraphSlamHandler< GRAPH_T >::m_has_set_fnames, CGraphSlamHandler< GRAPH_T >::m_ini_fname, CGraphSlamHandler< GRAPH_T >::m_rawlog_fname, and CGraphSlamHandler< GRAPH_T >::readConfigFname().
void CGraphSlamHandler< GRAPH_T >::setResultsDirName | ( | const std::string & | dirname | ) |
Override the results directory filename that was initially set in the .ini file.
Definition at line 327 of file CGraphSlamHandler_impl.h.
References mrpt::system::fileNameStripInvalidChars(), mrpt::system::COutputLogger::logFmt(), mrpt::system::LVL_WARN, CGraphSlamHandler< GRAPH_T >::m_logger, and CGraphSlamHandler< GRAPH_T >::m_output_dir_fname.
|
protected |
Definition at line 139 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Definition at line 141 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler(), CGraphSlamHandler< GRAPH_T >::saveResults(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Definition at line 127 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::execute(), CGraphSlamHandler< GRAPH_T >::initEngine(), CGraphSlamHandler< GRAPH_T >::printParams(), CGraphSlamHandler< GRAPH_T >::saveMap(), CGraphSlamHandler< GRAPH_T >::saveResults(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Definition at line 121 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initEngine(), and CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 140 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initEngine(), and CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 119 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initEngine(), and CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 132 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler(), CGraphSlamHandler< GRAPH_T >::execute(), CGraphSlamHandler< GRAPH_T >::initOutputDir(), CGraphSlamHandler< GRAPH_T >::initVisualization(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), CGraphSlamHandler< GRAPH_T >::saveResults(), CGraphSlamHandler< GRAPH_T >::setResultsDirName(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
TUserOptionsChecker instance whose task is to evaluate the Registration Decider, Optimizer instances that are given by the user.
Definition at line 137 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler(), and CGraphSlamHandler< GRAPH_T >::initEngine().
|
protected |
Definition at line 112 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), CGraphSlamHandler< GRAPH_T >::setResultsDirName(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Definition at line 120 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::execute(), CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::initEngine(), and CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 116 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 124 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 115 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 123 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 117 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 125 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 113 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::initOutputDir(), and CGraphSlamHandler< GRAPH_T >::readConfigFname().
|
protected |
Definition at line 130 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initVisualization(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Definition at line 128 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initEngine(), CGraphSlamHandler< GRAPH_T >::initVisualization(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Definition at line 129 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initVisualization(), CGraphSlamHandler< GRAPH_T >::queryObserverForEvents(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019 |