mola-kernel: MOLA data types and interfaces
Overview
// typedefs typedef std::variant<std::monostate, RefPose3, RelPose3, RelPose3KF, RelDynPose3KF, LandmarkPoint3, EntityOther> mola::Entity; typedef std::variant<std::monostate, FactorRelativePose3, FactorConstVelKinematics, FactorStereoProjectionPose, SmartFactorStereoProjectionPose, SmartFactorIMU, FactorOther> mola::Factor; typedef std::uint64_t mola::id_t; typedef std::uint64_t mola::fid_t; typedef mola::fast_map<id_t, mola::fast_set<fid_t>> mola::entity_connected_factors_t; typedef ContainerDeque<Entity, WorldModelData::EntitiesContainer, EntityBase, EntityOther, id_t> mola::EntitiesContainerDeque; typedef ContainerFastMap<Entity, WorldModelData::EntitiesContainer, EntityBase, EntityOther, id_t, e_str> mola::EntitiesContainerFastMap; // classes class mola::WorldModel; class mola::WorldModelData; // global variables constexpr id_t mola::INVALID_ID = std::numeric_limits<id_t>::max(); constexpr fid_t mola::INVALID_FID = std::numeric_limits<fid_t>::max();
Typedefs
typedef std::variant<std::monostate, RefPose3, RelPose3, RelPose3KF, RelDynPose3KF, LandmarkPoint3, EntityOther> mola::Entity
Variant type for “entities” in the world model. It’s guaranteed that the type is either:
std::monostate
: Not initialized, orA class derived from
EntityBase
(stored by value), orEntityOther
, which is a wrapper aroundEntityBase::Ptr
(an object allocated in the heap).
In this way, Entity
can be handled as a polymorphic class, without the cost of dynamic memory allocation for the most-common classes, while still allowing using any user-derived class via dynamic memory.
typedef std::variant<std::monostate, FactorRelativePose3, FactorConstVelKinematics, FactorStereoProjectionPose, SmartFactorStereoProjectionPose, SmartFactorIMU, FactorOther> mola::Factor
Variant type for “factors” in the world model. It’s guaranteed that the type is either:
std::monostate
: Not initialized, orA class derived from
FactorBase
(stored by value), orFactorOther
, which is a wrapper aroundFactorBase::Ptr
(an object allocated in the heap).
In this way, Factor
can be handled as a polymorphic class, without the cost of dynamic memory allocation for the most-common classes, while still allowing using any user-derived class via dynamic memory.
typedef std::uint64_t mola::id_t
Unique ID for each Entity in a WorldModel.
typedef std::uint64_t mola::fid_t
Unique ID for each Factor in a WorldModel.
typedef ContainerDeque<Entity, WorldModelData::EntitiesContainer, EntityBase, EntityOther, id_t> mola::EntitiesContainerDeque
Implementation of EntitiesContainer using a std::deque. Avoids pool allocation for each entry, but poorly supports discontinuous ID numbers.
typedef ContainerFastMap<Entity, WorldModelData::EntitiesContainer, EntityBase, EntityOther, id_t, e_str> mola::EntitiesContainerFastMap
Implementation of EntitiesContainer using a std::map<> with mola::FastAllocator.
Global Variables
constexpr id_t mola::INVALID_ID = std::numeric_limits<id_t>::max()
A numeric value for invalid IDs.
constexpr fid_t mola::INVALID_FID = std::numeric_limits<fid_t>::max()
A numeric value for invalid IDs.