Class WorldModel

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class WorldModel : public mola::ExecutableBase

The main class for a “map” or “world model”.

Note

This class cannot be factored out into its independent module due to its tight connection to “mola-kernel/interfaces”.

Map load/save API

void map_load_from(mrpt::serialization::CArchive &in)

Loads the map from a given source.

Throws:

std::runtime_error – in case of any I/O error.

void map_load_from(const std::string &fileName)

overload

void map_save_to(mrpt::serialization::CArchive &out) const

Saves the map to the given data sink.

Throws:

std::runtime_error – in case of any I/O error.

void map_save_to(const std::string &fileName) const
inline std::string map_base_directory() const

Returns the directory where entities will be swapped-off to disk when unloaded, i.e. the map database directory. This directory is built at construction from MOLA_MAP_STORAGE_DIR and the map name, which by default is the current date and time.

Main map content API

inline void entities_lock_for_read()
inline void entities_unlock_for_read()
inline void entities_lock_for_write()
inline void entities_unlock_for_write()
inline void factors_lock_for_read()
inline void factors_unlock_for_read()
inline void factors_lock_for_write()
inline void factors_unlock_for_write()
const Entity &entity_by_id(const id_t id) const
Entity &entity_by_id(const id_t id)
const Factor &factor_by_id(const fid_t id) const
Factor &factor_by_id(const fid_t id)
id_t entity_emplace_back(Entity &&e)
fid_t factor_emplace_back(Factor &&f)
id_t entity_push_back(const Entity &e)
fid_t factor_push_back(const Factor &f)
std::vector<id_t> entity_all_ids() const
std::vector<fid_t> factor_all_ids() const
annotations_data_t &entity_annotations_by_id(const id_t id)
const annotations_data_t &entity_annotations_by_id(const id_t id) const
std::set<id_t> entity_neighbors(const id_t id) const

Returns all entities that are connected to a given one by any common factor.

Public Functions

WorldModel()
virtual void initialize(const Yaml&) final override

This must be implemented to read all the required parameters

virtual void spinOnce() override

Runs any required action on a timely manner

inline virtual int launchOrderPriority() const override

The WorldModel is launched first, before most other modules.

Public Members

Parameters params_
struct Parameters

Public Members

double age_to_unload_keyframes = {15.0}

[s]