class mola::KeyframeMapCapable
Overview
Mixin interface for keyframe-based metric maps that need to expose per-KF pose plumbing to higher layers (e.g. LiDAR odometry online gravity tilt correction).
A “keyframe map” is a metric map whose internal representation is a finite, dynamic set of SE(3)-posed sub-clouds (keyframes), each identified by a stable monotonic KeyFrameID.
All methods are required to be thread-safe with respect to the implementing class’ own internal state.
#include <KeyframeMapCapable.h> class KeyframeMapCapable { public: // typedefs typedef uint64_t KeyFrameID; // construction KeyframeMapCapable(); KeyframeMapCapable(const KeyframeMapCapable&); KeyframeMapCapable(KeyframeMapCapable&&); // methods KeyframeMapCapable& operator = (const KeyframeMapCapable&); KeyframeMapCapable& operator = (KeyframeMapCapable&&); virtual std::map<KeyFrameID, mrpt::poses::CPose3D> keyframePoses() const = 0; virtual std::optional<KeyFrameID> oldestActiveKeyframeID() const = 0; virtual void setKeyframePose(KeyFrameID id, const mrpt::poses::CPose3D& new_pose) = 0; virtual void applyPivotTransform(KeyFrameID pivot_id, const mrpt::poses::CPose3D& delta_at_pivot) = 0; }; // direct descendants class KeyframePointCloudMap;
Methods
virtual std::map<KeyFrameID, mrpt::poses::CPose3D> keyframePoses() const = 0
Returns a snapshot of all currently-active keyframe poses, keyed by KF id. The returned map is a deep copy and is safe to hold across subsequent map mutations.
virtual std::optional<KeyFrameID> oldestActiveKeyframeID() const = 0
Returns the smallest currently-active KF id, or nullopt if the map is empty. Used as the natural pivot for online tilt correction (oldest active KF stays put).
virtual void setKeyframePose(KeyFrameID id, const mrpt::poses::CPose3D& new_pose) = 0
Overwrites the pose of one keyframe. No-op if id is not present. Any internal caches dependent on KF poses must be invalidated by the implementation.
virtual void applyPivotTransform( KeyFrameID pivot_id, const mrpt::poses::CPose3D& delta_at_pivot ) = 0
Applies a pivot-based rigid SE(3) transform to all currently-active KFs.
Implementations are encouraged to delegate to their existing transform_map_left_multiply() after computing: T_correct = T_pivot + delta_at_pivot + (-T_pivot) No-op if pivot_id is not present in the active set.