| 30 | } |
| 31 | |
| 32 | void LoopClosure::setup() { |
| 33 | pose_graph_ = std::unique_ptr<PoseGraph>(new PoseGraph()); |
| 34 | |
| 35 | pose_graph_->set_fast_relocalization(params_.fast_relocalization_); |
| 36 | |
| 37 | if (params_.global_mapping_params_.enabled) { |
| 38 | global_map_ = std::unique_ptr<GlobalMap>(new GlobalMap()); |
| 39 | pose_graph_->setLoopClosureOptimizationCallback( |
| 40 | std::bind(&GlobalMap::loopClosureOptimizationFinishCallback, global_map_.get(), std::placeholders::_1)); |
| 41 | } |
| 42 | |
| 43 | if (params_.health_params_.enabled) { |
| 44 | switching_estimator_ = std::unique_ptr<SwitchingEstimator>(new SwitchingEstimator(params_)); |
| 45 | } |
| 46 | |
| 47 | pose_graph_->startOptimizationThread(); |
| 48 | |
| 49 | // Loading vocabulary |
| 50 | voc_ = new BriefVocabulary(params_.vocabulary_file_); |
| 51 | BriefDatabase db; |
| 52 | db.setVocabulary(*voc_, false, 0); |
| 53 | LOG(INFO) << "Vocabulary loaded!"; |
| 54 | pose_graph_->setBriefVocAndDB(voc_, db); |
| 55 | } |
| 56 | |
| 57 | void LoopClosure::run() { |
| 58 | while (!shutdown_) { |
nothing calls this directly
no test coverage detected