Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Classes | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
mrpt::hmtslam::CHMTSLAM Class Reference

Detailed Description

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.

See also
CHierarchicalMHMap

Definition at line 65 of file CHMTSLAM.h.

#include <mrpt/hmtslam/CHMTSLAM.h>

Inheritance diagram for mrpt::hmtslam::CHMTSLAM:
Inheritance graph

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

voidoperator new (size_t size)
 
voidoperator new[] (size_t size)
 
void operator delete (void *ptr) noexcept
 
void operator delete[] (void *ptr) noexcept
 
void operator delete (void *memory, void *ptr) noexcept
 
voidoperator new (size_t size, const std::nothrow_t &) noexcept
 
void operator delete (void *ptr, const std::nothrow_t &) noexcept
 
 CHMTSLAM ()
 Default constructor. More...
 
 CHMTSLAM (const CHMTSLAM &)
 
const CHMTSLAMoperator= (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 mxArraywriteToMatlab () 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...
 
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...
 
RTTI classes and functions
mrpt::utils::CObject::Ptr 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...
 

Static Public Member Functions

static voidoperator 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...
 

Protected Member Functions

CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const override
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
void readFromStream (mrpt::utils::CStream &in, int version) override
 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 TMessageLSLAMfromAA::Ptr areaAbstraction (CLocalMetricHypothesis *LMH, const TPoseIDList &newPoseIDs)
 The Area Abstraction (AA) method, invoked from LSLAM. More...
 
static TMessageLSLAMfromTBI::Ptr 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
 
Inter-thread communication queues:
utils::CMessageQueue m_LSLAM_queue
 LSLAM thread input queue, messages of type CHMTSLAM::TMessageLSLAMfromAA. More...
 
The different SLAM algorithms that can be invoked from the LSLAM

thread.

CLSLAMAlgorithmBasem_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

using Ptr = std::shared_ptr< CHMTSLAM >
 
using ConstPtr = std::shared_ptr< const CHMTSLAM >
 
static mrpt::utils::CLASSINIT _init_CHMTSLAM
 
static const mrpt::utils::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "CHMTSLAM"
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
static const mrpt::utils::TRuntimeClassIdGetRuntimeClassIdStatic ()
 
static mrpt::utils::CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&... args)
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const override
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectclone () const override
 Returns a deep copy (clone) of the object, indepently of its class. More...
 

Related to the input queue:

enum  TLSlamMethod { lsmRBPF_2DLASER = 1 }
 
std::queue< mrpt::utils::CSerializable::Ptrm_inputQueue
 The queue of pending actions/observations supplied by the user waiting for being processed. More...
 
std::mutex m_inputQueue_cs
 Critical section for accessing m_inputQueue. More...
 
std::mutex m_map_cs
 Critical section for accessing m_map. More...
 
std::mutex 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::CActionCollection::Ptr &acts)
 Here the user can enter an action into the system (will go to the SLAM process). More...
 
void pushObservations (const mrpt::obs::CSensoryFrame::Ptr &sf)
 Here the user can enter observations into the system (will go to the SLAM process). More...
 
void pushObservation (const mrpt::obs::CObservation::Ptr &obs)
 Here the user can enter an observation into the system (will go to the SLAM process). More...
 
mrpt::utils::CSerializable::Ptr getNextObjectFromInputQueue ()
 Used from the LSLAM thread to retrieve the next object from the queue. More...
 

Threads stuff

std::thread m_hThread_LSLAM
 Threads handles. More...
 
std::thread m_hThread_TBI
 
std::thread 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, TLopLCDetectorFactorym_registeredLCDetectors
 
std::deque< CTopLCDetectorBase * > m_topLCdets
 The list of LC modules in operation - initialized by "initializeEmptyMap" or "loadState". More...
 
std::mutex 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...
 
CTopLCDetectorBaseloopClosureDetector_factory (const std::string &name)
 The class factory for topological loop closure detectors. More...
 

Member Typedef Documentation

◆ ConstPtr

using mrpt::hmtslam::CHMTSLAM::ConstPtr = std::shared_ptr<const CHMTSLAM >

Definition at line 73 of file CHMTSLAM.h.

◆ Ptr

using mrpt::hmtslam::CHMTSLAM::Ptr = std::shared_ptr< CHMTSLAM >

A typedef for the associated smart pointer

Definition at line 73 of file CHMTSLAM.h.

◆ TLopLCDetectorFactory

typedef CTopLCDetectorBase*(* mrpt::hmtslam::CHMTSLAM::TLopLCDetectorFactory) (CHMTSLAM *)
protected

Definition at line 304 of file CHMTSLAM.h.

