Skip to content

Commit

Permalink
Add neighbor keyframes in add_loop_candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
ymd-stella committed Feb 24, 2024
1 parent 07b4e82 commit 4f3dbf5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/stella_vslam/module/loop_detector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ bool loop_detector::detect_loop_candidates() {
}

void loop_detector::add_loop_candidate(const std::shared_ptr<data::keyframe>& keyfrm) {
loop_candidates_to_validate_.insert(keyfrm);
if (top_n_covisibilities_to_search_ > 0) {
loop_candidates_to_validate_.insert(keyfrm);
auto covisibilities = keyfrm->graph_node_->get_top_n_covisibilities(top_n_covisibilities_to_search_);
for (const auto& covisibility : covisibilities) {
loop_candidates_to_validate_.insert(covisibility);
}
}
else {
loop_candidates_to_validate_.insert(keyfrm);
}
}

bool loop_detector::detect_loop_candidates_impl() {
Expand Down

0 comments on commit 4f3dbf5

Please sign in to comment.