| 39 | Verbose::eLevel Verbose::th = Verbose::VERBOSITY_NORMAL; |
| 40 | |
| 41 | System::System(const string &strVocFile, const string &strSettingsFile, const eSensor sensor, |
| 42 | const bool bUseViewer, const int initFr, const string &strSequence): |
| 43 | mSensor(sensor), mpViewer(static_cast<Viewer*>(NULL)), mbReset(false), mbResetActiveMap(false), |
| 44 | mbActivateLocalizationMode(false), mbDeactivateLocalizationMode(false), mbShutDown(false) |
| 45 | { |
| 46 | // Output welcome message |
| 47 | cout << endl << |
| 48 | "ORB-SLAM3 Copyright (C) 2017-2020 Carlos Campos, Richard Elvira, Juan J. Gómez, José M.M. Montiel and Juan D. Tardós, University of Zaragoza." << endl << |
| 49 | "ORB-SLAM2 Copyright (C) 2014-2016 Raúl Mur-Artal, José M.M. Montiel and Juan D. Tardós, University of Zaragoza." << endl << |
| 50 | "This program comes with ABSOLUTELY NO WARRANTY;" << endl << |
| 51 | "This is free software, and you are welcome to redistribute it" << endl << |
| 52 | "under certain conditions. See LICENSE.txt." << endl << endl; |
| 53 | |
| 54 | cout << "Input sensor was set to: "; |
| 55 | |
| 56 | if(mSensor==MONOCULAR) |
| 57 | cout << "Monocular" << endl; |
| 58 | else if(mSensor==STEREO) |
| 59 | cout << "Stereo" << endl; |
| 60 | else if(mSensor==RGBD) |
| 61 | cout << "RGB-D" << endl; |
| 62 | else if(mSensor==IMU_MONOCULAR) |
| 63 | cout << "Monocular-Inertial" << endl; |
| 64 | else if(mSensor==IMU_STEREO) |
| 65 | cout << "Stereo-Inertial" << endl; |
| 66 | else if(mSensor==IMU_RGBD) |
| 67 | cout << "RGB-D-Inertial" << endl; |
| 68 | |
| 69 | //Check settings file |
| 70 | cv::FileStorage fsSettings(strSettingsFile.c_str(), cv::FileStorage::READ); |
| 71 | if(!fsSettings.isOpened()) |
| 72 | { |
| 73 | cerr << "Failed to open settings file at: " << strSettingsFile << endl; |
| 74 | exit(-1); |
| 75 | } |
| 76 | |
| 77 | cv::FileNode node = fsSettings["File.version"]; |
| 78 | if(!node.empty() && node.isString() && node.string() == "1.0"){ |
| 79 | settings_ = new Settings(strSettingsFile,mSensor); |
| 80 | |
| 81 | mStrLoadAtlasFromFile = settings_->atlasLoadFile(); |
| 82 | mStrSaveAtlasToFile = settings_->atlasSaveFile(); |
| 83 | |
| 84 | cout << (*settings_) << endl; |
| 85 | } |
| 86 | else{ |
| 87 | settings_ = nullptr; |
| 88 | cv::FileNode node = fsSettings["System.LoadAtlasFromFile"]; |
| 89 | if(!node.empty() && node.isString()) |
| 90 | { |
| 91 | mStrLoadAtlasFromFile = (string)node; |
| 92 | } |
| 93 | |
| 94 | node = fsSettings["System.SaveAtlasToFile"]; |
| 95 | if(!node.empty() && node.isString()) |
| 96 | { |
| 97 | mStrSaveAtlasToFile = (string)node; |
| 98 | } |
nothing calls this directly
no test coverage detected