24 CTopLCDetector_GridMatching::CTopLCDetector_GridMatching(
CHMTSLAM *hmtslam ) :
41 const CHMHMapNodePtr ¤tArea,
42 const CHMHMapNodePtr &refArea,
54 const CPose2D initEstimate(0,0,0);
63 ASSERT_( hMapRef->m_gridMaps.size()>=1 )
64 ASSERT_( hMapCur->m_gridMaps.size()>=1 )
77 CPosePDFPtr alignRes = gridAligner.
Align(
86 hMapCur->m_gridMaps[0]->saveAsBitmapFileWithLandmarks(
"map1.png",
info.landmarks_map1.pointer());
87 hMapRef->m_gridMaps[0]->saveAsBitmapFileWithLandmarks(
"map2.png",
info.landmarks_map2.pointer());
92 CPose3DPDFPtr
res = CPose3DPDFPtr( CPose3DPDF::createFrom2D(*alignRes) );
104 const std::string filStat = dbg_dir+
format(
"/state_%05i_test_%i_%i.hmtslam",cnt,(
int)currentArea->getID(),(int)refArea->getID());
105 const std::string filRes = dbg_dir+
format(
"/state_%05i_test_%i_%i_result.txt",cnt,(
int)currentArea->getID(),(int)refArea->getID() );
108 m_hmtslam->logFmt(mrpt::utils::LVL_DEBUG,
"[TLCD_gridmatch] DEBUG: Saving %s\n",filStat.c_str());
112 m_hmtslam->logFmt(mrpt::utils::LVL_DEBUG,
"[TLCD_gridmatch] DEBUG: Saving %s\n",filRes.c_str());
114 f_res.
printf(
"# SOG modes: %i\n",(
int)CPosePDFSOGPtr(alignRes)->
size() );
115 f_res.
printf(
"ICP goodness: ");
146 matchingOptions.loadFromConfigFile(
source,section);
151 out.
printf(
"\n----------- [CTopLCDetector_GridMatching::TOptions] ------------ \n\n");
152 matchingOptions.dumpToTextStream(out);
bool BASE_IMPEXP createDirectory(const std::string &dirName)
Creates a directory.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
mrpt::poses::CPosePDFPtr Align(const mrpt::maps::CMetricMap *m1, const mrpt::maps::CMetricMap *m2, const mrpt::poses::CPose2D &grossEst, float *runningTime=NULL, void *info=NULL)
The method for aligning a pair of metric maps, aligning only 2D + orientation.
A class for aligning two multi-metric maps (with an occupancy grid maps and a points map...
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) MRPT_OVERRIDE
This method load the options from a ".ini"-like file or memory-stored string list.
mrpt::slam::CGridMapAligner::TConfigParams matchingOptions
Options for the grid-to-grid matching algorithm.
CTopLCDetector_GridMatching::TOptions TLC_grid_options
Options passed to this TLC constructor.
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
The ICP algorithm return information.
virtual ~CTopLCDetector_GridMatching()
Destructor.
An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
This class allows loading and storing values and vectors of different types from a configuration text...
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
TOptions()
Initialization of default params.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
std::string LOG_OUTPUT_DIR
[LOGGING] If it is not an empty string (""), a directory with that name will be created and log files...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
This CStream derived class allow using a file as a write-only, binary stream.
virtual int void printf_vector(const char *fmt, const CONTAINER_TYPE &V, char separator=',')
Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector e...
mrpt::maps::CMultiMetricMapPtr CMultiMetricMapPtr
Backward compatible typedef.
This namespace contains representation of robot actions and observations.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
mrpt::hmtslam::CHMTSLAM::TOptions m_options
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
#define NODE_ANNOTATION_METRIC_MAPS
GLsizei const GLchar ** string
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
bool saveState(mrpt::utils::CStream &out) const
Save the state of the whole HMT-SLAM framework to some binary stream (e.g.
#define CFileGZOutputStream
Saves data to a file and transparently compress the data using the given compression level...
Options for a TLC-detector of type gridmap-matching, used from CHMTSLAM.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
mrpt::poses::CPose3DPDFPtr computeTopologicalObservationModel(const THypothesisID &hypID, const CHMHMapNodePtr ¤tArea, const CHMHMapNodePtr &refArea, double &out_log_lik)
This method must compute the topological observation model.
void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
GLsizei GLsizei GLchar * source
void dumpToConsole() const
Just like dumpToTextStream() but sending the text to the console (std::cout)
mrpt::slam::CGridMapAligner::TConfigParams options
This class stores any customizable set of metric maps.
void OnNewPose(const TPoseID &poseID, const mrpt::obs::CSensoryFrame *SF)
Hook method for being warned about the insertion of a new poses into the maps.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.