From 193d2d314a008abab0861e170f1ce8efd2e95802 Mon Sep 17 00:00:00 2001 From: ymd-stella Date: Thu, 2 May 2024 09:53:04 +0900 Subject: [PATCH] If the initial pose was given manually, try motion_based_track --- src/stella_vslam/tracking_module.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stella_vslam/tracking_module.cc b/src/stella_vslam/tracking_module.cc index 298033e6..9a307569 100644 --- a/src/stella_vslam/tracking_module.cc +++ b/src/stella_vslam/tracking_module.cc @@ -327,7 +327,7 @@ bool tracking_module::track_current_frame() { bool succeeded = false; // Tracking mode - if (twist_is_valid_ && last_reloc_frm_id_ + 2 < curr_frm_.id_) { + if (twist_is_valid_) { // if the motion model is valid succeeded = frame_tracker_.motion_based_track(curr_frm_, last_frm_, twist_); } @@ -362,6 +362,8 @@ bool tracking_module::relocalize_by_pose(const pose_request& request) { if (succeeded) { last_reloc_frm_id_ = curr_frm_.id_; last_reloc_frm_timestamp_ = curr_frm_.timestamp_; + // If the initial pose was given manually, use motion_based_track, expecting that the camera is not moving. + last_frm_ = curr_frm_; } } else {