forked from urbste/MultiCol-SLAM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cLocalMapping.h
147 lines (104 loc) · 3.15 KB
/
cLocalMapping.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/**
* This file is part of MultiCol-SLAM
*
* Copyright (C) 2015-2016 Steffen Urban <urbste at googlemail.com>
* For more information see <https://github.com/urbste/MultiCol-SLAM>
*
* MultiCol-SLAM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MultiCol-SLAM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MultiCol-SLAM . If not, see <http://www.gnu.org/licenses/>.
*/
/*
* MultiCol-SLAM is based on ORB-SLAM2 which was also released under GPLv3
* For more information see <https://github.com/raulmur/ORB_SLAM2>
* Raúl Mur-Artal <raulmur at unizar dot es> (University of Zaragoza)
*/
#ifndef LOCALMAPPING_H
#define LOCALMAPPING_H
#include "cMultiKeyFrame.h"
#include "cMap.h"
#include "cLoopClosing.h"
#include "cTracking.h"
#include "cMultiKeyFrameDatabase.h"
#include <mutex>
namespace MultiColSLAM
{
class cTracking;
class cLoopClosing;
class cMap;
class cLocalMapping
{
public:
cLocalMapping(cMap* pMap);
void SetLoopCloser(cLoopClosing* pLoopCloser);
void SetTracker(cTracking* pTracker);
void Run();
void InsertMultiKeyFrame(cMultiKeyFrame* pKF);
// Thread Synch
void RequestStop();
void RequestReset();
bool Stop();
bool SetNotStop(bool flag);
void Release();
bool isStopped();
bool stopRequested();
void RequestFinish();
bool isFinished();
bool AcceptMultiKeyFrames();
void SetAcceptMultiKeyFrames(bool flag);
void InterruptBA();
void SetMatcherProperties(int _descDim, bool _havingMasks);
std::vector<double> timingMapPointCreate;
std::vector<double> timingLocalBA;
std::vector<double> timingMapPointFusion;
std::vector<double> timingMKFInsertion;
std::vector<double> timingDEPTHimgs;
std::vector<double> timingEDGEExtraction;
std::vector<double> timingEDGEFeatureExtraction;
std::vector<double> timingRenderAllImgs;
std::vector<double> timingAdjustModel2MKF;
protected:
bool CheckNewMultiKeyFrames();
void ProcessNewMultiKeyFrame();
void CreateNewMapPoints();
void MapPointCulling();
void SearchInNeighbors();
void UpdateMapPointStatus();
void KeyFrameCulling();
void ResetIfRequested();
bool CheckFinish();
void SetFinish();
bool mbResetRequested;
std::mutex mMutexReset;
cMap* mpMap;
cLoopClosing* mpLoopCloser;
cTracking* mpTracker;
std::list<cMultiKeyFrame*> mlNewMultiKeyFrames;
cMultiKeyFrame* mpCurrentMultiKeyFrame;
std::list<cMapPoint*> mlpRecentAddedMapPoints;
std::mutex mMutexNewKFs;
bool scaleInitialMap;
bool mbAbortBA;
bool mbStopped;
bool mbStopRequested;
bool mbNotStop;
std::mutex mMutexStop;
bool mbAcceptMultiKeyFrames;
std::mutex mMutexAccept;
int descDim;
bool havingMasks;
bool mbFinishRequested;
bool mbFinished;
std::mutex mMutexFinish;
};
}
#endif // LOCALMAPPING_H