Member Enumeration Documentation

◆ TLSlamMethod

Enumerator
lsmRBPF_2DLASER 

Definition at line 224 of file CHMTSLAM.h.

Constructor & Destructor Documentation

◆ CHMTSLAM() [1/2]

CHMTSLAM::CHMTSLAM ( )

Default constructor.

Parameters
debug_out_streamIf debug output messages should be redirected to any other stream apart from std::cout

Definition at line 55 of file CHMTSLAM_main.cpp.

◆ CHMTSLAM() [2/2]

mrpt::hmtslam::CHMTSLAM::CHMTSLAM ( const CHMTSLAM )
inline

Definition at line 360 of file CHMTSLAM.h.

References THROW_EXCEPTION.

◆ ~CHMTSLAM()

CHMTSLAM::~CHMTSLAM ( )
virtual

Destructor.

Definition at line 86 of file CHMTSLAM_main.cpp.

References mrpt::mrpt::format(), MRPT_LOG_DEBUG, and MRPT_LOG_WARN.

Here is the call graph for this function:

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId* mrpt::hmtslam::CHMTSLAM::_GetBaseClass ( )
staticprotected

◆ abortedDueToErrors()

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 547 of file CHMTSLAM_main.cpp.

◆ areaAbstraction()

CHMTSLAM::TMessageLSLAMfromAA::Ptr CHMTSLAM::areaAbstraction ( CLocalMetricHypothesis LMH,
const TPoseIDList newPoseIDs 
)
staticprotected

◆ clearInputQueue()

void CHMTSLAM::clearInputQueue ( )

Empty the input queue.

Definition at line 156 of file CHMTSLAM_main.cpp.

◆ clone()

virtual mrpt::utils::CObject* mrpt::hmtslam::CHMTSLAM::clone ( ) const
overridevirtual

Returns a deep copy (clone) of the object, indepently of its class.

Implements mrpt::utils::CObject.

◆ Create()

template<typename... Args>
static Ptr mrpt::hmtslam::CHMTSLAM::Create ( Args &&...  args)
inlinestatic

Definition at line 73 of file CHMTSLAM.h.

◆ CreateObject()

static mrpt::utils::CObject* mrpt::hmtslam::CHMTSLAM::CreateObject ( )
static

◆ generateHypothesisID()

THypothesisID CHMTSLAM::generateHypothesisID ( )
staticprotected

Generates a new and unique hypothesis ID.

Definition at line 535 of file CHMTSLAM_main.cpp.

◆ generateLogFiles()

void CHMTSLAM::generateLogFiles ( unsigned int  nIteration)

◆ generatePoseID()

TPoseID CHMTSLAM::generatePoseID ( )
staticprotected

Generates a new and unique pose ID.

Definition at line 531 of file CHMTSLAM_main.cpp.

Referenced by mrpt::hmtslam::CLSLAM_RBPF_2DLASER::processOneLMH().

Here is the caller graph for this function:

◆ generateUniqueAreaLabel()

std::string CHMTSLAM::generateUniqueAreaLabel ( )
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().

Here is the call graph for this function:

◆ getAs3DScene()

void CHMTSLAM::getAs3DScene ( mrpt::opengl::COpenGLScene outScene)

Gets a 3D representation of the current state of the whole mapping framework.

Definition at line 539 of file CHMTSLAM_main.cpp.

References MRPT_UNUSED_PARAM.

◆ getNextObjectFromInputQueue()

CSerializable::Ptr CHMTSLAM::getNextObjectFromInputQueue ( )
protected

Used from the LSLAM thread to retrieve the next object from the queue.

Returns
The object, or nullptr if empty.

Definition at line 386 of file CHMTSLAM_main.cpp.

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId* mrpt::hmtslam::CHMTSLAM::GetRuntimeClass ( ) const
overridevirtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

◆ GetRuntimeClassIdStatic()

static const mrpt::utils::TRuntimeClassId& mrpt::hmtslam::CHMTSLAM::GetRuntimeClassIdStatic ( )
static

◆ initializeEmptyMap()

void CHMTSLAM::initializeEmptyMap ( )

◆ inputQueueSize()

size_t CHMTSLAM::inputQueueSize ( )

Returns the number of objects waiting for processing in the input queue.

See also
pushAction,pushObservations, isInputQueueEmpty

Definition at line 373 of file CHMTSLAM_main.cpp.

◆ isInputQueueEmpty()

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)

See also
pushAction,pushObservations, inputQueueSize

Definition at line 359 of file CHMTSLAM_main.cpp.

◆ loadOptions() [1/2]

