Class MolaLauncherApp

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

  • public mrpt::system::COutputLogger

Class Documentation

class MolaLauncherApp : public mrpt::system::COutputLogger

Main launcher for a MOLA system. See mola-cli for a ready-to-use program.

SLAM system setup

void setup(const mrpt::containers::yaml &cfg, const std::optional<std::string> &basePath = std::nullopt)

Prepares the SLAM system based on a YAML configuration file. See [mola]/demos/ for example YAML files. At this point, MOLA module libraries are searched in a list of paths and loaded for their classes to be available in name-based class factories. Modules must be named “libmola*” to be loaded.

void spin()

(Blocking call) Launch sensor and worker threads and enters into an infinite loop executing the SLAM system, until shutdown() is called (e.g. from another thread or a signal handler).

void shutdown()

Attempts to do a clean shutdown of the system, giving all threads an opportunity to end and save any pending data, etc.

See also

spin()

MOLA module listing, paths, finding, etc.

void addPathModuleLibs(const std::string &path)

Adds a directory to the list of paths to search for MOLA modules (.so/.dll) when setup() is called. The environment variable MOLA_MODULES_LIB_PATH (path1[:path2[:...]]) is automatically added at class construction.

Note

Default is CMAKE_LIBRARY_OUTPUT_DIRECTORY.

void addPathModuleSources(const std::string &path)

Adds a directory to the list of paths to search for MOLA module source and shared files. The environment variable MOLA_MODULES_SHARED_PATH (path1[:path2[:...]]) is automatically added at class construction.

Note

Default is ${MOLA_SOURCE_DIR}/modules/

inline std::vector<std::string> getModuleLibPaths() const

Returns a copy of the current list of paths in which this object will try to look for MOLA modules compiled binaries.

inline std::vector<std::string> getModuleSourcePaths() const

Returns a copy of the current list of paths in which this object will try to look for MOLA modules shared files.

std::vector<std::string> getLoadedModules()

Returns the current list of loaded module dynamic libraries.

std::string findModuleSharedDir(const std::string &moduleName) const

Returns the absolute path of the root directory where the given module shared files can be found. For BUILD_INTERFACE, this should be the root of each repository source. For INSTALL_INTERFACE, it should be <INSTALL_PREFIX>/share/<MODULE_NAME>/

Returns an empty string if module is not found.

See also

scanForModuleSharedDirectories() to search for all module paths.

Public Types

using module_name_t = std::string
using module_shared_path_t = std::string

Public Functions

MolaLauncherApp()
virtual ~MolaLauncherApp()
void scanAndLoadLibraries()

Scans and loads MOLA module libraries. This is automatically called within setup(), but it’s provided here in case a user want to only load modules for use the RTTI machinery on them without setting up a complete SLAM system.

std::map<module_name_t, module_shared_path_t> scanForModuleSharedDirectories() const

Scans the shared directories and returns a list with found modules and their shared directory.

Public Members

mrpt::system::CTimeLogger profiler_ = {true, "MolaLauncherApp"}

Time profiler. It’s enabled/disabled status will be inherited (by default, unless set otherwise in their YAML config files) by all modules created upon the call to setup()

std::optional<ProfilerSaverAtDtor> profiler_dtor_save_stats_

Enabled from mola-cli with --profiler-whole to save full profile stats to .m files at program end.

Parameters launcher_params_
struct Parameters

Public Members

bool enforce_initialize_one_at_a_time = {false}