Template Class FramesBuffer
Defined in File localization.hpp
Class Documentation
-
template<typename TransformationType>
class FramesBuffer Maintains temporal localization buffer and keyframe-promotion logic.
Stores recent frames and keyframe references, gathers world data from nearby keyframes, and decides when to create and submit new keyframes.
Public Types
-
using FramesBufferTyped = FramesBuffer<TransformationType>
Typed alias for the FramesBuffer class template.
-
using CovisibilityTyped = covisibility_graph::CovisibilityGraph<TransformationType>
Auxiliary typedefs for covisibility graph point definition.
-
using CovisibilityPointer = CovisibilityTyped::shared_ptr
Shared pointer alias for the covisibility graph.
-
using unique_ptr = std::unique_ptr<FramesBufferTyped>
Unique pointer alias for FramesBuffer.
Public Functions
Construct a new FramesBuffer object.
-
~FramesBuffer() = default
Destroys the FramesBuffer object.
-
inline bool frame_buffer_full() const
Check whether temporal frame buffer reached configured capacity.
- Returns:
truewhen buffer size is at or above configured limit.
-
void query_3d_points(const pose_t &priorPose_)
Query map data near the provided prior pose into internal buffer.
- Parameters:
priorPose_ – Prior camera pose used to query local map neighborhood.
-
inline bool is_empty() const
Check whether queried world-data buffer is empty.
- Returns:
trueif no world data is available, otherwisefalse.
-
inline const WorldData &get_world_data() const
Getter for world data in the buffer (3d points, descriptors, observations, point IDs).
- Returns:
Const reference to buffered WorldData.
Insert a frame and optionally create a new keyframe.
- Parameters:
frame_ – Current frame instance.
state_ – Current localization state.
forceKeyframeCreation_ – Force keyframe creation for this frame.
- Returns:
truewhen a new keyframe was created, otherwisefalse.
-
void reset_buffer()
Resets the buffer. Cleans all frames and other data.
-
inline keyframe_id_t::ordered get_keyframes_in_buffer() const
Getter for the IDs of all the keyframes in the VO buffer.
- Returns:
Ordered set of keyframe IDs currently in the buffer.
-
inline bool check_tracking_state()
Checks if the localization is lost using the buffer.
- Returns:
trueif tracking still has support in the buffer.
Public Static Functions
Allocates a new object of type FramesBuffer.
- Parameters:
- Returns:
Unique pointer to created FramesBuffer object.
Private Functions
Adds a new frame to the buffer. The buffer will own the frame.
- Parameters:
frame_ – Frame to append to the temporal buffer.
Decide whether a new keyframe should be created.
- Parameters:
frame_ – Output frame chosen for keyframe creation when decision is positive.
force_ – Force keyframe creation if
true.
- Returns:
trueif keyframe should be created, otherwisefalse.
Create and submit a keyframe from the selected frame.
- Parameters:
frame_ – Frame to upgrade to a keyframe.
- Returns:
trueif keyframe creation succeeded, otherwisefalse.
-
void __add_to_observable_keyframes(const frame_id_t frameToAddId_)
Add frame reference-keyframe contribution to observable counts.
- Parameters:
frameToAddId_ – Frame ID whose reference keyframe will be counted.
-
void __remove_from_observable_keyframes(const frame_id_t frameToEraseId_)
Remove frame reference-keyframe contribution from observable counts.
- Parameters:
frameToEraseId_ – Frame ID whose reference contribution will be removed.
Estimate scale correction for frame 3D points after keyframe creation.
- Parameters:
frame_ – Current frame.
newKeyframeId_ – ID of keyframe created from current frame.
Ensure frame has usable depth map data.
- Parameters:
frame_ – Frame to validate or augment with depth.
Private Members
-
map::Map::shared_ptr _map
Pointer to the SLAM map object.
-
dictionary_t<frame_id_t, Frame::shared_ptr> _framesInBuffer
Local visual odometry frames.
-
keyframe_id_t::ordered _keyframesInBuffer
Ordered set with IDs of the keyframes in the VO buffer.
-
dictionary_t<keyframe_id_t, int> _observableKeyframes
Map with the counting of the number of times each keyframe in the buffer is a reference keyframe to the frames in the buffer.
-
CovisibilityPointer _covisibilityGraph
Covisibility graph object.
-
mutable std::shared_mutex _mutex
Mutex for the buffer data.
-
using FramesBufferTyped = FramesBuffer<TransformationType>