void CHMTSLAM::loadOptions ( const std::string configFile)

Loads the options from a config file.

Definition at line 253 of file CHMTSLAM_main.cpp.

References ASSERT_, and mrpt::system::fileExists().

Here is the call graph for this function:

◆ loadOptions() [2/2]

void CHMTSLAM::loadOptions ( const mrpt::utils::CConfigFileBase cfgSource)

Loads the options from a config source.

Definition at line 231 of file CHMTSLAM_main.cpp.

◆ loadState()

bool CHMTSLAM::loadState ( mrpt::utils::CStream in)

Load the state of the whole HMT-SLAM framework from some binary stream (e.g.

a file).

Returns
true if everything goes OK.
See also
saveState

Definition at line 597 of file CHMTSLAM_main.cpp.

◆ loopClosureDetector_factory()

CTopLCDetectorBase * CHMTSLAM::loopClosureDetector_factory ( const std::string name)

The class factory for topological loop closure detectors.

Possible values are enumerated in TOptions::TLC_detectors

Exceptions
std::exceptionOn unknown name.

Definition at line 565 of file CHMTSLAM_main.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION_FMT.

◆ LSLAM_process_message()

void CHMTSLAM::LSLAM_process_message ( const mrpt::utils::CMessage msg)
protected

Auxiliary method within thread_LSLAM.

Definition at line 288 of file CHMTSLAM_LSLAM.cpp.

References MRPT_END, MRPT_START, and MRPT_UNUSED_PARAM.

◆ LSLAM_process_message_from_AA()

void CHMTSLAM::LSLAM_process_message_from_AA ( const TMessageLSLAMfromAA myMsg)
protected

No critical section locks are assumed at the entrance of this method.

Definition at line 318 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, 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(), for(), 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().

Here is the call graph for this function:

◆ LSLAM_process_message_from_TBI()

void CHMTSLAM::LSLAM_process_message_from_TBI ( const TMessageLSLAMfromTBI myMsg)
protected

◆ operator delete() [1/3]

void mrpt::hmtslam::CHMTSLAM::operator delete ( void ptr)
inlinenoexcept

Definition at line 73 of file CHMTSLAM.h.

◆ operator delete() [2/3]

void mrpt::hmtslam::CHMTSLAM::operator delete ( void memory,
void ptr 
)
inlinenoexcept

Definition at line 73 of file CHMTSLAM.h.

◆ operator delete() [3/3]

void mrpt::hmtslam::CHMTSLAM::operator delete ( void ptr,
const std::nothrow_t &   
)
inlinenoexcept

Definition at line 73 of file CHMTSLAM.h.

◆ operator delete[]()

void mrpt::hmtslam::CHMTSLAM::operator delete[] ( void ptr)
inlinenoexcept

Definition at line 73 of file CHMTSLAM.h.

◆ operator new() [1/3]

void* mrpt::hmtslam::CHMTSLAM::operator new ( size_t  size)
inline

Definition at line 73 of file CHMTSLAM.h.

◆ operator new() [2/3]

static void* mrpt::hmtslam::CHMTSLAM::operator new ( size_t  size,
void ptr 
)
inlinestatic

Definition at line 73 of file CHMTSLAM.h.

◆ operator new() [3/3]

void* mrpt::hmtslam::CHMTSLAM::operator new ( size_t  size,
const std::nothrow_t &   
)
inlinenoexcept

Definition at line 73 of file CHMTSLAM.h.

◆ operator new[]()

void* mrpt::hmtslam::CHMTSLAM::operator new[] ( size_t  size)
inline

Definition at line 73 of file CHMTSLAM.h.

◆ operator=()

const CHMTSLAM& mrpt::hmtslam::CHMTSLAM::operator= ( const CHMTSLAM )
inline

Definition at line 364 of file CHMTSLAM.h.

References THROW_EXCEPTION.

◆ perform_TLC()

void CHMTSLAM::perform_TLC ( CLocalMetricHypothesis LMH,
const CHMHMapNode::TNodeID  areaInLMH,
const CHMHMapNode::TNodeID  areaLoopClosure,
const mrpt::poses::CPose3DPDFGaussian pose1wrt2 
)
protected

◆ pushAction()

