SaDVIO
localmap.h
Go to the documentation of this file.
1 #ifndef LOCALMAP_H
2 #define LOCALMAP_H
3 
5 
6 namespace isae {
7 
13 class LocalMap : public AMap {
14  public:
15  LocalMap() = default;
16  LocalMap(size_t min_kf_number, size_t max_kf_number, size_t fixedFrameNumber);
17 
24  void addFrame(std::shared_ptr<Frame> &frame) override;
25 
32  void removeFrame(std::shared_ptr<Frame> &frame);
33 
34  size_t getWindowSize() { return _max_kf_number; }
36  std::vector<Eigen::Affine3d> &getOldFramesPoses() { return _removed_frame_poses; }
37 
44  bool computeRelativePose(std::shared_ptr<Frame> &frame1,
45  std::shared_ptr<Frame> &frame2,
46  Eigen::Affine3d &T_f1_f2,
47  Eigen::MatrixXd &cov);
48 
50 
57  void discardLastFrame();
58 
65  void reset();
66 
67  protected:
74  void removeEmptyLandmarks();
75 
76  size_t _min_kf_number = 1;
77  size_t _max_kf_number = 7;
78  size_t _fixed_frames_number = 1;
79  bool _margin_flag;
80  std::vector<Eigen::Affine3d> _removed_frame_poses;
81 
82  mutable std::mutex _localmap_mtx;
83 };
84 
85 } // namespace isae
86 
87 #endif // LOCALMAP_H
isae::LocalMap::getMarginalizationFlag
bool getMarginalizationFlag()
Definition: localmap.h:49
isae::LocalMap::getFixedFrameNumber
size_t getFixedFrameNumber()
Definition: localmap.h:35
isae::LocalMap::_removed_frame_poses
std::vector< Eigen::Affine3d > _removed_frame_poses
old frames poses, for debugging purposes
Definition: localmap.h:80
amap.h
isae::LocalMap
Class for a Local Map.
Definition: localmap.h:13
isae::LocalMap::addFrame
void addFrame(std::shared_ptr< Frame > &frame) override
Add a frame to the local map.
Definition: localmap.cpp:9
isae::LocalMap::getOldFramesPoses
std::vector< Eigen::Affine3d > & getOldFramesPoses()
Definition: localmap.h:36
isae::LocalMap::reset
void reset()
Reset the local map.
Definition: localmap.cpp:78
isae::LocalMap::_fixed_frames_number
size_t _fixed_frames_number
number of frame that remain static during windowed BA
Definition: localmap.h:78
isae::LocalMap::removeFrame
void removeFrame(std::shared_ptr< Frame > &frame)
Remove a frame from the local map.
Definition: localmap.cpp:28
isae::LocalMap::_localmap_mtx
std::mutex _localmap_mtx
Definition: localmap.h:82
isae
Definition: AFeature2D.h:8
isae::LocalMap::_max_kf_number
size_t _max_kf_number
size of the sliding window
Definition: localmap.h:77
isae::LocalMap::LocalMap
LocalMap()=default
isae::LocalMap::computeRelativePose
bool computeRelativePose(std::shared_ptr< Frame > &frame1, std::shared_ptr< Frame > &frame2, Eigen::Affine3d &T_f1_f2, Eigen::MatrixXd &cov)
Compute the relative pose between two frames.
Definition: localmap.cpp:91
isae::LocalMap::_min_kf_number
size_t _min_kf_number
number of keyframes that are added by default when the map starts
Definition: localmap.h:76
isae::LocalMap::getWindowSize
size_t getWindowSize()
Definition: localmap.h:34
isae::LocalMap::discardLastFrame
void discardLastFrame()
Discard the last frame from the local map.
Definition: localmap.cpp:43
isae::LocalMap::removeEmptyLandmarks
void removeEmptyLandmarks()
Remove landmarks from the local map that do not have any features.
Definition: localmap.cpp:60
isae::AMap
Abstract class for a Map.
Definition: amap.h:16
isae::LocalMap::_margin_flag
bool _margin_flag
flag raised if the the last frame needs to be marginalized
Definition: localmap.h:79