123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- #ifndef ATLAS_H
- #define ATLAS_H
- #include "Map.h"
- #include "MapPoint.h"
- #include "KeyFrame.h"
- #include "GeometricCamera.h"
- #include "Pinhole.h"
- #include "KannalaBrandt8.h"
- #include <set>
- #include <mutex>
- #include <boost/serialization/vector.hpp>
- #include <boost/serialization/export.hpp>
- namespace ORB_SLAM3
- {
- class Viewer;
- class Map;
- class MapPoint;
- class KeyFrame;
- class KeyFrameDatabase;
- class Frame;
- class KannalaBrandt8;
- class Pinhole;
- class Atlas
- {
- friend class boost::serialization::access;
- template<class Archive>
- void serialize(Archive &ar, const unsigned int version)
- {
-
-
-
-
- ar & mvpBackupMaps;
- ar & mvpCameras;
-
-
-
- ar & Map::nNextId;
- ar & Frame::nNextId;
- ar & KeyFrame::nNextId;
- ar & MapPoint::nNextId;
- ar & GeometricCamera::nNextId;
- ar & mnLastInitKFidMap;
- }
- public:
- Atlas();
- Atlas(int initKFid);
- ~Atlas();
- void CreateNewMap();
- void ChangeMap(Map* pMap);
- unsigned long int GetLastInitKFid();
- void SetViewer(Viewer* pViewer);
-
- void AddKeyFrame(KeyFrame* pKF);
- void AddMapPoint(MapPoint* pMP);
-
-
- void AddCamera(GeometricCamera* pCam);
-
- void SetReferenceMapPoints(const std::vector<MapPoint*> &vpMPs);
- void InformNewBigChange();
- int GetLastBigChangeIdx();
- long unsigned int MapPointsInMap();
- long unsigned KeyFramesInMap();
-
- std::vector<KeyFrame*> GetAllKeyFrames();
- std::vector<MapPoint*> GetAllMapPoints();
- std::vector<MapPoint*> GetReferenceMapPoints();
- vector<Map*> GetAllMaps();
- int CountMaps();
- void clearMap();
- void clearAtlas();
- Map* GetCurrentMap();
- void SetMapBad(Map* pMap);
- void RemoveBadMaps();
- bool isInertial();
- void SetInertialSensor();
- void SetImuInitialized();
- bool isImuInitialized();
-
- void PreSave();
- void PostLoad();
- void SetKeyFrameDababase(KeyFrameDatabase* pKFDB);
- KeyFrameDatabase* GetKeyFrameDatabase();
- void SetORBVocabulary(ORBVocabulary* pORBVoc);
- ORBVocabulary* GetORBVocabulary();
- long unsigned int GetNumLivedKF();
- long unsigned int GetNumLivedMP();
- protected:
- std::set<Map*> mspMaps;
- std::set<Map*> mspBadMaps;
-
- std::vector<Map*> mvpBackupMaps;
- Map* mpCurrentMap;
- std::vector<GeometricCamera*> mvpCameras;
- std::vector<KannalaBrandt8*> mvpBackupCamKan;
- std::vector<Pinhole*> mvpBackupCamPin;
-
- std::mutex mMutexAtlas;
- unsigned long int mnLastInitKFidMap;
- Viewer* mpViewer;
- bool mHasViewer;
-
- KeyFrameDatabase* mpKeyFrameDB;
- ORBVocabulary* mpORBVocabulary;
- };
- }
- #endif
|