void CHMTSLAM::pushAction ( const mrpt::obs::CActionCollection::Ptr 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.

See also
pushObservations,pushObservation

Definition at line 173 of file CHMTSLAM_main.cpp.

◆ pushObservation()

void CHMTSLAM::pushObservation ( const mrpt::obs::CObservation::Ptr 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.

See also
pushAction,pushObservation

Definition at line 209 of file CHMTSLAM_main.cpp.

◆ pushObservations()

void CHMTSLAM::pushObservations ( const mrpt::obs::CSensoryFrame::Ptr 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.

See also
pushAction,pushObservation

Definition at line 191 of file CHMTSLAM_main.cpp.

◆ readFromStream()

void CHMTSLAM::readFromStream ( mrpt::utils::CStream in,
int  version 
)
overrideprotectedvirtual

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.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Definition at line 613 of file CHMTSLAM_main.cpp.

References MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

◆ registerLoopClosureDetector()

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 556 of file CHMTSLAM_main.cpp.

◆ saveState()

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).

Returns
true if everything goes OK.
See also
loadState

Definition at line 581 of file CHMTSLAM_main.cpp.

Referenced by mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel().

Here is the caller graph for this function:

◆ TBI_main_method()

CHMTSLAM::TMessageLSLAMfromTBI::Ptr CHMTSLAM::TBI_main_method ( CLocalMetricHypothesis LMH,
const CHMHMapNode::TNodeID areaID 
)
staticprotected

The entry point for Topological Bayesian Inference (TBI) engines, invoked from LSLAM.

Parameters
LMH(IN) The LMH which to this query applies.
areaID(IN) The area ID to consider for potential loop-closures.
Note
The critical section for LMH must be locked BEFORE calling this method (it does NOT lock any critical section).

Definition at line 109 of file CHMTSLAM_TBI.cpp.

References mrpt::poses::CPose3DPDFSOG::appendFrom(), 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().

Here is the call graph for this function:

◆ thread_3D_viewer()

void CHMTSLAM::thread_3D_viewer ( )
protected

The function for the "3D viewer" thread.

Definition at line 31 of file CHMTSLAM_3D_viewer.cpp.

References MRPT_TODO.

◆ thread_LSLAM()

void CHMTSLAM::thread_LSLAM ( )
protected

The function for the "Local SLAM" thread.

Definition at line 43 of file CHMTSLAM_LSLAM.cpp.

References ASSERT_, CLASS_ID, mrpt::random::getRandomGenerator(), MRPT_TODO, mrpt::random::CRandomGenerator::randomize(), mrpt::utils::CTicTac::Tac(), THROW_EXCEPTION, and mrpt::utils::CTicTac::Tic().

Here is the call graph for this function:

◆ thread_TBI()

void CHMTSLAM::thread_TBI ( )
protected

The function for the "TBI" thread.

Definition at line 32 of file CHMTSLAM_TBI.cpp.

References mrpt::random::getRandomGenerator(), MRPT_TODO, and mrpt::random::CRandomGenerator::randomize().

Here is the call graph for this function:

◆ writeToMatlab()

virtual mxArray* mrpt::utils::CSerializable::writeToMatlab ( ) const
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.

Returns
A new mxArray (caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB.

Definition at line 89 of file CSerializable.h.

◆ writeToStream()

void CHMTSLAM::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
overrideprotectedvirtual

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.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf nullptr, 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.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Definition at line 656 of file CHMTSLAM_main.cpp.

Friends And Related Function Documentation

◆ CLocalMetricHypothesis

friend class CLocalMetricHypothesis
friend

Definition at line 68 of file CHMTSLAM.h.

◆ CLSLAM_RBPF_2DLASER

friend class CLSLAM_RBPF_2DLASER
friend

Definition at line 69 of file CHMTSLAM.h.

◆ CTopLCDetector_FabMap

friend class CTopLCDetector_FabMap
friend

Definition at line 71 of file CHMTSLAM.h.

◆ CTopLCDetector_GridMatching

friend class CTopLCDetector_GridMatching
friend

Definition at line 70 of file CHMTSLAM.h.

Member Data Documentation

◆ _init_CHMTSLAM

mrpt::utils::CLASSINIT mrpt::hmtslam::CHMTSLAM::_init_CHMTSLAM
staticprotected

Definition at line 73 of file CHMTSLAM.h.

◆ className

constexpr const char* mrpt::hmtslam::CHMTSLAM::className = "CHMTSLAM"
static

Definition at line 73 of file CHMTSLAM.h.

◆ m_hThread_3D_viewer

std::thread mrpt::hmtslam::CHMTSLAM::m_hThread_3D_viewer
protected

Definition at line 262 of file CHMTSLAM.h.

◆ m_hThread_LSLAM

std::thread mrpt::hmtslam::CHMTSLAM::m_hThread_LSLAM
protected

Threads handles.

Definition at line 262 of file CHMTSLAM.h.

◆ m_hThread_TBI

std::thread mrpt::hmtslam::CHMTSLAM::m_hThread_TBI
protected

Definition at line 262 of file CHMTSLAM.h.

◆ m_inputQueue

std::queue<mrpt::utils::CSerializable::Ptr> mrpt::hmtslam::CHMTSLAM::m_inputQueue
protected

The queue of pending actions/observations supplied by the user waiting for being processed.

Definition at line 237 of file CHMTSLAM.h.

◆ m_inputQueue_cs

std::mutex mrpt::hmtslam::CHMTSLAM::m_inputQueue_cs
mutableprotected

Critical section for accessing m_inputQueue.

Definition at line 240 of file CHMTSLAM.h.

◆ m_LMHs

aligned_containers<THypothesisID, CLocalMetricHypothesis>::map_t mrpt::hmtslam::CHMTSLAM::m_LMHs

The list of LMHs at each instant.

Definition at line 412 of file CHMTSLAM.h.

◆ m_LMHs_cs

std::mutex mrpt::hmtslam::CHMTSLAM::m_LMHs_cs
mutableprotected

Critical section for accessing m_LMHs.

Definition at line 246 of file CHMTSLAM.h.

◆ m_LSLAM_method

CLSLAMAlgorithmBase* mrpt::hmtslam::CHMTSLAM::m_LSLAM_method
protected

An instance of a local SLAM method, to be applied to each LMH - initialized by "initializeEmptyMap" or "loadState".

Definition at line 296 of file CHMTSLAM.h.

◆ m_LSLAM_queue

utils::CMessageQueue mrpt::hmtslam::CHMTSLAM::m_LSLAM_queue
protected

LSLAM thread input queue, messages of type CHMTSLAM::TMessageLSLAMfromAA.

Definition at line 158 of file CHMTSLAM.h.

◆ m_map

CHierarchicalMHMap mrpt::hmtslam::CHMTSLAM::m_map

The hiearchical, multi-hypothesis graph-based map.

Definition at line 410 of file CHMTSLAM.h.

◆ m_map_cs

std::mutex mrpt::hmtslam::CHMTSLAM::m_map_cs
mutableprotected

Critical section for accessing m_map.

Definition at line 243 of file CHMTSLAM.h.

◆ m_nextAreaLabel

int64_t CHMTSLAM::m_nextAreaLabel = 0
staticprotected

Definition at line 349 of file CHMTSLAM.h.

◆ m_nextHypID

THypothesisID CHMTSLAM::m_nextHypID = COMMON_TOPOLOG_HYP + 1
staticprotected

Definition at line 351 of file CHMTSLAM.h.

◆ m_nextPoseID

TPoseID CHMTSLAM::m_nextPoseID = 0
staticprotected

Definition at line 350 of file CHMTSLAM.h.

◆ m_options

mrpt::hmtslam::CHMTSLAM::TOptions mrpt::hmtslam::CHMTSLAM::m_options
protected

◆ m_registeredLCDetectors

std::map<std::string, TLopLCDetectorFactory> mrpt::hmtslam::CHMTSLAM::m_registeredLCDetectors
protected

Definition at line 306 of file CHMTSLAM.h.

◆ m_terminateThreads

bool mrpt::hmtslam::CHMTSLAM::m_terminateThreads
protected

Termination flag for signaling all threads to terminate.

Definition at line 332 of file CHMTSLAM.h.

◆ m_terminationFlag_3D_viewer

bool mrpt::hmtslam::CHMTSLAM::m_terminationFlag_3D_viewer
protected

Definition at line 336 of file CHMTSLAM.h.

◆ m_terminationFlag_LSLAM

bool mrpt::hmtslam::CHMTSLAM::m_terminationFlag_LSLAM
protected

Threads termination flags:

Definition at line 336 of file CHMTSLAM.h.

◆ m_terminationFlag_TBI

bool mrpt::hmtslam::CHMTSLAM::m_terminationFlag_TBI
protected

Definition at line 336 of file CHMTSLAM.h.

◆ m_topLCdets

std::deque<CTopLCDetectorBase*> mrpt::hmtslam::CHMTSLAM::m_topLCdets
protected

The list of LC modules in operation - initialized by "initializeEmptyMap" or "loadState".

Definition at line 310 of file CHMTSLAM.h.

◆ m_topLCdets_cs

std::mutex mrpt::hmtslam::CHMTSLAM::m_topLCdets_cs
protected

The critical section for accessing m_topLCdets.

Definition at line 313 of file CHMTSLAM.h.

◆ runtimeClassId

const mrpt::utils::TRuntimeClassId mrpt::hmtslam::CHMTSLAM::runtimeClassId
staticprotected

Definition at line 73 of file CHMTSLAM.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019