Skip to content
Snippets Groups Projects
Commit fb434fba authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Move advanceDerived to before last_ptr_->frame->remove()

parent f710808b
No related branches found
No related tags found
1 merge request!314Resolve "advanceDerived() badly placed"
Pipeline #4201 passed
......@@ -210,12 +210,14 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
getProblem()->auxFrameCallback(last_ptr_->getFrame(), std::static_pointer_cast<ProcessorBase>(shared_from_this()), params_tracker_->time_tolerance);
// Advance this
advanceDerived();
// Replace last frame for a new one in incoming
last_ptr_->getFrame()->addCapture(incoming_ptr_); // Add incoming Capture to the tracker's last Frame
// do not remove! last_ptr_->remove();
incoming_ptr_->getFrame()->setTimeStamp(incoming_ptr_->getTimeStamp());
// Update pointers
advanceDerived();
last_ptr_ = incoming_ptr_;
incoming_ptr_ = nullptr;
}*/
......@@ -224,14 +226,16 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
// We do not create a KF
// Advance this
advanceDerived();
// Replace last frame for a new one in incoming
FrameBasePtr frm = getProblem()->emplaceFrame(NON_ESTIMATED, last_ptr_->getFrame()->getState(), incoming_ptr_->getTimeStamp());
incoming_ptr_->link(frm);
last_ptr_->getFrame()->remove(); // implicitly calling last_ptr_->remove();
// Update pointers
advanceDerived();
last_ptr_ = incoming_ptr_;
incoming_ptr_ = nullptr;
last_ptr_ = incoming_ptr_;
incoming_ptr_ = nullptr;
}
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment