Map.h
Go to the documentation of this file.
1 
21 #ifndef MAP_H
22 #define MAP_H
23 
24 #include "MapPoint.h"
25 #include "KeyFrame.h"
26 #include "BoostArchiver.h"
27 
28 #include <set>
29 #include <mutex>
30 
31 
32 
33 namespace ORB_SLAM2
34 {
35 
36 class MapPoint;
37 class KeyFrame;
38 
39 class Map
40 {
41 public:
42  Map();
43 
44  void AddKeyFrame(KeyFrame* pKF);
45  void AddMapPoint(MapPoint* pMP);
46  void EraseMapPoint(MapPoint* pMP);
47  void EraseKeyFrame(KeyFrame* pKF);
48  void SetReferenceMapPoints(const std::vector<MapPoint*> &vpMPs);
49  void InformNewBigChange();
50  int GetLastBigChangeIdx();
51 
52  std::vector<KeyFrame*> GetAllKeyFrames();
53  std::vector<MapPoint*> GetAllMapPoints();
54  std::vector<MapPoint*> GetReferenceMapPoints();
55 
56  long unsigned int MapPointsInMap();
57  long unsigned KeyFramesInMap();
58 
59  long unsigned int GetMaxKFid();
60 
61  void clear();
62 
63  vector<KeyFrame*> mvpKeyFrameOrigins;
64 
65  std::mutex mMutexMapUpdate;
66 
67  // This avoid that two points are created simultaneously in separate threads (id conflict)
68  std::mutex mMutexPointCreation;
69 
70 protected:
71  std::set<MapPoint*> mspMapPoints;
72  std::set<KeyFrame*> mspKeyFrames;
73 
74  std::vector<MapPoint*> mvpReferenceMapPoints;
75 
76  long unsigned int mnMaxKFid;
77 
78  // Index related to a big change in the map (loop closure, global BA)
80 
81  std::mutex mMutexMap;
82 
83 // map serialization addition
84 private:
85  // serialize is recommended to be private
87  template<class Archive>
88  void serialize(Archive &ar, const unsigned int version);
89 };
90 
91 } //namespace ORB_SLAM
92 
93 #endif // MAP_H
std::mutex mMutexPointCreation
Definition: Map.h:68
long unsigned int GetMaxKFid()
Definition: Map.cc:112
void EraseMapPoint(MapPoint *pMP)
Definition: Map.cc:46
void InformNewBigChange()
Definition: Map.cc:70
std::mutex mMutexMap
Definition: Map.h:81
std::vector< MapPoint * > mvpReferenceMapPoints
Definition: Map.h:74
std::vector< KeyFrame * > GetAllKeyFrames()
Definition: Map.cc:82
std::mutex mMutexMapUpdate
Definition: Map.h:65
std::vector< MapPoint * > GetReferenceMapPoints()
Definition: Map.cc:106
void AddMapPoint(MapPoint *pMP)
Definition: Map.cc:40
std::vector< MapPoint * > GetAllMapPoints()
Definition: Map.cc:88
long unsigned int mnMaxKFid
Definition: Map.h:76
friend class boost::serialization::access
Definition: Map.h:86
vector< KeyFrame * > mvpKeyFrameOrigins
Definition: Map.h:63
int mnBigChangeIdx
Definition: Map.h:79
long unsigned KeyFramesInMap()
Definition: Map.cc:100
void clear()
Definition: Map.cc:118
long unsigned int MapPointsInMap()
Definition: Map.cc:94
void EraseKeyFrame(KeyFrame *pKF)
Definition: Map.cc:55
std::set< MapPoint * > mspMapPoints
Definition: Map.h:71
void serialize(Archive &ar, const unsigned int version)
Definition: Map.cc:135
void SetReferenceMapPoints(const std::vector< MapPoint * > &vpMPs)
Definition: Map.cc:64
void AddKeyFrame(KeyFrame *pKF)
Definition: Map.cc:32
int GetLastBigChangeIdx()
Definition: Map.cc:76
std::set< KeyFrame * > mspKeyFrames
Definition: Map.h:72


orb_slam2_ros
Author(s):
autogenerated on Wed Apr 21 2021 02:53:05