Skip to content

Commit

Permalink
If the initial pose was given manually, try motion_based_track (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymd-stella authored May 2, 2024
1 parent 5dd8c16 commit 6c9504b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stella_vslam/tracking_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6c9504b

Please sign in to comment.