diff --git a/include/core/processor/processor_motion.h b/include/core/processor/processor_motion.h index 3f9d53f9658828015b7d924a0fd1e21844f49de1..12d43a1b5a31f6da67c50ad3c41f569493fe1b02 100644 --- a/include/core/processor/processor_motion.h +++ b/include/core/processor/processor_motion.h @@ -485,9 +485,8 @@ class ProcessorMotion : public ProcessorBase, public IsMotion CaptureMotionPtr last_ptr_; CaptureMotionPtr incoming_ptr_; - FrameBasePtr origin_frame_ptr_; FrameBasePtr last_frame_ptr_; - FrameBasePtr incoming_frame_ptr_; + FrameBasePtr origin_frame_ptr_; protected: // helpers to avoid allocation diff --git a/include/core/processor/processor_tracker.h b/include/core/processor/processor_tracker.h index fdc8da6b88e3ee38ddd17e2d3a47a04472a557e1..1a05397319a431fc04a8b33642d90ad09edb524f 100644 --- a/include/core/processor/processor_tracker.h +++ b/include/core/processor/processor_tracker.h @@ -101,9 +101,7 @@ class ProcessorTracker : public ProcessorBase CaptureBasePtr origin_ptr_; ///< Pointer to the origin of the tracker. CaptureBasePtr last_ptr_; ///< Pointer to the last tracked capture. CaptureBasePtr incoming_ptr_; ///< Pointer to the incoming capture being processed. - FrameBasePtr origin_frame_ptr_; FrameBasePtr last_frame_ptr_; - FrameBasePtr incoming_frame_ptr_; FeatureBasePtrList new_features_last_; ///< List of new features in \b last for landmark initialization and new key-frame creation. FeatureBasePtrList new_features_incoming_; ///< list of the new features of \b last successfully tracked in \b incoming FeatureBasePtrList known_features_last_; ///< list of the known features in previous captures successfully tracked in \b last diff --git a/src/processor/processor_motion.cpp b/src/processor/processor_motion.cpp index c828ab93fd3a32cb8cc3d784211438b71a64a3dc..ed22795772015b43b3c07636fa18bc23bba18450 100644 --- a/src/processor/processor_motion.cpp +++ b/src/processor/processor_motion.cpp @@ -33,10 +33,9 @@ ProcessorMotion::ProcessorMotion(const std::string& _type, origin_ptr_(), last_ptr_(), incoming_ptr_(), - origin_frame_ptr_(), last_frame_ptr_(), - incoming_frame_ptr_(), - dt_(0.0), + origin_frame_ptr_(), + dt_(0.0), x_(_state_size), delta_(_delta_size), delta_cov_(_delta_cov_size, _delta_cov_size), @@ -390,7 +389,6 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr) // clear incoming just in case incoming_ptr_ = nullptr; // This line is not really needed, but it makes things clearer. - incoming_frame_ptr_ = nullptr; postProcess(); } diff --git a/src/processor/processor_tracker.cpp b/src/processor/processor_tracker.cpp index 4e777ec5b54e09229faafede6f714dfdb7f26b52..a3b00d91652c61ae57606c5347fdd450a09a2c73 100644 --- a/src/processor/processor_tracker.cpp +++ b/src/processor/processor_tracker.cpp @@ -24,9 +24,7 @@ ProcessorTracker::ProcessorTracker(const std::string& _type, origin_ptr_(nullptr), last_ptr_(nullptr), incoming_ptr_(nullptr), - origin_frame_ptr_(nullptr), last_frame_ptr_(nullptr), - incoming_frame_ptr_(nullptr), state_structure_(_structure) { // @@ -120,7 +118,6 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) getProblem()->getFrameStructure(), getProblem()->getState()); incoming_ptr_->link(frm); - incoming_frame_ptr_ = frm; // We have a last_ Capture with no features, so we do not process known features, and we do not vote for KF. // Process info @@ -133,11 +130,9 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) // Update pointers resetDerived(); origin_ptr_ = last_ptr_; - origin_frame_ptr_ = last_frame_ptr_; last_ptr_ = incoming_ptr_; - last_frame_ptr_ = incoming_frame_ptr_; + last_frame_ptr_ = frm; incoming_ptr_ = nullptr; - incoming_frame_ptr_ = nullptr; break; } @@ -160,7 +155,6 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) getProblem()->getFrameStructure(), getProblem()->getState()); incoming_ptr_->link(frm); - incoming_frame_ptr_ = frm; // Detect new Features, initialize Landmarks, create Factors, ... processNew(params_tracker_->max_new_features); @@ -171,11 +165,9 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) // Update pointers resetDerived(); origin_ptr_ = last_ptr_; - origin_frame_ptr_ = last_frame_ptr_; last_ptr_ = incoming_ptr_; - last_frame_ptr_ = incoming_frame_ptr_; + last_frame_ptr_ = frm; incoming_ptr_ = nullptr; - incoming_frame_ptr_ = nullptr; break; } @@ -216,14 +208,10 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) getProblem()->getDim(), last_ptr_->getFrame()->getStateVector()); incoming_ptr_->link(frm); - incoming_frame_ptr_ = frm; - origin_ptr_ = last_ptr_; - origin_frame_ptr_ = last_frame_ptr_; last_ptr_ = incoming_ptr_; - last_frame_ptr_ = incoming_frame_ptr_; + last_frame_ptr_ = frm; incoming_ptr_ = nullptr; - incoming_frame_ptr_ = nullptr; } /* TODO: create an auxiliary frame @@ -270,14 +258,12 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) getProblem()->getDim(), last_ptr_->getFrame()->getStateVector()); incoming_ptr_->link(frm); - incoming_frame_ptr_ = frm; last_ptr_->getFrame()->remove(); // implicitly calling last_ptr_->remove(); // Update pointers last_ptr_ = incoming_ptr_; - last_frame_ptr_ = incoming_frame_ptr_; + last_frame_ptr_ = frm; incoming_ptr_ = nullptr; - incoming_frame_ptr_ = nullptr; } break; }