Go to the documentation of this file.
38 class CLSLAMAlgorithmBase;
39 class CLSLAM_RBPF_2DLASER;
100 using Ptr = std::shared_ptr<TMessageLSLAMfromAA>;
116 using Ptr = std::shared_ptr<TMessageLSLAMtoTBI>;
130 using Ptr = std::shared_ptr<TMessageLSLAMfromTBI>;
444 std::ostream& out)
const override;
643 const void* action,
const void* observation);
void prediction_and_update_pfOptimalProposal(CLocalMetricHypothesis *LMH, const mrpt::obs::CActionCollection *action, const mrpt::obs::CSensoryFrame *observation, const bayes::CParticleFilter::TParticleFilterOptions &PF_options)
The PF algorithm implementation.
Declares a class that represents a Probability Density function (PDF) of a 3D(6D) pose .
std::shared_ptr< CObservation > Ptr
Options for a TLC-detector of type gridmap-matching, used from CHMTSLAM.
mrpt::maps::TSetOfMetricMapInitializers defaultMapsInitializers
The default set of maps to be created in each particle.
Configuration parameters.
This class is used in HMT-SLAM to represent each of the Local Metric Hypotheses (LMHs).
static THypothesisID generateHypothesisID()
Generates a new and unique hypothesis ID.
Implements a 2D local SLAM method based on a RBPF over an occupancy grid map.
CLSLAMAlgorithmBase * m_LSLAM_method
An instance of a local SLAM method, to be applied to each LMH - initialized by "initializeEmptyMap" o...
float MIN_ODOMETRY_STD_XY
[LSLAM] Minimum uncertainty (1 sigma, meters) in x and y for odometry increments (Default=0)
Declares a class that represents a Probability Density function (PDF) of a 3D pose .
mrpt::slam::CIncrementalMapPartitioner::TOptions AA_options
[AA] The options for the partitioning algorithm
TNodeIDList areaIDs
The areas to consider.
void thread_TBI()
The function for the "TBI" thread.
void LSLAM_process_message_from_TBI(const TMessageLSLAMfromTBI &myMsg)
No critical section locks are assumed at the entrance of this method.
std::shared_ptr< CSerializable > Ptr
std::shared_ptr< CSensoryFrame > Ptr
void registerLoopClosureDetector(const std::string &name, CTopLCDetectorBase *(*ptrCreateObject)(CHMTSLAM *))
Must be invoked before calling initializeEmptyMap, so LC objects can be created.
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
CHMHMapNode::TNodeID cur_area
The area for who the loop-closure has been computed.
bool abortedDueToErrors()
Return true if an exception has been caught in any thread leading to the end of the mapping applicati...
static TMessageLSLAMfromTBI::Ptr TBI_main_method(CLocalMetricHypothesis *LMH, const CHMHMapNode::TNodeID &areaID)
The entry point for Topological Bayesian Inference (TBI) engines, invoked from LSLAM.
void prediction_and_update_pfAuxiliaryPFOptimal(CLocalMetricHypothesis *LMH, const mrpt::obs::CActionCollection *action, const mrpt::obs::CSensoryFrame *observation, const bayes::CParticleFilter::TParticleFilterOptions &PF_options)
The PF algorithm implementation.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
static TPoseID generatePoseID()
Generates a new and unique pose ID.
std::deque< CTopLCDetectorBase * > m_topLCdets
The list of LC modules in operation - initialized by "initializeEmptyMap" or "loadState".
int findTPathBinIntoSet(TPathBin &desiredBin, std::deque< TPathBin > &theSet)
Checks if a given "TPathBin" element is already into a set of them, and return its index (first one i...
std::thread m_hThread_TBI
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives.
int random_seed
0 means randomize, use any other value to have repetitive experiments.
Option set for KLD algorithm.
virtual void processOneLMH(CLocalMetricHypothesis *LMH, const mrpt::obs::CActionCollection::Ptr &act, const mrpt::obs::CSensoryFrame::Ptr &sf)=0
Main entry point from HMT-SLAM: process some actions & observations.
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
mrpt::math::CVectorFloat stds_Q_no_odo
A 3-length vector with the std.
GLsizei GLsizei GLuint * obj
void thread_LSLAM()
The function for the "Local SLAM" thread.
void generateLogFiles(unsigned int nIteration)
Called from LSLAM thread when log files must be created.
std::map< KEY, VALUE, std::less< KEY >, mrpt::aligned_allocator_cpp11< std::pair< const KEY, VALUE > >> aligned_std_map
static std::string generateUniqueAreaLabel()
Generates a new and unique area textual label (currently this generates "0","1",.....
virtual void prediction_and_update_pfAuxiliaryPFOptimal(CLocalMetricHypothesis *LMH, const mrpt::obs::CActionCollection *action, const mrpt::obs::CSensoryFrame *observation, const bayes::CParticleFilter::TParticleFilterOptions &PF_options)=0
The PF algorithm implementation.
Declares a class for storing a collection of robot actions.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::shared_ptr< TMessageLSLAMfromTBI > Ptr
mrpt::serialization::CSerializable::Ptr getNextObjectFromInputQueue()
Used from the LSLAM thread to retrieve the next object from the queue.
std::mutex m_topLCdets_cs
The critical section for accessing m_topLCdets.
static TPoseID m_nextPoseID
void pushAction(const mrpt::obs::CActionCollection::Ptr &acts)
Here the user can enter an action into the system (will go to the SLAM process).
#define THROW_EXCEPTION(msg)
static int64_t m_nextAreaLabel
void dumpToStdOut() const
For debugging purposes!
std::map< CHMHMapNode::TNodeID, TBI_info > loopClosureData
The meat is here: only feasible loop closures from "cur_area" are included here, with associated data...
bool loadState(mrpt::serialization::CArchive &in)
Load the state of the whole HMT-SLAM framework from some binary stream (e.g.
std::string LOG_OUTPUT_DIR
[LOGGING] If it is not an empty string (""), a directory with that name will be created and log files...
Virtual base class for "archives": classes abstracting I/O streams.
void processOneLMH(CLocalMetricHypothesis *LMH, const mrpt::obs::CActionCollection::Ptr &act, const mrpt::obs::CSensoryFrame::Ptr &sf)
Main entry point from HMT-SLAM: process some actions & observations.
GLuint const GLchar * name
GLsizei GLsizei GLchar * source
CHierarchicalMHMap m_map
The hiearchical, multi-hypothesis graph-based map.
A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap...
mrpt::slam::TKLDParams KLD_params
static double auxiliarComputeObservationLikelihood(const mrpt::bayes::CParticleFilter::TParticleFilterOptions &PF_options, const mrpt::bayes::CParticleFilterCapable *obj, size_t particleIndexForMap, const mrpt::obs::CSensoryFrame *observation, const mrpt::poses::CPose2D *x)
Auxiliary function that evaluates the likelihood of an observation, given a robot pose,...
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
A class that contain generic messages, that can be sent and received from a "CClientTCPSocket" object...
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 whic...
mrpt::poses::CPose3DPDFSOG delta_new_cur
Depending on the loop-closure engine, an guess of the relative pose of "area_new" relative to "cur_ar...
void getAs3DScene(mrpt::opengl::COpenGLScene &outScene)
Gets a 3D representation of the current state of the whole mapping framework.
void loadOptions(const std::string &configFile)
Loads the options from a config file.
std::vector< std::string > TLC_detectors
A list of topological loop-closure detectors to use: can be one or more from this list: 'gridmaps': O...
CTopLCDetectorBase * loopClosureDetector_factory(const std::string &name)
The class factory for topological loop closure detectors.
bool isInputQueueEmpty()
Returns true if the input queue is empty (Note that the queue must not be empty to the user to enqueu...
void dumpToConsole() const
for debugging only
std::vector< TPoseIDList > partitions
This virtual class defines the interface that any particles based PDF class must implement in order t...
virtual void prediction_and_update_pfOptimalProposal(CLocalMetricHypothesis *LMH, const mrpt::obs::CActionCollection *action, const mrpt::obs::CSensoryFrame *observation, const bayes::CParticleFilter::TParticleFilterOptions &PF_options)=0
The PF algorithm implementation.
CTopLCDetector_FabMap::TOptions TLC_fabmap_options
Options passed to this TLC constructor.
void LSLAM_process_message(const mrpt::serialization::CMessage &msg)
Auxiliary method within thread_LSLAM.
mrpt::aligned_std_map< TPoseID, mrpt::poses::CPose3D > TMapPoseID2Pose3D
float MIN_ODOMETRY_STD_PHI
[LSLAM] Minimum uncertainty (1 sigma, rads) in phi for odometry increments (Default=0)
This class allows loading and storing values and vectors of different types from a configuration text...
std::mutex m_map_cs
Critical section for accessing m_map.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
void pushObservations(const mrpt::obs::CSensoryFrame::Ptr &sf)
Here the user can enter observations into the system (will go to the SLAM process).
mrpt::graphs::TNodeID TNodeID
The type of the IDs of nodes.
void initializeEmptyMap()
Initializes the whole HMT-SLAM framework, reseting to an empty map (It also clears the logs directory...
int LOG_FREQUENCY
[LOGGING] One SLAM iteration out of "LOGGING_logFrequency", a log file will be generated.
static TMessageLSLAMfromAA::Ptr areaAbstraction(CLocalMetricHypothesis *LMH, const TPoseIDList &newPoseIDs)
The Area Abstraction (AA) method, invoked from LSLAM.
mrpt::safe_ptr< CHMTSLAM > m_parent
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
The virtual base class which provides a unified interface for all persistent objects in MRPT.
TOptions()
Initialization of default params.
std::mutex m_LMHs_cs
Critical section for accessing m_LMHs.
Virtual base for local SLAM methods, used in mrpt::slam::CHMTSLAM.
void clearInputQueue()
Empty the input queue.
Options for a TLC-detector of type FabMap, used from CHMTSLAM.
std::shared_ptr< TMessageLSLAMfromAA > Ptr
bool saveState(mrpt::serialization::CArchive &out) const
Save the state of the whole HMT-SLAM framework to some binary stream (e.g.
float SLAM_MIN_DIST_BETWEEN_OBS
[LSLAM] Minimum distance (and heading) difference between observations inserted in the map.
std::map< std::string, TLopLCDetectorFactory > m_registeredLCDetectors
mrpt::hmtslam::CHMTSLAM::TOptions m_options
Versatile class for consistent logging and management of output messages.
bayes::CParticleFilter::TParticleFilterOptions pf_options
These params are used from every LMH object.
float VIEW3D_AREA_SPHERES_RADIUS
[VIEW3D] The radius of the areas' spheres.
void pushObservation(const mrpt::obs::CObservation::Ptr &obs)
Here the user can enter an observation into the system (will go to the SLAM process).
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.
CMessageQueue m_LSLAM_queue
virtual ~CLSLAMAlgorithmBase()
Destructor.
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
THypothesisID hypothesisID
The hypothesis ID (LMH) for these results.
virtual ~CHMTSLAM()
Destructor.
virtual ~CLSLAM_RBPF_2DLASER()
Destructor.
CLSLAMAlgorithmBase(CHMTSLAM *parent)
Constructor.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
CHMTSLAM()
Default constructor.
static THypothesisID m_nextHypID
bool m_terminationFlag_3D_viewer
std::mutex m_inputQueue_cs
Critical section for accessing m_inputQueue.
TLSlamMethod SLAM_METHOD
[LSLAM] The method to use for local SLAM
double log_lik
Log likelihood for this loop-closure.
bool m_terminationFlag_TBI
void LSLAM_process_message_from_AA(const TMessageLSLAMfromAA &myMsg)
No critical section locks are assumed at the entrance of this method.
std::thread m_hThread_LSLAM
Threads handles.
std::shared_ptr< TMessageLSLAMtoTBI > Ptr
A variety of options and configuration params (private, use loadOptions).
CTopLCDetectorBase *(*)(CHMTSLAM *) TLopLCDetectorFactory
CLSLAM_RBPF_2DLASER(CHMTSLAM *parent)
Constructor.
CHMTSLAM(const CHMTSLAM &)
THypothesisID hypothesisID
The hypothesis ID (LMH) for these results.
GLsizei const GLchar ** string
CLocalMetricHypothesis * LMH
The LMH.
size_t inputQueueSize()
Returns the number of objects waiting for processing in the input queue.
float SLAM_MIN_HEADING_BETWEEN_OBS
mrpt::aligned_std_map< THypothesisID, CLocalMetricHypothesis > m_LMHs
The list of LMHs at each instant.
std::vector< TPoseID > TPoseIDList
bool m_terminateThreads
Termination flag for signaling all threads to terminate.
void thread_3D_viewer()
The function for the "3D viewer" thread.
std::shared_ptr< CActionCollection > Ptr
The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model.
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
The configuration of a particle filter.
bool m_insertNewRobotPose
For use within PF callback methods.
A wrapper class for pointers that can be safely copied with "=" operator without problems.
void loadTPathBinFromPath(TPathBin &outBin, TMapPoseID2Pose3D *path=nullptr, mrpt::poses::CPose2D *newPose=nullptr)
Fills out a "TPathBin" variable, given a path hypotesis and (if not set to nullptr) a new pose append...
float VIEW3D_AREA_SPHERES_HEIGHT
[VIEW3D] The height of the areas' spheres.
COutputLogger()
Default class constructor.
std::thread m_hThread_3D_viewer
std::queue< mrpt::serialization::CSerializable::Ptr > m_inputQueue
The queue of pending actions/observations supplied by the user waiting for being processed.
static double particlesEvaluator_AuxPFOptimal(const mrpt::bayes::CParticleFilter::TParticleFilterOptions &PF_options, const mrpt::bayes::CParticleFilterCapable *obj, size_t index, const void *action, const void *observation)
Auxiliary function used in "prediction_and_update_pfAuxiliaryPFOptimal".
const CHMTSLAM & operator=(const CHMTSLAM &)
bool m_terminationFlag_LSLAM
Threads termination flags:
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |