diff --git a/src/stella_vslam/module/local_map_updater.cc b/src/stella_vslam/module/local_map_updater.cc index 50524397..ede01c20 100644 --- a/src/stella_vslam/module/local_map_updater.cc +++ b/src/stella_vslam/module/local_map_updater.cc @@ -143,7 +143,7 @@ auto local_map_updater::find_second_local_keyframes(const std::vectorgraph_node_->get_top_n_covisibilities(10); for (const auto& neighbor : neighbors) { add_second_local_keyframe(neighbor); - if (max_num_local_keyfrms_ < first_local_keyframes.size() + second_local_keyfrms.size()) { + if (max_num_local_keyfrms_ <= first_local_keyframes.size() + second_local_keyfrms.size()) { return second_local_keyfrms; } } @@ -162,7 +162,7 @@ auto local_map_updater::find_second_local_keyframes(const std::vectorgraph_node_->get_spanning_children(); for (const auto& child : spanning_children) { add_second_local_keyframe(child); - if (max_num_local_keyfrms_ < first_local_keyframes.size() + second_local_keyfrms.size()) { + if (max_num_local_keyfrms_ <= first_local_keyframes.size() + second_local_keyfrms.size()) { return second_local_keyfrms; } }