An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
The main entry points for a user are pushAction() and pushObservations(). Several parameters can be modified through m_options.
The mathematical models of this approach have been reported in:
More information in the wiki page: http://www.mrpt.org/HMT-SLAM . A complete working application can be found in "MRPT/apps/hmt-slam".
The complete state of the SLAM framework is serializable, so it can be saved and restore to/from a binary dump. This class implements mrpt::utils::CSerializable, so it can be saved with "stream << slam_object;" and restored with "stream >> slam_object;". Alternatively, the methods CHMTSLAM::saveState and CHMTSLAM::loadState can be invoked, which in turn call internally to the CSerializable interface.
Definition at line 59 of file CHMTSLAM.h.
#include <mrpt/hmtslam/CHMTSLAM.h>
Classes | |
struct | TMessageLSLAMfromAA |
Message definition: More... | |
struct | TMessageLSLAMfromTBI |
Message definition: More... | |
struct | TMessageLSLAMtoTBI |
Message definition: More... | |
struct | TOptions |
A variety of options and configuration params (private, use loadOptions). More... | |
Public Member Functions | |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *ptr) throw () |
void | operator delete[] (void *ptr) throw () |
void | operator delete (void *memory, void *ptr) throw () |
void * | operator new (size_t size, const std::nothrow_t &) throw () |
void | operator delete (void *ptr, const std::nothrow_t &) throw () |
CHMTSLAM () | |
Default constructor. More... | |
CHMTSLAM (const CHMTSLAM &) | |
const CHMTSLAM & | operator= (const CHMTSLAM &) |
virtual | ~CHMTSLAM () |
Destructor. More... | |
bool | abortedDueToErrors () |
Return true if an exception has been caught in any thread leading to the end of the mapping application: no more actions/observations will be processed from now on. More... | |
void | generateLogFiles (unsigned int nIteration) |
Called from LSLAM thread when log files must be created. More... | |
void | getAs3DScene (mrpt::opengl::COpenGLScene &outScene) |
Gets a 3D representation of the current state of the whole mapping framework. More... | |
virtual mxArray * | writeToMatlab () const |
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More... | |
mrpt::utils::CObjectPtr | duplicateGetSmartPtr () const |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More... | |
CObject * | clone () const |
Cloning interface for smart pointers. More... | |
High-level map management | |
void | loadOptions (const std::string &configFile) |
Loads the options from a config file. More... | |
void | loadOptions (const mrpt::utils::CConfigFileBase &cfgSource) |
Loads the options from a config source. More... | |
void | initializeEmptyMap () |
Initializes the whole HMT-SLAM framework, reseting to an empty map (It also clears the logs directory) - this must be called AFTER loading the options with CHMTSLAM::loadOptions. More... | |
bool | saveState (mrpt::utils::CStream &out) const |
Save the state of the whole HMT-SLAM framework to some binary stream (e.g. More... | |
bool | loadState (mrpt::utils::CStream &in) |
Load the state of the whole HMT-SLAM framework from some binary stream (e.g. More... | |
Static Public Member Functions | |
static void * | operator new (size_t size, void *ptr) |
Public Attributes | |
The important data. | |
CHierarchicalMHMap | m_map |
The hiearchical, multi-hypothesis graph-based map. More... | |
aligned_containers< THypothesisID, CLocalMetricHypothesis >::map_t | m_LMHs |
The list of LMHs at each instant. More... | |
Static Public Attributes | |
static const mrpt::utils::TRuntimeClassId | classCObject |
RTTI stuff | |
static const mrpt::utils::TRuntimeClassId | classCSerializable |
Protected Member Functions | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const |
Introduces a pure virtual method responsible for writing to a CStream. More... | |
void | readFromStream (mrpt::utils::CStream &in, int version) |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More... | |
HMT-SLAM sub-processes. | |
void | LSLAM_process_message (const mrpt::utils::CMessage &msg) |
Auxiliary method within thread_LSLAM. More... | |
void | LSLAM_process_message_from_AA (const TMessageLSLAMfromAA &myMsg) |
No critical section locks are assumed at the entrance of this method. More... | |
void | LSLAM_process_message_from_TBI (const TMessageLSLAMfromTBI &myMsg) |
No critical section locks are assumed at the entrance of this method. More... | |
void | perform_TLC (CLocalMetricHypothesis &LMH, const CHMHMapNode::TNodeID areaInLMH, const CHMHMapNode::TNodeID areaLoopClosure, const mrpt::poses::CPose3DPDFGaussian &pose1wrt2) |
Topological Loop Closure: Performs all the required operations to close a loop between two areas which have been determined to be the same. More... | |
Static Protected Member Functions | |
static TMessageLSLAMfromAAPtr | areaAbstraction (CLocalMetricHypothesis *LMH, const TPoseIDList &newPoseIDs) |
The Area Abstraction (AA) method, invoked from LSLAM. More... | |
static TMessageLSLAMfromTBIPtr | TBI_main_method (CLocalMetricHypothesis *LMH, const CHMHMapNode::TNodeID &areaID) |
The entry point for Topological Bayesian Inference (TBI) engines, invoked from LSLAM. More... | |
static std::string | generateUniqueAreaLabel () |
Generates a new and unique area textual label (currently this generates "0","1",...) More... | |
static TPoseID | generatePoseID () |
Generates a new and unique pose ID. More... | |
static THypothesisID | generateHypothesisID () |
Generates a new and unique hypothesis ID. More... | |
Protected Attributes | |
bool | m_terminateThreads |
Termination flag for signaling all threads to terminate. More... | |
bool | m_terminationFlag_LSLAM |
Threads termination flags: More... | |
bool | m_terminationFlag_TBI |
bool | m_terminationFlag_3D_viewer |
mrpt::hmtslam::CHMTSLAM::TOptions | m_options |
The different SLAM algorithms that can be invoked from the LSLAM thread. | |
CLSLAMAlgorithmBase * | m_LSLAM_method |
An instance of a local SLAM method, to be applied to each LMH - initialized by "initializeEmptyMap" or "loadState". More... | |
Static Protected Attributes | |
static int64_t | m_nextAreaLabel = 0 |
static TPoseID | m_nextPoseID = 0 |
static THypothesisID | m_nextHypID = COMMON_TOPOLOG_HYP + 1 |
Friends | |
class | CLocalMetricHypothesis |
class | CLSLAM_RBPF_2DLASER |
class | CTopLCDetector_GridMatching |
class | CTopLCDetector_FabMap |
RTTI stuff | |
typedef CHMTSLAMPtr | Ptr |
typedef CHMTSLAMPtr | ConstPtr |
static mrpt::utils::CLASSINIT | _init_CHMTSLAM |
static mrpt::utils::TRuntimeClassId | classCHMTSLAM |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. More... | |
static mrpt::utils::CObject * | CreateObject () |
static CHMTSLAMPtr | Create () |
Inter-thread communication queues: | |
typedef stlplus::smart_ptr< TMessageLSLAMfromAA > | TMessageLSLAMfromAAPtr |
typedef stlplus::smart_ptr< TMessageLSLAMtoTBI > | TMessageLSLAMtoTBIPtr |
typedef stlplus::smart_ptr< TMessageLSLAMfromTBI > | TMessageLSLAMfromTBIPtr |
utils::CMessageQueue | m_LSLAM_queue |
LSLAM thread input queue, messages of type CHMTSLAM::TMessageLSLAMfromAA. More... | |
Related to the input queue: | |
enum | TLSlamMethod { lsmRBPF_2DLASER = 1 } |
std::queue< mrpt::utils::CSerializablePtr > | m_inputQueue |
The queue of pending actions/observations supplied by the user waiting for being processed. More... | |
synch::CCriticalSection | m_inputQueue_cs |
Critical section for accessing m_inputQueue. More... | |
synch::CCriticalSection | m_map_cs |
Critical section for accessing m_map. More... | |
synch::CCriticalSection | m_LMHs_cs |
Critical section for accessing m_LMHs. More... | |
void | clearInputQueue () |
Empty the input queue. More... | |
bool | isInputQueueEmpty () |
Returns true if the input queue is empty (Note that the queue must not be empty to the user to enqueue more actions/observaitions) More... | |
size_t | inputQueueSize () |
Returns the number of objects waiting for processing in the input queue. More... | |
void | pushAction (const mrpt::obs::CActionCollectionPtr &acts) |
Here the user can enter an action into the system (will go to the SLAM process). More... | |
void | pushObservations (const mrpt::obs::CSensoryFramePtr &sf) |
Here the user can enter observations into the system (will go to the SLAM process). More... | |
void | pushObservation (const mrpt::obs::CObservationPtr &obs) |
Here the user can enter an observation into the system (will go to the SLAM process). More... | |
mrpt::utils::CSerializablePtr | getNextObjectFromInputQueue () |
Used from the LSLAM thread to retrieve the next object from the queue. More... | |
Threads stuff | |
mrpt::system::TThreadHandle | m_hThread_LSLAM |
Threads handles. More... | |
mrpt::system::TThreadHandle | m_hThread_TBI |
mrpt::system::TThreadHandle | m_hThread_3D_viewer |
void | thread_LSLAM () |
The function for the "Local SLAM" thread. More... | |
void | thread_TBI () |
The function for the "TBI" thread. More... | |
void | thread_3D_viewer () |
The function for the "3D viewer" thread. More... | |
The different Loop-Closure modules that are to be executed in the TBI thread. | |
typedef CTopLCDetectorBase *(* | TLopLCDetectorFactory) (CHMTSLAM *) |
std::map< std::string, TLopLCDetectorFactory > | m_registeredLCDetectors |
std::deque< CTopLCDetectorBase * > | m_topLCdets |
The list of LC modules in operation - initialized by "initializeEmptyMap" or "loadState". More... | |
synch::CCriticalSection | m_topLCdets_cs |
The critical section for accessing m_topLCdets. More... | |
void | registerLoopClosureDetector (const std::string &name, CTopLCDetectorBase *(*ptrCreateObject)(CHMTSLAM *)) |
Must be invoked before calling initializeEmptyMap, so LC objects can be created. More... | |
CTopLCDetectorBase * | loopClosureDetector_factory (const std::string &name) |
The class factory for topological loop closure detectors. More... | |
typedef CHMTSLAMPtr mrpt::hmtslam::CHMTSLAM::ConstPtr |
Definition at line 67 of file CHMTSLAM.h.
typedef CHMTSLAMPtr mrpt::hmtslam::CHMTSLAM::Ptr |
A typedef for the associated smart pointer
Definition at line 67 of file CHMTSLAM.h.
|
protected |
Definition at line 283 of file CHMTSLAM.h.
|
protected |
Definition at line 97 of file CHMTSLAM.h.
|
protected |
Definition at line 141 of file CHMTSLAM.h.
|
protected |
Definition at line 109 of file CHMTSLAM.h.
Enumerator | |
---|---|
lsmRBPF_2DLASER |
Definition at line 203 of file CHMTSLAM.h.
CHMTSLAM::CHMTSLAM | ( | ) |
Default constructor.
debug_out_stream | If debug output messages should be redirected to any other stream apart from std::cout |
Definition at line 58 of file CHMTSLAM_main.cpp.
References mrpt::hmtslam::CTopLCDetector_GridMatching::createNewInstance(), mrpt::hmtslam::CTopLCDetector_FabMap::createNewInstance(), mrpt::system::createThreadFromObjectMethod(), initializeEmptyMap(), m_hThread_3D_viewer, m_hThread_LSLAM, m_hThread_TBI, m_LSLAM_method, m_terminateThreads, m_terminationFlag_3D_viewer, m_terminationFlag_LSLAM, m_terminationFlag_TBI, registerLoopClosureDetector(), thread_3D_viewer(), thread_LSLAM(), and thread_TBI().
|
inline |
Definition at line 341 of file CHMTSLAM.h.
References THROW_EXCEPTION.
|
virtual |
Destructor.
Definition at line 95 of file CHMTSLAM_main.cpp.
References clearInputQueue(), mrpt::mrpt::format(), mrpt::system::joinThread(), mrpt::hmtslam::CHMTSLAM::TOptions::LOG_OUTPUT_DIR, m_hThread_3D_viewer, m_hThread_LSLAM, m_hThread_TBI, m_LSLAM_method, m_options, m_terminateThreads, m_topLCdets, m_topLCdets_cs, MRPT_LOG_DEBUG, and MRPT_LOG_WARN.
|
staticprotected |
bool CHMTSLAM::abortedDueToErrors | ( | ) |
Return true if an exception has been caught in any thread leading to the end of the mapping application: no more actions/observations will be processed from now on.
Definition at line 557 of file CHMTSLAM_main.cpp.
References m_terminationFlag_3D_viewer, m_terminationFlag_LSLAM, and m_terminationFlag_TBI.
|
staticprotected |
The Area Abstraction (AA) method, invoked from LSLAM.
LMH | (IN) The LMH which to this query applies. |
newPoseIDs | (IN) The new poseIDs to be added to the graph partitioner. |
Definition at line 34 of file CHMTSLAM_AA.cpp.
References mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), ASSERT_, mrpt::hmtslam::CLocalMetricHypothesis::getPoseParticles(), mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning::idx2pose, mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning::lock, mrpt::hmtslam::CLocalMetricHypothesis::m_ID, mrpt::hmtslam::CLocalMetricHypothesis::m_parent, mrpt::hmtslam::CLocalMetricHypothesis::m_robotPosesGraph, mrpt::hmtslam::CLocalMetricHypothesis::m_SFs, mrpt::slam::CIncrementalMapPartitioner::markAllNodesForReconsideration(), MRPT_END, MRPT_START, mrpt::slam::CIncrementalMapPartitioner::options, mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning::partitioner, and mrpt::slam::CIncrementalMapPartitioner::updatePartitions().
void CHMTSLAM::clearInputQueue | ( | ) |
Empty the input queue.
Definition at line 163 of file CHMTSLAM_main.cpp.
References m_inputQueue, and m_inputQueue_cs.
Referenced by ~CHMTSLAM().
|
inlineinherited |
|
static |
|
static |
|
virtual |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlineinherited |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).
Definition at line 140 of file CObject.h.
Referenced by mrpt::obs::CRawlog::addActions(), mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), and mrpt::obs::CRawlog::addObservations().
|
staticprotected |
Generates a new and unique hypothesis ID.
Definition at line 539 of file CHMTSLAM_main.cpp.
References m_nextHypID.
Referenced by initializeEmptyMap().
void CHMTSLAM::generateLogFiles | ( | unsigned int | nIteration | ) |
Called from LSLAM thread when log files must be created.
Definition at line 39 of file CHMTSLAM_LOG.cpp.
References ASSERT_, CFileGZOutputStream, mrpt::opengl::CSetOfObjects::Create(), mrpt::bayes::CProbabilityParticle< T >::d, mrpt::system::os::fclose(), mrpt::system::os::fopen(), mrpt::format(), mrpt::system::formatTimeInterval(), mrpt::system::os::fprintf(), mrpt::slam::CIncrementalMapPartitioner::getAdjacencyMatrix(), mrpt::hmtslam::CLocalMetricHypothesis::getAs3DScene(), mrpt::slam::CIncrementalMapPartitioner::getAs3DScene(), mrpt::system::getMemoryUsage(), mrpt::bayes::CParticleFilterData< T >::getMostLikelyParticle(), mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning::idx2pose, mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning::lock, mrpt::hmtslam::CLocalMetricHypothesis::m_ID, mrpt::hmtslam::CLocalMetricHypothesis::m_lock, mrpt::hmtslam::CLocalMetricHypothesis::m_log_w, mrpt::hmtslam::CLocalMetricHypothesis::m_neighbors, mrpt::hmtslam::CLocalMetricHypothesis::m_robotPosesGraph, MRPT_END, MRPT_LOG_INFO_STREAM, MRPT_START, mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning::partitioner, mrpt::utils::CImage::saveToFile(), mrpt::utils::CTicTac::Tic(), and mrpt::hmtslam::CLocalMetricHypothesis::updateAreaFromLMH().
|
staticprotected |
Generates a new and unique pose ID.
Definition at line 531 of file CHMTSLAM_main.cpp.
References m_nextPoseID.
Referenced by mrpt::hmtslam::CLSLAM_RBPF_2DLASER::processOneLMH().
|
staticprotected |
Generates a new and unique area textual label (currently this generates "0","1",...)
Definition at line 523 of file CHMTSLAM_main.cpp.
References mrpt::format(), and m_nextAreaLabel.
Referenced by initializeEmptyMap().
void CHMTSLAM::getAs3DScene | ( | mrpt::opengl::COpenGLScene & | outScene | ) |
Gets a 3D representation of the current state of the whole mapping framework.
Definition at line 548 of file CHMTSLAM_main.cpp.
References MRPT_UNUSED_PARAM.
|
protected |
Used from the LSLAM thread to retrieve the next object from the queue.
Definition at line 393 of file CHMTSLAM_main.cpp.
References m_inputQueue, and m_inputQueue_cs.
|
virtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::utils::CSerializable.
void CHMTSLAM::initializeEmptyMap | ( | ) |
Initializes the whole HMT-SLAM framework, reseting to an empty map (It also clears the logs directory) - this must be called AFTER loading the options with CHMTSLAM::loadOptions.
Definition at line 411 of file CHMTSLAM_main.cpp.
References mrpt::utils::CThreadSafeQueue< T >::clear(), mrpt::hmtslam::CHierarchicalMHMap::clear(), mrpt::hmtslam::CLocalMetricHypothesis::clearRobotPoses(), CLSLAM_RBPF_2DLASER, COMMON_TOPOLOG_HYP, mrpt::hmtslam::CHMHMapNode::Create(), mrpt::system::createDirectory(), mrpt::hmtslam::CHMTSLAM::TOptions::defaultMapsInitializers, mrpt::system::deleteFilesInDirectory(), generateHypothesisID(), generateUniqueAreaLabel(), mrpt::hmtslam::CHMTSLAM::TOptions::LOG_OUTPUT_DIR, loopClosureDetector_factory(), lsmRBPF_2DLASER, mrpt::hmtslam::CLocalMetricHypothesis::m_currentRobotPose, mrpt::hmtslam::CLocalMetricHypothesis::m_ID, m_LMHs, m_LMHs_cs, mrpt::hmtslam::CLocalMetricHypothesis::m_log_w, m_LSLAM_method, m_LSLAM_queue, m_map, m_map_cs, mrpt::hmtslam::CLocalMetricHypothesis::m_neighbors, m_options, mrpt::hmtslam::CLocalMetricHypothesis::m_parent, m_topLCdets, m_topLCdets_cs, NODE_ANNOTATION_METRIC_MAPS, NODE_ANNOTATION_REF_POSEID, POSEID_INVALID, mrpt::hmtslam::CHMTSLAM::TOptions::SLAM_METHOD, THROW_EXCEPTION_FMT, and mrpt::hmtslam::CHMTSLAM::TOptions::TLC_detectors.
Referenced by CHMTSLAM().
size_t CHMTSLAM::inputQueueSize | ( | ) |
Returns the number of objects waiting for processing in the input queue.
Definition at line 380 of file CHMTSLAM_main.cpp.
References m_inputQueue, and m_inputQueue_cs.
bool CHMTSLAM::isInputQueueEmpty | ( | ) |
Returns true if the input queue is empty (Note that the queue must not be empty to the user to enqueue more actions/observaitions)
Definition at line 366 of file CHMTSLAM_main.cpp.
References m_inputQueue, and m_inputQueue_cs.
void CHMTSLAM::loadOptions | ( | const std::string & | configFile | ) |
Loads the options from a config file.
Definition at line 260 of file CHMTSLAM_main.cpp.
References ASSERT_, and mrpt::system::fileExists().
void CHMTSLAM::loadOptions | ( | const mrpt::utils::CConfigFileBase & | cfgSource | ) |
Loads the options from a config source.
Definition at line 238 of file CHMTSLAM_main.cpp.
References mrpt::hmtslam::CHMTSLAM::TOptions::AA_options, mrpt::hmtslam::CHMTSLAM::TOptions::defaultMapsInitializers, mrpt::utils::CLoadableOptions::dumpToConsole(), mrpt::hmtslam::CHMTSLAM::TOptions::KLD_params, mrpt::slam::TKLDParams::loadFromConfigFile(), mrpt::slam::CIncrementalMapPartitioner::TOptions::loadFromConfigFile(), mrpt::hmtslam::CTopLCDetector_FabMap::TOptions::loadFromConfigFile(), mrpt::hmtslam::CTopLCDetector_GridMatching::TOptions::loadFromConfigFile(), mrpt::bayes::CParticleFilter::TParticleFilterOptions::loadFromConfigFile(), mrpt::maps::TSetOfMetricMapInitializers::loadFromConfigFile(), mrpt::hmtslam::CHMTSLAM::TOptions::loadFromConfigFile(), m_options, mrpt::hmtslam::CHMTSLAM::TOptions::pf_options, mrpt::hmtslam::CHMTSLAM::TOptions::TLC_fabmap_options, and mrpt::hmtslam::CHMTSLAM::TOptions::TLC_grid_options.
bool CHMTSLAM::loadState | ( | mrpt::utils::CStream & | in | ) |
Load the state of the whole HMT-SLAM framework from some binary stream (e.g.
a file).
Definition at line 609 of file CHMTSLAM_main.cpp.
CTopLCDetectorBase * CHMTSLAM::loopClosureDetector_factory | ( | const std::string & | name | ) |
The class factory for topological loop closure detectors.
Possible values are enumerated in TOptions::TLC_detectors
std::exception | On unknown name. |
Definition at line 578 of file CHMTSLAM_main.cpp.
References m_registeredLCDetectors, MRPT_END, MRPT_START, and THROW_EXCEPTION_FMT.
Referenced by initializeEmptyMap().
|
protected |
Auxiliary method within thread_LSLAM.
Definition at line 249 of file CHMTSLAM_LSLAM.cpp.
References MRPT_END, MRPT_START, and MRPT_UNUSED_PARAM.
|
protected |
No critical section locks are assumed at the entrance of this method.
Definition at line 278 of file CHMTSLAM_LSLAM.cpp.
References ARC_ANNOTATION_DELTA, ARC_ANNOTATION_DELTA_SRC_POSEID, ARC_ANNOTATION_DELTA_TRG_POSEID, AREAID_INVALID, ASSERT_, begin(), mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::poses::CPose3DPDFGaussian::cov, mrpt::opengl::CSetOfObjects::Create(), DEG2RAD, mrpt::poses::CPose3D::distanceEuclidean6D(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distanceTo(), mrpt::opengl::COpenGLScene::enableFollowCamera(), mrpt::utils::erase_return_next(), mrpt::utils::list_searchable< T >::find(), mrpt::format(), mrpt::poses::CPose3DPDFGaussian::getMean(), mrpt::hmtslam::CHMTSLAM::TMessageLSLAMfromAA::hypothesisID, mrpt::utils::list_searchable< T >::insert(), mrpt::opengl::COpenGLScene::insert(), mrpt::obs::CSensoryFrame::insert(), mrpt::obs::CSensoryFrame::insertObservationsInto(), mrpt::poses::CPose3DPDFGaussian::inverse(), mrpt::bayes::CParticleFilterData< T >::m_particles, mrpt::poses::CPose3DPDFGaussian::mean, MRPT_END, MRPT_LOG_DEBUG_STREAM, MRPT_START, NODE_ANNOTATION_METRIC_MAPS, NODE_ANNOTATION_POSES_GRAPH, NODE_ANNOTATION_REF_POSEID, mrpt::hmtslam::CHMTSLAM::TMessageLSLAMfromAA::partitions, mrpt::hmtslam::TPoseInfo::pdf, POSEID_INVALID, RAD2DEG, mrpt::hmtslam::TPoseInfo::sf, mrpt::math::square(), mrpt::utils::CTicTac::Tac(), THROW_EXCEPTION, THROW_EXCEPTION_FMT, mrpt::utils::CTicTac::Tic(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y(), and mrpt::poses::CPose3D::yaw().
|
protected |
No critical section locks are assumed at the entrance of this method.
Definition at line 1477 of file CHMTSLAM_LSLAM.cpp.
References ASSERT_, mrpt::math::chi2inv(), mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::poses::CPose3DPDFGaussian::cov, mrpt::hmtslam::CHMTSLAM::TMessageLSLAMfromTBI::cur_area, DEG2RAD, mrpt::hmtslam::CHMTSLAM::TMessageLSLAMfromTBI::hypothesisID, mrpt::hmtslam::CHMTSLAM::TMessageLSLAMfromTBI::loopClosureData, mrpt::poses::CPose3DPDFGaussian::mahalanobisDistanceTo(), mrpt::poses::CPose3DPDFGaussian::mean, MRPT_END, MRPT_START, mrpt::system::pause(), RAD2DEG, mrpt::math::square(), mrpt::utils::CTicTac::Tac(), and mrpt::utils::CTicTac::Tic().
Definition at line 67 of file CHMTSLAM.h.
Definition at line 67 of file CHMTSLAM.h.
|
inline |
Definition at line 67 of file CHMTSLAM.h.
Definition at line 67 of file CHMTSLAM.h.
|
inline |
Definition at line 67 of file CHMTSLAM.h.
Definition at line 67 of file CHMTSLAM.h.
|
inline |
Definition at line 67 of file CHMTSLAM.h.
|
inline |
Definition at line 67 of file CHMTSLAM.h.
Definition at line 342 of file CHMTSLAM.h.
References THROW_EXCEPTION.
|
protected |
Topological Loop Closure: Performs all the required operations to close a loop between two areas which have been determined to be the same.
Definition at line 36 of file CHMTSLAM_perform_TLC.cpp.
References ASSERT_, mrpt::poses::CPose3DPDFParticles::getMean(), mrpt::hmtslam::CLocalMetricHypothesis::getPoseParticles(), mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning::lock, mrpt::hmtslam::CLocalMetricHypothesis::m_ID, mrpt::hmtslam::CLocalMetricHypothesis::m_neighbors, mrpt::hmtslam::CLocalMetricHypothesis::m_nodeIDmemberships, mrpt::bayes::CParticleFilterData< T >::m_particles, mrpt::hmtslam::CLocalMetricHypothesis::m_posesPendingAddPartitioner, mrpt::hmtslam::CLocalMetricHypothesis::m_robotPosesGraph, mrpt::hmtslam::CLocalMetricHypothesis::m_SFs, mrpt::poses::CPose3DPDFGaussian::mean, MRPT_END, MRPT_START, NODE_ANNOTATION_POSES_GRAPH, NODE_ANNOTATION_REF_POSEID, mrpt::hmtslam::TPoseInfo::pdf, mrpt::hmtslam::CLocalMetricHypothesis::rebuildMetricMaps(), mrpt::hmtslam::TPoseInfo::sf, mrpt::poses::CPose3DPDFParticles::size(), and mrpt::hmtslam::CLocalMetricHypothesis::updateAreaFromLMH().
void CHMTSLAM::pushAction | ( | const mrpt::obs::CActionCollectionPtr & | acts | ) |
Here the user can enter an action into the system (will go to the SLAM process).
This class will delete the passed object when required, so DO NOT DELETE the passed object after calling this.
Definition at line 181 of file CHMTSLAM_main.cpp.
References m_inputQueue, m_inputQueue_cs, and m_terminateThreads.
void CHMTSLAM::pushObservation | ( | const mrpt::obs::CObservationPtr & | obs | ) |
Here the user can enter an observation into the system (will go to the SLAM process).
This class will delete the passed object when required, so DO NOT DELETE the passed object after calling this.
Definition at line 217 of file CHMTSLAM_main.cpp.
References m_inputQueue, m_inputQueue_cs, and m_terminateThreads.
void CHMTSLAM::pushObservations | ( | const mrpt::obs::CSensoryFramePtr & | sf | ) |
Here the user can enter observations into the system (will go to the SLAM process).
This class will delete the passed object when required, so DO NOT DELETE the passed object after calling this.
Definition at line 199 of file CHMTSLAM_main.cpp.
References m_inputQueue, m_inputQueue_cs, and m_terminateThreads.
|
protectedvirtual |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any error, see CStream::ReadBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 625 of file CHMTSLAM_main.cpp.
References m_LMHs, m_map, m_map_cs, m_nextAreaLabel, m_nextHypID, m_nextPoseID, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and version.
void CHMTSLAM::registerLoopClosureDetector | ( | const std::string & | name, |
CTopLCDetectorBase *(*)(CHMTSLAM *) | ptrCreateObject | ||
) |
Must be invoked before calling initializeEmptyMap, so LC objects can be created.
Definition at line 567 of file CHMTSLAM_main.cpp.
References m_registeredLCDetectors.
Referenced by CHMTSLAM().
bool CHMTSLAM::saveState | ( | mrpt::utils::CStream & | out | ) | const |
Save the state of the whole HMT-SLAM framework to some binary stream (e.g.
a file).
Definition at line 593 of file CHMTSLAM_main.cpp.
Referenced by mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel().
|
staticprotected |
The entry point for Topological Bayesian Inference (TBI) engines, invoked from LSLAM.
LMH | (IN) The LMH which to this query applies. |
areaID | (IN) The area ID to consider for potential loop-closures. |
Definition at line 104 of file CHMTSLAM_TBI.cpp.
References ASSERT_, mrpt::poses::CPose3DPDFSOG::clear(), mrpt::hmtslam::CHMTSLAM::TMessageLSLAMfromTBI::TBI_info::delta_new_cur, IS_CLASS, mrpt::hmtslam::CHMTSLAM::TMessageLSLAMfromTBI::TBI_info::log_lik, mrpt::hmtslam::CLocalMetricHypothesis::m_ID, mrpt::hmtslam::CLocalMetricHypothesis::m_neighbors, mrpt::hmtslam::CLocalMetricHypothesis::m_parent, MRPT_END, MRPT_START, and mrpt::hmtslam::CLocalMetricHypothesis::updateAreaFromLMH().
|
protected |
The function for the "3D viewer" thread.
Definition at line 28 of file CHMTSLAM_3D_viewer.cpp.
References mrpt::system::getCurrentThreadId(), mrpt::system::getCurrentThreadTimes(), and mrpt::system::sleep().
Referenced by CHMTSLAM().
|
protected |
The function for the "Local SLAM" thread.
Definition at line 44 of file CHMTSLAM_LSLAM.cpp.
References ASSERT_, CLASS_ID, mrpt::system::getCurrentThreadId(), mrpt::system::getCurrentThreadTimes(), mrpt::random::randomGenerator, mrpt::random::CRandomGenerator::randomize(), mrpt::system::sleep(), mrpt::utils::CTicTac::Tac(), THROW_EXCEPTION, and mrpt::utils::CTicTac::Tic().
Referenced by CHMTSLAM().
|
protected |
The function for the "TBI" thread.
Definition at line 32 of file CHMTSLAM_TBI.cpp.
References mrpt::system::getCurrentThreadId(), mrpt::system::getCurrentThreadTimes(), mrpt::random::randomGenerator, mrpt::random::CRandomGenerator::randomize(), and mrpt::system::sleep().
Referenced by CHMTSLAM().
|
inlinevirtualinherited |
Introduces a pure virtual method responsible for writing to a mxArray
Matlab object, typically a MATLAB struct
whose contents are documented in each derived class.
mxArray
(caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB. Definition at line 79 of file CSerializable.h.
|
protectedvirtual |
Introduces a pure virtual method responsible for writing to a CStream.
This can not be used directly be users, instead use "stream << object;" for writing it to a stream.
out | The output binary stream where object must be dumped. |
getVersion | If NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data. |
std::exception | On any error, see CStream::WriteBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 667 of file CHMTSLAM_main.cpp.
References m_LMHs, m_map, m_map_cs, m_nextAreaLabel, m_nextHypID, m_nextPoseID, and version.
|
friend |
Definition at line 61 of file CHMTSLAM.h.
|
friend |
Definition at line 62 of file CHMTSLAM.h.
Referenced by initializeEmptyMap().
|
friend |
Definition at line 64 of file CHMTSLAM.h.
|
friend |
Definition at line 63 of file CHMTSLAM.h.
|
staticprotected |
Definition at line 67 of file CHMTSLAM.h.
|
static |
Definition at line 67 of file CHMTSLAM.h.
|
staticinherited |
|
staticinherited |
Definition at line 42 of file CSerializable.h.
|
static |
Definition at line 67 of file CHMTSLAM.h.
|
protected |
Definition at line 240 of file CHMTSLAM.h.
Referenced by CHMTSLAM(), and ~CHMTSLAM().
|
protected |
Threads handles.
Definition at line 240 of file CHMTSLAM.h.
Referenced by CHMTSLAM(), and ~CHMTSLAM().
|
protected |
Definition at line 240 of file CHMTSLAM.h.
Referenced by CHMTSLAM(), and ~CHMTSLAM().
|
protected |
The queue of pending actions/observations supplied by the user waiting for being processed.
Definition at line 215 of file CHMTSLAM.h.
Referenced by clearInputQueue(), getNextObjectFromInputQueue(), inputQueueSize(), isInputQueueEmpty(), pushAction(), pushObservation(), and pushObservations().
|
protected |
Critical section for accessing m_inputQueue.
Definition at line 218 of file CHMTSLAM.h.
Referenced by clearInputQueue(), getNextObjectFromInputQueue(), inputQueueSize(), isInputQueueEmpty(), pushAction(), pushObservation(), and pushObservations().
aligned_containers<THypothesisID, CLocalMetricHypothesis>::map_t mrpt::hmtslam::CHMTSLAM::m_LMHs |
The list of LMHs at each instant.
Definition at line 380 of file CHMTSLAM.h.
Referenced by initializeEmptyMap(), readFromStream(), and writeToStream().
|
protected |
Critical section for accessing m_LMHs.
Definition at line 223 of file CHMTSLAM.h.
Referenced by initializeEmptyMap().
|
protected |
An instance of a local SLAM method, to be applied to each LMH - initialized by "initializeEmptyMap" or "loadState".
Definition at line 275 of file CHMTSLAM.h.
Referenced by CHMTSLAM(), initializeEmptyMap(), and ~CHMTSLAM().
|
protected |
LSLAM thread input queue, messages of type CHMTSLAM::TMessageLSLAMfromAA.
Definition at line 144 of file CHMTSLAM.h.
Referenced by initializeEmptyMap().
CHierarchicalMHMap mrpt::hmtslam::CHMTSLAM::m_map |
The hiearchical, multi-hypothesis graph-based map.
Definition at line 379 of file CHMTSLAM.h.
Referenced by initializeEmptyMap(), readFromStream(), and writeToStream().
|
protected |
Critical section for accessing m_map.
Definition at line 221 of file CHMTSLAM.h.
Referenced by initializeEmptyMap(), readFromStream(), and writeToStream().
|
staticprotected |
Definition at line 330 of file CHMTSLAM.h.
Referenced by generateUniqueAreaLabel(), readFromStream(), and writeToStream().
|
staticprotected |
Definition at line 332 of file CHMTSLAM.h.
Referenced by generateHypothesisID(), readFromStream(), and writeToStream().
|
staticprotected |
Definition at line 331 of file CHMTSLAM.h.
Referenced by generatePoseID(), readFromStream(), and writeToStream().
|
protected |
|
protected |
Definition at line 285 of file CHMTSLAM.h.
Referenced by loopClosureDetector_factory(), and registerLoopClosureDetector().
|
protected |
Termination flag for signaling all threads to terminate.
Definition at line 313 of file CHMTSLAM.h.
Referenced by CHMTSLAM(), pushAction(), pushObservation(), pushObservations(), and ~CHMTSLAM().
|
protected |
Definition at line 317 of file CHMTSLAM.h.
Referenced by abortedDueToErrors(), and CHMTSLAM().
|
protected |
Threads termination flags:
Definition at line 317 of file CHMTSLAM.h.
Referenced by abortedDueToErrors(), and CHMTSLAM().
|
protected |
Definition at line 317 of file CHMTSLAM.h.
Referenced by abortedDueToErrors(), and CHMTSLAM().
|
protected |
The list of LC modules in operation - initialized by "initializeEmptyMap" or "loadState".
Definition at line 288 of file CHMTSLAM.h.
Referenced by initializeEmptyMap(), and ~CHMTSLAM().
|
protected |
The critical section for accessing m_topLCdets.
Definition at line 291 of file CHMTSLAM.h.
Referenced by initializeEmptyMap(), and ~CHMTSLAM().
Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019 |