Manage variables and methods related to applications executing graphSLAM using the mrpt-graphslam API.
As a quick overview, CGraphSlamHandler class instances deal with the following:
Definition at line 38 of file CGraphSlamHandler.h.
#include <mrpt/graphslam/apps_related/CGraphSlamHandler.h>
Public Member Functions | |
CGraphSlamHandler (mrpt::utils::COutputLogger *logger, mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_T > *options_checker, const bool enable_visuals) | |
Constructor. More... | |
~CGraphSlamHandler () | |
Destructor. More... | |
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... | |
Fetch the general configuraiton variables for | |
the current graphSLAM execution | |
void | getParamsAsString (std::string *str) const |
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::CWindowManager * | m_win_manager |
mrpt::graphslam::CWindowObserver * | m_win_observer |
mrpt::gui::CDisplayWindow3D * | m_win |
mrpt::utils::COutputLogger * | m_logger |
mrpt::graphslam::CGraphSlamEngine< GRAPH_T > * | m_engine |
Pointer to the engine instance. More... | |
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 |
bool | m_has_set_fnames |
bool | m_enable_visuals |
CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler | ( | mrpt::utils::COutputLogger * | logger, |
mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_T > * | options_checker, | ||
const bool | enable_visuals | ||
) |
Constructor.
Definition at line 17 of file CGraphSlamHandler_impl.h.
References ASSERT_, CGraphSlamHandler< GRAPH_T >::initVisualization(), CGraphSlamHandler< GRAPH_T >::m_enable_visuals, CGraphSlamHandler< GRAPH_T >::m_engine, CGraphSlamHandler< GRAPH_T >::m_logger, CGraphSlamHandler< GRAPH_T >::m_options_checker, CGraphSlamHandler< GRAPH_T >::m_win, CGraphSlamHandler< GRAPH_T >::m_win_manager, and CGraphSlamHandler< GRAPH_T >::m_win_observer.
CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler | ( | ) |
Destructor.
Definition at line 43 of file CGraphSlamHandler_impl.h.
References mrpt::gui::CDisplayWindow3D::forceRepaint(), CGraphSlamHandler< GRAPH_T >::initOutputDir(), mrpt::gui::CBaseGUIWindow::isOpen(), 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(), CGraphSlamHandler< GRAPH_T >::saveResults(), and mrpt::system::sleep().
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 381 of file CGraphSlamHandler_impl.h.
References ASSERT_, 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 |
Definition at line 284 of file CGraphSlamHandler_impl.h.
References ASSERT_, 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 324 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 240 of file CGraphSlamHandler_impl.h.
References ASSERT_, ASSERTMSG_, 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 89 of file CGraphSlamHandler_impl.h.
References ASSERTMSG_, mrpt::system::createDirectory(), mrpt::system::deleteFilesInDirectory(), mrpt::system::directoryExists(), mrpt::system::fileNameStripInvalidChars(), mrpt::system::getCurrentTime(), 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 417 of file CGraphSlamHandler_impl.h.
References mrpt::gui::CDisplayWindow3D::get3DSceneAndLock(), CGraphSlamHandler< GRAPH_T >::m_logger, CGraphSlamHandler< GRAPH_T >::m_win, CGraphSlamHandler< GRAPH_T >::m_win_manager, CGraphSlamHandler< GRAPH_T >::m_win_observer, mrpt::utils::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 277 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 448 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 194 of file CGraphSlamHandler_impl.h.
References ASSERTMSG_, mrpt::system::fileExists(), mrpt::format(), 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::utils::CConfigFileBase::read_bool(), and mrpt::utils::CConfigFileBase::read_string().
Referenced by CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 372 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 344 of file CGraphSlamHandler_impl.h.
References ASSERT_, 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 177 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 333 of file CGraphSlamHandler_impl.h.
References mrpt::system::fileNameStripInvalidChars(), CGraphSlamHandler< GRAPH_T >::m_logger, and CGraphSlamHandler< GRAPH_T >::m_output_dir_fname.
|
protected |
Definition at line 148 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Definition at line 150 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler(), CGraphSlamHandler< GRAPH_T >::saveResults(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Pointer to the engine instance.
Definition at line 142 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler(), 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 128 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initEngine(), and CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 149 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initEngine(), and CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 126 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::initEngine(), and CGraphSlamHandler< GRAPH_T >::setFNames().
|
protected |
Definition at line 138 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 146 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler(), and CGraphSlamHandler< GRAPH_T >::initEngine().
|
protected |
Definition at line 119 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 127 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 123 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 131 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 122 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 130 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 >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 132 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::readConfigFname(), and CGraphSlamHandler< GRAPH_T >::saveResults().
|
protected |
Definition at line 120 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::getParamsAsString(), CGraphSlamHandler< GRAPH_T >::initOutputDir(), and CGraphSlamHandler< GRAPH_T >::readConfigFname().
|
protected |
Definition at line 136 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler(), CGraphSlamHandler< GRAPH_T >::initVisualization(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Definition at line 134 of file CGraphSlamHandler.h.
Referenced by CGraphSlamHandler< GRAPH_T >::CGraphSlamHandler(), CGraphSlamHandler< GRAPH_T >::initEngine(), CGraphSlamHandler< GRAPH_T >::initVisualization(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
protected |
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |