System.cc
Go to the documentation of this file.
1 
23 #include "System.h"
24 #include "Converter.h"
25 #include <thread>
26 #include <iomanip>
27 
28 namespace ORB_SLAM2
29 {
30 
31 System::System(const string strVocFile, const eSensor sensor, ORBParameters& parameters,
32  const std::string & map_file, bool load_map): // map serialization addition
33  mSensor(sensor), mbReset(false),mbActivateLocalizationMode(false), mbDeactivateLocalizationMode(false),
34  map_file(map_file), load_map(load_map)
35 {
36  // Output welcome message
37  cout << endl <<
38  "ORB-SLAM2 Copyright (C) 2014-2016 Raul Mur-Artal, University of Zaragoza." << endl <<
39  "This program comes with ABSOLUTELY NO WARRANTY;" << endl <<
40  "This is free software, and you are welcome to redistribute it" << endl <<
41  "under certain conditions. See LICENSE.txt." << endl << endl;
42 
43  cout << "OpenCV version : " << CV_VERSION << endl;
44  cout << "Major version : " << CV_MAJOR_VERSION << endl;
45  cout << "Minor version : " << CV_MINOR_VERSION << endl;
46  cout << "Subminor version : " << CV_SUBMINOR_VERSION << endl;
47 
48  cout << "Input sensor was set to: ";
49 
50  if(mSensor==MONOCULAR)
51  cout << "Monocular" << endl;
52  else if(mSensor==STEREO)
53  cout << "Stereo" << endl;
54  else if(mSensor==RGBD)
55  cout << "RGB-D" << endl;
56 
57  //Load ORB Vocabulary
58  cout << endl << "Loading ORB Vocabulary." << endl;
59 
61 
62  //try to load from the binary file
63  bool bVocLoad = mpVocabulary->loadFromBinFile(strVocFile+".bin");
64 
65  if(!bVocLoad)
66  {
67  cerr << "Cannot find binary file for vocabulary. " << endl;
68  cerr << "Failed to open at: " << strVocFile+".bin" << endl;
69  cerr << "Trying to open the text file. This could take a while..." << endl;
70  bool bVocLoad2 = mpVocabulary->loadFromTextFile(strVocFile);
71  if(!bVocLoad2)
72  {
73  cerr << "Wrong path to vocabulary. " << endl;
74  cerr << "Failed to open at: " << strVocFile << endl;
75  exit(-1);
76  }
77  cerr << "Saving the vocabulary to binary for the next time to " << strVocFile+".bin" << endl;
78  mpVocabulary->saveToBinFile(strVocFile+".bin");
79  }
80 
81  cout << "Vocabulary loaded!" << endl << endl;
82 
83  // begin map serialization addition
84  // load serialized map
85  if (load_map && LoadMap(map_file)) {
86  std::cout << "Using loaded map with " << mpMap->MapPointsInMap() << " points\n" << std::endl;
87  }
88  else {
89  //Create KeyFrame Database
91  //Create the Map
92  mpMap = new Map();
93  }
94  // end map serialization addition
95 
96  //Create Drawers. These are used by the Viewer
98 
99  //Initialize the Tracking thread
100  //(it will live in the main thread of execution, the one that called this constructor)
102  mpMap, mpKeyFrameDatabase, mSensor, parameters);
103 
104  //Initialize the Local Mapping thread and launch
107 
108  //Initialize the Loop Closing thread and launch
111 
112  //Set pointers between threads
115 
118 
121 
123 }
124 
125 void System::TrackStereo(const cv::Mat &imLeft, const cv::Mat &imRight, const double &timestamp)
126 {
127  if(mSensor!=STEREO)
128  {
129  cerr << "ERROR: you called TrackStereo but input sensor was not set to STEREO." << endl;
130  exit(-1);
131  }
132 
133  // Check mode change
134  {
135  unique_lock<mutex> lock(mMutexMode);
137  {
139 
140  // Wait until Local Mapping has effectively stopped
141  while(!mpLocalMapper->isStopped())
142  {
143  std::this_thread::sleep_for(std::chrono::microseconds(1000));
144  }
145 
148  }
150  {
154  }
155  }
156 
157  // Check reset
158  {
159  unique_lock<mutex> lock(mMutexReset);
160  if(mbReset)
161  {
162  mpTracker->Reset();
163  mbReset = false;
164  }
165  }
166 
167  cv::Mat Tcw = mpTracker->GrabImageStereo(imLeft,imRight,timestamp);
168 
169  unique_lock<mutex> lock2(mMutexState);
173  current_position_ = Tcw;
174 }
175 
176 void System::TrackRGBD(const cv::Mat &im, const cv::Mat &depthmap, const double &timestamp)
177 {
178  if(mSensor!=RGBD)
179  {
180  cerr << "ERROR: you called TrackRGBD but input sensor was not set to RGBD." << endl;
181  exit(-1);
182  }
183 
184  // Check mode change
185  {
186  unique_lock<mutex> lock(mMutexMode);
188  {
190 
191  // Wait until Local Mapping has effectively stopped
192  while(!mpLocalMapper->isStopped())
193  {
194  std::this_thread::sleep_for(std::chrono::microseconds(1000));
195  }
196 
199  }
201  {
205  }
206  }
207 
208  // Check reset
209  {
210  unique_lock<mutex> lock(mMutexReset);
211  if(mbReset)
212  {
213  mpTracker->Reset();
214  mbReset = false;
215  }
216  }
217 
218  cv::Mat Tcw = mpTracker->GrabImageRGBD(im,depthmap,timestamp);
219 
220  unique_lock<mutex> lock2(mMutexState);
224  current_position_ = Tcw;
225 }
226 
227 void System::TrackMonocular(const cv::Mat &im, const double &timestamp)
228 {
229  if(mSensor!=MONOCULAR)
230  {
231  cerr << "ERROR: you called TrackMonocular but input sensor was not set to Monocular." << endl;
232  exit(-1);
233  }
234 
235  // Check mode change
236  {
237  unique_lock<mutex> lock(mMutexMode);
239  {
241 
242  // Wait until Local Mapping has effectively stopped
243  while(!mpLocalMapper->isStopped())
244  {
245  std::this_thread::sleep_for(std::chrono::microseconds(1000));
246  }
247 
250  }
252  {
256  }
257  }
258 
259  // Check reset
260  {
261  unique_lock<mutex> lock(mMutexReset);
262  if(mbReset)
263  {
264  mpTracker->Reset();
265  mbReset = false;
266  }
267  }
268 
269  cv::Mat Tcw = mpTracker->GrabImageMonocular(im,timestamp);
270 
271  unique_lock<mutex> lock2(mMutexState);
275 
276  current_position_ = Tcw;
277 }
278 
280 {
281  static int n=0;
282  int curn = mpMap->GetLastBigChangeIdx();
283  if(n<curn)
284  {
285  n=curn;
286  return true;
287  }
288  else
289  return false;
290 }
291 
293 {
294  return mpLoopCloser->isRunningGBA();
295 }
296 
298 {
299  unique_lock<mutex> lock(mMutexReset);
300  mbReset = true;
301 }
302 
304 {
307 
308  // Wait until all thread have effectively stopped
310  {
311  std::this_thread::sleep_for(std::chrono::microseconds(5000));
312  }
313 }
314 
315 void System::SaveTrajectoryTUM(const string &filename)
316 {
317  cout << endl << "Saving camera trajectory to " << filename << " ..." << endl;
318  if(mSensor==MONOCULAR)
319  {
320  cerr << "ERROR: SaveTrajectoryTUM cannot be used for monocular." << endl;
321  return;
322  }
323 
324  vector<KeyFrame*> vpKFs = mpMap->GetAllKeyFrames();
325  sort(vpKFs.begin(),vpKFs.end(),KeyFrame::lId);
326 
327  // Transform all keyframes so that the first keyframe is at the origin.
328  // After a loop closure the first keyframe might not be at the origin.
329  cv::Mat Two = vpKFs[0]->GetPoseInverse();
330 
331  ofstream f;
332  f.open(filename.c_str());
333  f << fixed;
334 
335  // Frame pose is stored relative to its reference keyframe (which is optimized by BA and pose graph).
336  // We need to get first the keyframe pose and then concatenate the relative transformation.
337  // Frames not localized (tracking failure) are not saved.
338 
339  // For each frame we have a reference keyframe (lRit), the timestamp (lT) and a flag
340  // which is true when tracking failed (lbL).
341  list<ORB_SLAM2::KeyFrame*>::iterator lRit = mpTracker->mlpReferences.begin();
342  list<double>::iterator lT = mpTracker->mlFrameTimes.begin();
343  list<bool>::iterator lbL = mpTracker->mlbLost.begin();
344  for(list<cv::Mat>::iterator lit=mpTracker->mlRelativeFramePoses.begin(),
345  lend=mpTracker->mlRelativeFramePoses.end();lit!=lend;lit++, lRit++, lT++, lbL++)
346  {
347  if(*lbL)
348  continue;
349 
350  KeyFrame* pKF = *lRit;
351 
352  cv::Mat Trw = cv::Mat::eye(4,4,CV_32F);
353 
354  // If the reference keyframe was culled, traverse the spanning tree to get a suitable keyframe.
355  while(pKF->isBad())
356  {
357  Trw = Trw*pKF->mTcp;
358  pKF = pKF->GetParent();
359  }
360 
361  Trw = Trw*pKF->GetPose()*Two;
362 
363  cv::Mat Tcw = (*lit)*Trw;
364  cv::Mat Rwc = Tcw.rowRange(0,3).colRange(0,3).t();
365  cv::Mat twc = -Rwc*Tcw.rowRange(0,3).col(3);
366 
367  vector<float> q = Converter::toQuaternion(Rwc);
368 
369  f << setprecision(6) << *lT << " " << setprecision(9) << twc.at<float>(0) << " " << twc.at<float>(1) << " " << twc.at<float>(2) << " " << q[0] << " " << q[1] << " " << q[2] << " " << q[3] << endl;
370  }
371  f.close();
372  cout << endl << "trajectory saved!" << endl;
373 }
374 
375 
376 void System::SaveKeyFrameTrajectoryTUM(const string &filename)
377 {
378  cout << endl << "Saving keyframe trajectory to " << filename << " ..." << endl;
379 
380  vector<KeyFrame*> vpKFs = mpMap->GetAllKeyFrames();
381  sort(vpKFs.begin(),vpKFs.end(),KeyFrame::lId);
382 
383  // Transform all keyframes so that the first keyframe is at the origin.
384  // After a loop closure the first keyframe might not be at the origin.
385  //cv::Mat Two = vpKFs[0]->GetPoseInverse();
386 
387  ofstream f;
388  f.open(filename.c_str());
389  f << fixed;
390 
391  for(size_t i=0; i<vpKFs.size(); i++)
392  {
393  KeyFrame* pKF = vpKFs[i];
394 
395  // pKF->SetPose(pKF->GetPose()*Two);
396 
397  if(pKF->isBad())
398  continue;
399 
400  cv::Mat R = pKF->GetRotation().t();
401  vector<float> q = Converter::toQuaternion(R);
402  cv::Mat t = pKF->GetCameraCenter();
403  f << setprecision(6) << pKF->mTimeStamp << setprecision(7) << " " << t.at<float>(0) << " " << t.at<float>(1) << " " << t.at<float>(2)
404  << " " << q[0] << " " << q[1] << " " << q[2] << " " << q[3] << endl;
405 
406  }
407 
408  f.close();
409  cout << endl << "trajectory saved!" << endl;
410 }
411 
412 void System::SaveTrajectoryKITTI(const string &filename)
413 {
414  cout << endl << "Saving camera trajectory to " << filename << " ..." << endl;
415  if(mSensor==MONOCULAR)
416  {
417  cerr << "ERROR: SaveTrajectoryKITTI cannot be used for monocular." << endl;
418  return;
419  }
420 
421  vector<KeyFrame*> vpKFs = mpMap->GetAllKeyFrames();
422  sort(vpKFs.begin(),vpKFs.end(),KeyFrame::lId);
423 
424  // Transform all keyframes so that the first keyframe is at the origin.
425  // After a loop closure the first keyframe might not be at the origin.
426  cv::Mat Two = vpKFs[0]->GetPoseInverse();
427 
428  ofstream f;
429  f.open(filename.c_str());
430  f << fixed;
431 
432  // Frame pose is stored relative to its reference keyframe (which is optimized by BA and pose graph).
433  // We need to get first the keyframe pose and then concatenate the relative transformation.
434  // Frames not localized (tracking failure) are not saved.
435 
436  // For each frame we have a reference keyframe (lRit), the timestamp (lT) and a flag
437  // which is true when tracking failed (lbL).
438  list<ORB_SLAM2::KeyFrame*>::iterator lRit = mpTracker->mlpReferences.begin();
439  list<double>::iterator lT = mpTracker->mlFrameTimes.begin();
440  for(list<cv::Mat>::iterator lit=mpTracker->mlRelativeFramePoses.begin(), lend=mpTracker->mlRelativeFramePoses.end();lit!=lend;lit++, lRit++, lT++)
441  {
442  ORB_SLAM2::KeyFrame* pKF = *lRit;
443 
444  cv::Mat Trw = cv::Mat::eye(4,4,CV_32F);
445 
446  while(pKF->isBad())
447  {
448  // cout << "bad parent" << endl;
449  Trw = Trw*pKF->mTcp;
450  pKF = pKF->GetParent();
451  }
452 
453  Trw = Trw*pKF->GetPose()*Two;
454 
455  cv::Mat Tcw = (*lit)*Trw;
456  cv::Mat Rwc = Tcw.rowRange(0,3).colRange(0,3).t();
457  cv::Mat twc = -Rwc*Tcw.rowRange(0,3).col(3);
458 
459  f << setprecision(9) << Rwc.at<float>(0,0) << " " << Rwc.at<float>(0,1) << " " << Rwc.at<float>(0,2) << " " << twc.at<float>(0) << " " <<
460  Rwc.at<float>(1,0) << " " << Rwc.at<float>(1,1) << " " << Rwc.at<float>(1,2) << " " << twc.at<float>(1) << " " <<
461  Rwc.at<float>(2,0) << " " << Rwc.at<float>(2,1) << " " << Rwc.at<float>(2,2) << " " << twc.at<float>(2) << endl;
462  }
463  f.close();
464  cout << endl << "trajectory saved!" << endl;
465 }
466 
467 void System::SetMinimumKeyFrames (int min_num_kf) {
468  mpTracker->SetMinimumKeyFrames(min_num_kf);
469 }
470 
472  return current_position_;
473 }
474 
476 {
477  unique_lock<mutex> lock(mMutexState);
478  return mTrackingState;
479 }
480 
481 vector<MapPoint*> System::GetTrackedMapPoints()
482 {
483  unique_lock<mutex> lock(mMutexState);
484  return mTrackedMapPoints;
485 }
486 
487 vector<cv::KeyPoint> System::GetTrackedKeyPointsUn()
488 {
489  unique_lock<mutex> lock(mMutexState);
490  return mTrackedKeyPointsUn;
491 }
492 
494  return mpFrameDrawer->DrawFrame();
495 }
496 
497 std::vector<MapPoint*> System::GetAllMapPoints() {
498  return mpMap->GetAllMapPoints();
499 }
500 
501 
502 bool System::SetCallStackSize (const rlim_t kNewStackSize) {
503  struct rlimit rlimit;
504  int operation_result;
505 
506  operation_result = getrlimit(RLIMIT_STACK, &rlimit);
507  if (operation_result != 0) {
508  std::cerr << "Error getting the call stack struct" << std::endl;
509  return false;
510  }
511 
512  if (kNewStackSize > rlimit.rlim_max) {
513  std::cerr << "Requested call stack size too large" << std::endl;
514  return false;
515  }
516 
517  if (rlimit.rlim_cur <= kNewStackSize) {
518  rlimit.rlim_cur = kNewStackSize;
519  operation_result = setrlimit(RLIMIT_STACK, &rlimit);
520  if (operation_result != 0) {
521  std::cerr << "Setrlimit returned result: " << operation_result << std::endl;
522  return false;
523  }
524  return true;
525  }
526  return false;
527 }
528 
529 
531  struct rlimit rlimit;
532  int operation_result;
533 
534  operation_result = getrlimit(RLIMIT_STACK, &rlimit);
535  if (operation_result != 0) {
536  std::cerr << "Error getting the call stack struct" << std::endl;
537  return 16 * 1024L * 1024L; //default
538  }
539 
540  return rlimit.rlim_cur;
541 }
542 
543 
545 {
547  unique_lock<mutex> lock(mMutexMode);
549 }
550 
552 {
554  unique_lock<mutex> lock(mMutexMode);
556 }
557 
558 void System::EnableLocalizationOnly (bool localize_only) {
559  if (localize_only != currently_localizing_only_) {
560  currently_localizing_only_ = localize_only;
561  if (localize_only) {
563  } else {
565  }
566  }
567 
568  std::cout << "Enable localization only: " << (localize_only?"true":"false") << std::endl;
569 }
570 
571 
572 // map serialization addition
573 bool System::SaveMap(const string &filename) {
574  unique_lock<mutex>MapPointGlobal(MapPoint::mGlobalMutex);
575  std::ofstream out(filename, std::ios_base::binary);
576  if (!out) {
577  std::cerr << "cannot write to map file: " << map_file << std::endl;
578  return false;
579  }
580 
581  const rlim_t kNewStackSize = 64L * 1024L * 1024L; // min stack size = 64 Mb
582  const rlim_t kDefaultCallStackSize = GetCurrentCallStackSize();
583  if (!SetCallStackSize(kNewStackSize)) {
584  std::cerr << "Error changing the call stack size; Aborting" << std::endl;
585  return false;
586  }
587 
588  try {
589  std::cout << "saving map file: " << map_file << std::flush;
590  boost::archive::binary_oarchive oa(out, boost::archive::no_header);
591  oa << mpMap;
592  oa << mpKeyFrameDatabase;
593  std::cout << " ... done" << std::endl;
594  out.close();
595  } catch (const std::exception &e) {
596  std::cerr << e.what() << std::endl;
597  SetCallStackSize(kDefaultCallStackSize);
598  return false;
599  } catch (...) {
600  std::cerr << "Unknows exeption" << std::endl;
601  SetCallStackSize(kDefaultCallStackSize);
602  return false;
603  }
604 
605  SetCallStackSize(kDefaultCallStackSize);
606  return true;
607 }
608 
609 bool System::LoadMap(const string &filename) {
610 
611  unique_lock<mutex>MapPointGlobal(MapPoint::mGlobalMutex);
612  std::ifstream in(filename, std::ios_base::binary);
613  if (!in) {
614  cerr << "Cannot open map file: " << map_file << " , you need create it first!" << std::endl;
615  return false;
616  }
617 
618  const rlim_t kNewStackSize = 64L * 1024L * 1024L; // min stack size = 64 Mb
619  const rlim_t kDefaultCallStackSize = GetCurrentCallStackSize();
620  if (!SetCallStackSize(kNewStackSize)) {
621  std::cerr << "Error changing the call stack size; Aborting" << std::endl;
622  return false;
623  }
624 
625  std::cout << "Loading map file: " << map_file << std::flush;
626  boost::archive::binary_iarchive ia(in, boost::archive::no_header);
627  ia >> mpMap;
628  ia >> mpKeyFrameDatabase;
629  mpKeyFrameDatabase->SetORBvocabulary(mpVocabulary);
630  std::cout << " ... done" << std::endl;
631 
632  std::cout << "Map reconstructing" << flush;
633  vector<ORB_SLAM2::KeyFrame*> vpKFS = mpMap->GetAllKeyFrames();
634  unsigned long mnFrameId = 0;
635  for (auto it:vpKFS) {
636 
637  it->SetORBvocabulary(mpVocabulary);
638  it->ComputeBoW();
639 
640  if (it->mnFrameId > mnFrameId) {
641  mnFrameId = it->mnFrameId;
642  }
643  }
644 
645  Frame::nNextId = mnFrameId;
646 
647  std::cout << " ... done" << std::endl;
648  in.close();
649 
650  SetCallStackSize(kDefaultCallStackSize);
651 
652  return true;
653 }
654 
655 } //namespace ORB_SLAM
bool MapChanged()
Definition: System.cc:279
cv::Mat GetRotation()
Definition: KeyFrame.cc:111
KeyFrameDatabase * mpKeyFrameDatabase
Definition: System.h:164
ORBVocabulary * mpVocabulary
Definition: System.h:161
void saveToBinFile(const std::string &filename) const
std::vector< MapPoint * > mvpMapPoints
Definition: Frame.h:153
std::vector< MapPoint * > GetTrackedMapPoints()
Definition: System.cc:481
cv::Mat GetCameraCenter()
Definition: KeyFrame.cc:98
f
void SetLoopClosing(LoopClosing *pLoopClosing)
Definition: Tracking.cc:142
cv::Mat current_position_
Definition: System.h:204
std::vector< MapPoint * > mTrackedMapPoints
Definition: System.h:199
bool SaveMap(const string &filename)
Definition: System.cc:573
rlim_t GetCurrentCallStackSize()
Definition: System.cc:530
void SetTracker(Tracking *pTracker)
Definition: LocalMapping.cc:42
void TrackMonocular(const cv::Mat &im, const double &timestamp)
Definition: System.cc:227
bool currently_localizing_only_
Definition: System.h:151
std::thread * mptLocalMapping
Definition: System.h:185
cv::Mat GetPose()
Definition: KeyFrame.cc:86
LoopClosing * mpLoopCloser
Definition: System.h:179
bool SetCallStackSize(const rlim_t kNewStackSize)
Definition: System.cc:502
std::vector< KeyFrame * > GetAllKeyFrames()
Definition: Map.cc:82
void SetLocalMapper(LocalMapping *pLocalMapper)
Definition: Tracking.cc:137
bool isRunningGBA()
Definition: System.cc:292
cv::Mat GrabImageRGBD(const cv::Mat &imRGB, const cv::Mat &imD, const double &timestamp)
Definition: Tracking.cc:188
const double mTimeStamp
Definition: KeyFrame.h:128
System(const string strVocFile, const eSensor sensor, ORBParameters &parameters, const std::string &map_file="", bool load_map=false)
Definition: System.cc:31
LocalMapping * mpLocalMapper
Definition: System.h:175
static std::vector< float > toQuaternion(const cv::Mat &M)
Definition: Converter.cc:137
void TrackStereo(const cv::Mat &imLeft, const cv::Mat &imRight, const double &timestamp)
Definition: System.cc:125
list< bool > mlbLost
Definition: Tracking.h:123
void SetLocalMapper(LocalMapping *pLocalMapper)
Definition: LoopClosing.cc:51
void EnableLocalizationOnly(bool localize_only)
Definition: System.cc:558
void Shutdown()
Definition: System.cc:303
cv::Mat GrabImageStereo(const cv::Mat &imRectLeft, const cv::Mat &imRectRight, const double &timestamp)
Definition: Tracking.cc:148
std::vector< cv::KeyPoint > GetTrackedKeyPointsUn()
Definition: System.cc:487
int mTrackingState
Definition: System.h:198
Tracking * mpTracker
Definition: System.h:172
std::vector< cv::KeyPoint > mvKeysUn
Definition: Frame.h:138
std::vector< MapPoint * > GetAllMapPoints()
Definition: Map.cc:88
static std::mutex mGlobalMutex
Definition: MapPoint.h:114
static bool lId(KeyFrame *pKF1, KeyFrame *pKF2)
Definition: KeyFrame.h:116
eTrackingState mState
Definition: Tracking.h:101
void SetTracker(Tracking *pTracker)
Definition: LoopClosing.cc:46
std::thread * mptLoopClosing
Definition: System.h:186
std::vector< cv::KeyPoint > mTrackedKeyPointsUn
Definition: System.h:200
bool mbActivateLocalizationMode
Definition: System.h:194
void TrackRGBD(const cv::Mat &im, const cv::Mat &depthmap, const double &timestamp)
Definition: System.cc:176
eSensor mSensor
Definition: System.h:158
void SaveTrajectoryKITTI(const string &filename)
Definition: System.cc:412
void SaveTrajectoryTUM(const string &filename)
Definition: System.cc:315
int GetTrackingState()
Definition: System.cc:475
list< double > mlFrameTimes
Definition: Tracking.h:122
static long unsigned int nNextId
Definition: Frame.h:167
long unsigned int MapPointsInMap()
Definition: Map.cc:94
void SetMinimumKeyFrames(int min_num_kf)
Definition: Tracking.h:79
bool loadFromTextFile(const std::string &filename)
void SetORBvocabulary(ORBVocabulary *porbv)
std::mutex mMutexState
Definition: System.h:201
std::string map_file
Definition: System.h:155
cv::Mat GetCurrentPosition()
Definition: System.cc:471
void InformOnlyTracking(const bool &flag)
Definition: Tracking.cc:1559
void SetLoopCloser(LoopClosing *pLoopCloser)
Definition: LocalMapping.cc:37
bool mbDeactivateLocalizationMode
Definition: System.h:195
DBoW2::TemplatedVocabulary< DBoW2::FORB::TDescriptor, DBoW2::FORB > ORBVocabulary
Definition: ORBVocabulary.h:32
list< KeyFrame * > mlpReferences
Definition: Tracking.h:121
void DeactivateLocalizationMode()
Definition: System.cc:551
std::mutex mMutexMode
Definition: System.h:193
FrameDrawer * mpFrameDrawer
Definition: System.h:181
bool loadFromBinFile(const std::string &filename)
list< cv::Mat > mlRelativeFramePoses
Definition: Tracking.h:120
std::vector< MapPoint * > GetAllMapPoints()
Definition: System.cc:497
void SaveKeyFrameTrajectoryTUM(const string &filename)
Definition: System.cc:376
bool LoadMap(const string &filename)
Definition: System.cc:609
std::mutex mMutexReset
Definition: System.h:189
void ActivateLocalizationMode()
Definition: System.cc:544
cv::Mat GrabImageMonocular(const cv::Mat &im, const double &timestamp)
Definition: Tracking.cc:219
cv::Mat DrawCurrentFrame()
Definition: System.cc:493
void SetMinimumKeyFrames(int min_num_kf)
Definition: System.cc:467
int GetLastBigChangeIdx()
Definition: Map.cc:76
KeyFrame * GetParent()
Definition: KeyFrame.cc:406


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