51 int64_t CHMTSLAM::m_nextAreaLabel = 0;
52 TPoseID CHMTSLAM::m_nextPoseID = 0;
59 : m_inputQueue_cs(
"inputQueue_cs"),
103 MRPT_LOG_DEBUG(
"[CHMTSLAM::destructor] Waiting for threads end...\n");
127 catch(std::exception &e)
226 CSensoryFramePtr sf = CSensoryFrame::Create();
319 stds_Q_no_odo[2] =
RAD2DEG(stds_Q_no_odo[2]);
320 source.read_vector(section,
"stds_Q_no_odo", stds_Q_no_odo, stds_Q_no_odo );
321 ASSERT_(stds_Q_no_odo.size()==3)
323 stds_Q_no_odo[2] =
DEG2RAD(stds_Q_no_odo[2]);
325 std::string sTLC_detectors =
source.read_string(section,
"TLC_detectors",
"",
true );
329 std::cout <<
"TLC_detectors: " << TLC_detectors.size() << std::endl;
332 AA_options.loadFromConfigFile(
source,section);
340 out.
printf(
"\n----------- [CHMTSLAM::TOptions] ------------ \n\n");
355 AA_options.dumpToTextStream(out);
356 pf_options.dumpToTextStream(out);
357 KLD_params.dumpToTextStream(out);
358 defaultMapsInitializers.dumpToTextStream(out);
359 TLC_grid_options.dumpToTextStream(out);
360 TLC_fabmap_options.dumpToTextStream(out);
395 CSerializablePtr
obj;
417 LMH_hyps.insert( newHypothID );
432 firstAreaID = firstArea->getID();
434 firstArea->m_hypotheses = LMH_hyps;
437 firstArea->m_nodeType.setType(
"Area" );
456 newLMH.
m_ID = newHypothID;
584 return it->second(
this);
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...
float MIN_ODOMETRY_STD_PHI
[LSLAM] Minimum uncertainty (1 sigma, rads) in phi for odometry increments (Default=0) ...
int random_seed
0 means randomize, use any other value to have repetitive experiments.
float MIN_ODOMETRY_STD_XY
[LSLAM] Minimum uncertainty (1 sigma, meters) in x and y for odometry increments (Default=0) ...
CLSLAMAlgorithmBase * m_LSLAM_method
An instance of a local SLAM method, to be applied to each LMH - initialized by "initializeEmptyMap" o...
A class acquiring a CCriticalSection at its constructor, and releasing it at destructor.
synch::CCriticalSection m_map_cs
Critical section for accessing m_map.
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.
THypothesisID m_ID
The unique ID of the hypothesis (Used for accessing mrpt::slam::CHierarchicalMHMap).
void thread_LSLAM()
The function for the "Local SLAM" thread.
#define LOADABLEOPTS_DUMP_VAR_DEG(variableName)
Macro for dumping a variable to a stream, transforming the argument from radians to degrees...
int LOG_FREQUENCY
[LOGGING] One SLAM iteration out of "LOGGING_logFrequency", a log file will be generated.
#define COMMON_TOPOLOG_HYP
CTopLCDetector_FabMap::TOptions TLC_fabmap_options
Options passed to this TLC constructor.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
static TPoseID generatePoseID()
Generates a new and unique pose ID.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
This class allows loading and storing values and vectors of different types from ".ini" files easily.
mrpt::system::TThreadHandle m_hThread_TBI
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
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.
static TPoseID m_nextPoseID
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.
bool m_terminationFlag_3D_viewer
bool BASE_IMPEXP fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
vector_string TLC_detectors
A list of topological loop-closure detectors to use: can be one or more from this list: 'gridmaps': O...
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.
double m_log_w
Log-weight of this hypothesis.
void pushObservations(const mrpt::obs::CSensoryFramePtr &sf)
Here the user can enter observations into the system (will go to the SLAM process).
const Scalar * const_iterator
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.
aligned_containers< THypothesisID, CLocalMetricHypothesis >::map_t m_LMHs
The list of LMHs at each instant.
static THypothesisID m_nextHypID
bool m_terminateThreads
Termination flag for signaling all threads to terminate.
static CTopLCDetectorBase * createNewInstance(CHMTSLAM *hmtslam)
A class factory, to be implemented in derived classes.
utils::CMessageQueue m_LSLAM_queue
LSLAM thread input queue, messages of type CHMTSLAM::TMessageLSLAMfromAA.
GLsizei GLsizei GLuint * obj
static int64_t m_nextAreaLabel
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...
std::queue< mrpt::utils::CSerializablePtr > m_inputQueue
The queue of pending actions/observations supplied by the user waiting for being processed.
bool m_terminationFlag_TBI
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
mrpt::slam::TKLDParams KLD_params
void clear()
Erase all the contents of map (It delete all nodes/arcs objects)
bool m_terminationFlag_LSLAM
Threads termination flags:
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps. ...
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.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ionName) MRPT_OVERRIDE
Loads the configuration for the set of internal maps from a textual definition in an INI-like file...
#define MRPT_LOG_WARN(_STRING)
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.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
mrpt::maps::TSetOfMetricMapInitializers defaultMapsInitializers
The default set of maps to be created in each particle.
mrpt::maps::CMultiMetricMapPtr CMultiMetricMapPtr
Backward compatible typedef.
mrpt::utils::CSerializablePtr getNextObjectFromInputQueue()
Used from the LSLAM thread to retrieve the next object from the queue.
std::deque< CTopLCDetectorBase * > m_topLCdets
The list of LC modules in operation - initialized by "initializeEmptyMap" or "loadState".
mrpt::utils::safe_ptr< CHMTSLAM > m_parent
For quick access to our parent object.
This namespace contains representation of robot actions and observations.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
class HMTSLAM_IMPEXP CHMTSLAM
CHierarchicalMHMap m_map
The hiearchical, multi-hypothesis graph-based map.
mrpt::hmtslam::CHMTSLAM::TOptions m_options
#define MRPT_LOG_DEBUG(_STRING)
This namespace provides multitask, synchronization utilities.
void pushAction(const mrpt::obs::CActionCollectionPtr &acts)
Here the user can enter an action into the system (will go to the SLAM process).
void thread_TBI()
The function for the "TBI" thread.
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
This class is used in HMT-SLAM to represent each of the Local Metric Hypotheses (LMHs).
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
#define NODE_ANNOTATION_METRIC_MAPS
GLsizei const GLchar ** string
void getAs3DScene(mrpt::opengl::COpenGLScene &outScene)
Gets a 3D representation of the current state of the whole mapping framework.
TLSlamMethod SLAM_METHOD
[LSLAM] The method to use for local SLAM
virtual ~CHMTSLAM()
Destructor.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
void BASE_IMPEXP joinThread(TThreadHandle &threadHandle)
Waits until the given thread ends.
bayes::CParticleFilter::TParticleFilterOptions pf_options
These params are used from every LMH object.
size_t inputQueueSize()
Returns the number of objects waiting for processing in the input queue.
bool saveState(mrpt::utils::CStream &out) const
Save the state of the whole HMT-SLAM framework to some binary stream (e.g.
TThreadHandle createThreadFromObjectMethod(CLASS *obj, void(CLASS::*func)(PARAM), PARAM param)
Creates a new thread running a non-static method (so it will have access to "this") from another meth...
mrpt::math::CVectorFloat stds_Q_no_odo
A 3-length vector with the std.
TOptions()
Initialization of default params.
void loadOptions(const std::string &configFile)
Loads the options from a config file.
#define MRPT_LOAD_CONFIG_VAR(variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
mrpt::maps::CMultiMetricMap CMultiMetricMap
Backward compatible typedef.
void clear()
Clear the queue of messages, freeing memory as required.
mrpt::system::TThreadHandle m_hThread_LSLAM
Threads handles.
static CTopLCDetectorBase * createNewInstance(CHMTSLAM *hmtslam)
A class factory, to be implemented in derived classes.
mrpt::slam::CIncrementalMapPartitioner::TOptions AA_options
[AA] The options for the partitioning algorithm
float VIEW3D_AREA_SPHERES_HEIGHT
[VIEW3D] The height of the areas' spheres.
#define MRPT_LOAD_CONFIG_VAR_DEGREES(variableName, configFileObject, sectionNameStr)
Loads a double variable, stored as radians but entered in the INI-file as degrees.
std::map< std::string, TLopLCDetectorFactory > m_registeredLCDetectors
void clearInputQueue()
Empty the input queue.
void registerLoopClosureDetector(const std::string &name, CTopLCDetectorBase *(*ptrCreateObject)(CHMTSLAM *))
Must be invoked before calling initializeEmptyMap, so LC objects can be created.
static CHMHMapNodePtr Create()
void pushObservation(const mrpt::obs::CObservationPtr &obs)
Here the user can enter an observation into the system (will go to the SLAM process).
float VIEW3D_AREA_SPHERES_RADIUS
[VIEW3D] The radius of the areas' spheres.
bool loadState(mrpt::utils::CStream &in)
Load the state of the whole HMT-SLAM framework from some binary stream (e.g.
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.
The namespace for 3D scene representation and rendering.
void clearRobotPoses()
Rebuild the auxiliary metric maps in "m_robotPosesGraph" from the observations "m_SFs" and their esti...
GLuint const GLchar * name
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives...
GLsizei GLsizei GLchar * source
#define NODE_ANNOTATION_REF_POSEID
void dumpToConsole() const
Just like dumpToTextStream() but sending the text to the console (std::cout)
static std::string generateUniqueAreaLabel()
Generates a new and unique area textual label (currently this generates "0","1",...)
bool BASE_IMPEXP deleteFilesInDirectory(const std::string &s, bool deleteDirectoryAsWell=false)
Delete all the files in a given directory (nothing done if directory does not exists, or path is a file).
synch::CCriticalSection m_topLCdets_cs
The critical section for accessing m_topLCdets.
#define MRPT_LOAD_CONFIG_VAR_CAST_NO_DEFAULT(variableName, variableType, variableTypeCast, configFileObject, sectionNameStr)
void thread_3D_viewer()
The function for the "3D viewer" thread.
synch::CCriticalSection m_LMHs_cs
Critical section for accessing m_LMHs.
float SLAM_MIN_DIST_BETWEEN_OBS
[LSLAM] Minimum distance (and heading) difference between observations inserted in the map...
float SLAM_MIN_HEADING_BETWEEN_OBS
CTopLCDetectorBase * loopClosureDetector_factory(const std::string &name)
The class factory for topological loop closure detectors.
void BASE_IMPEXP tokenize(const std::string &inString, const std::string &inDelimiters, std::deque< std::string > &outTokens, bool skipBlankTokens=true) MRPT_NO_THROWS
Tokenizes a string according to a set of delimiting characters.
bool isInputQueueEmpty()
Returns true if the input queue is empty (Note that the queue must not be empty to the user to enqueu...
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.
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.
TNodeIDSet m_neighbors
The list of all areas sourronding the current one (this includes the current area itself)...
mrpt::system::TThreadHandle m_hThread_3D_viewer
static THypothesisID generateHypothesisID()
Generates a new and unique hypothesis ID.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
synch::CCriticalSection m_inputQueue_cs
Critical section for accessing m_inputQueue.
mrpt::utils::TNodeID TNodeID
The type of the IDs of nodes.
TPoseID m_currentRobotPose
The current robot pose (its global unique ID) for this hypothesis.
void initializeEmptyMap()
Initializes the whole HMT-SLAM framework, reseting to an empty map (It also clears the logs directory...
bool abortedDueToErrors()
Return true if an exception has been caught in any thread leading to the end of the mapping applicati...
friend class CLSLAM_RBPF_2DLASER