Skip to content
Snippets Groups Projects
Commit 627ae03d authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Remove frame atributes w/o breaking tests

Remove as many XXX_frame_ptr_ as possible without
breaking the gtests
parent 126402be
No related branches found
No related tags found
1 merge request!362WIP: Resolve "std::set and std::map instead of std::list in wolf nodes"
Pipeline #5746 passed
...@@ -485,9 +485,8 @@ class ProcessorMotion : public ProcessorBase, public IsMotion ...@@ -485,9 +485,8 @@ class ProcessorMotion : public ProcessorBase, public IsMotion
CaptureMotionPtr last_ptr_; CaptureMotionPtr last_ptr_;
CaptureMotionPtr incoming_ptr_; CaptureMotionPtr incoming_ptr_;
FrameBasePtr origin_frame_ptr_;
FrameBasePtr last_frame_ptr_; FrameBasePtr last_frame_ptr_;
FrameBasePtr incoming_frame_ptr_; FrameBasePtr origin_frame_ptr_;
protected: protected:
// helpers to avoid allocation // helpers to avoid allocation
......
...@@ -101,9 +101,7 @@ class ProcessorTracker : public ProcessorBase ...@@ -101,9 +101,7 @@ class ProcessorTracker : public ProcessorBase
CaptureBasePtr origin_ptr_; ///< Pointer to the origin of the tracker. CaptureBasePtr origin_ptr_; ///< Pointer to the origin of the tracker.
CaptureBasePtr last_ptr_; ///< Pointer to the last tracked capture. CaptureBasePtr last_ptr_; ///< Pointer to the last tracked capture.
CaptureBasePtr incoming_ptr_; ///< Pointer to the incoming capture being processed. CaptureBasePtr incoming_ptr_; ///< Pointer to the incoming capture being processed.
FrameBasePtr origin_frame_ptr_;
FrameBasePtr last_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_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 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 FeatureBasePtrList known_features_last_; ///< list of the known features in previous captures successfully tracked in \b last
......
...@@ -33,10 +33,9 @@ ProcessorMotion::ProcessorMotion(const std::string& _type, ...@@ -33,10 +33,9 @@ ProcessorMotion::ProcessorMotion(const std::string& _type,
origin_ptr_(), origin_ptr_(),
last_ptr_(), last_ptr_(),
incoming_ptr_(), incoming_ptr_(),
origin_frame_ptr_(),
last_frame_ptr_(), last_frame_ptr_(),
incoming_frame_ptr_(), origin_frame_ptr_(),
dt_(0.0), dt_(0.0),
x_(_state_size), x_(_state_size),
delta_(_delta_size), delta_(_delta_size),
delta_cov_(_delta_cov_size, _delta_cov_size), delta_cov_(_delta_cov_size, _delta_cov_size),
...@@ -390,7 +389,6 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -390,7 +389,6 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr)
// clear incoming just in case // clear incoming just in case
incoming_ptr_ = nullptr; // This line is not really needed, but it makes things clearer. incoming_ptr_ = nullptr; // This line is not really needed, but it makes things clearer.
incoming_frame_ptr_ = nullptr;
postProcess(); postProcess();
} }
......
...@@ -24,9 +24,7 @@ ProcessorTracker::ProcessorTracker(const std::string& _type, ...@@ -24,9 +24,7 @@ ProcessorTracker::ProcessorTracker(const std::string& _type,
origin_ptr_(nullptr), origin_ptr_(nullptr),
last_ptr_(nullptr), last_ptr_(nullptr),
incoming_ptr_(nullptr), incoming_ptr_(nullptr),
origin_frame_ptr_(nullptr),
last_frame_ptr_(nullptr), last_frame_ptr_(nullptr),
incoming_frame_ptr_(nullptr),
state_structure_(_structure) state_structure_(_structure)
{ {
// //
...@@ -120,7 +118,6 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -120,7 +118,6 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
getProblem()->getFrameStructure(), getProblem()->getFrameStructure(),
getProblem()->getState()); getProblem()->getState());
incoming_ptr_->link(frm); 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. // We have a last_ Capture with no features, so we do not process known features, and we do not vote for KF.
// Process info // Process info
...@@ -133,11 +130,9 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -133,11 +130,9 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
// Update pointers // Update pointers
resetDerived(); resetDerived();
origin_ptr_ = last_ptr_; origin_ptr_ = last_ptr_;
origin_frame_ptr_ = last_frame_ptr_;
last_ptr_ = incoming_ptr_; last_ptr_ = incoming_ptr_;
last_frame_ptr_ = incoming_frame_ptr_; last_frame_ptr_ = frm;
incoming_ptr_ = nullptr; incoming_ptr_ = nullptr;
incoming_frame_ptr_ = nullptr;
break; break;
} }
...@@ -160,7 +155,6 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -160,7 +155,6 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
getProblem()->getFrameStructure(), getProblem()->getFrameStructure(),
getProblem()->getState()); getProblem()->getState());
incoming_ptr_->link(frm); incoming_ptr_->link(frm);
incoming_frame_ptr_ = frm;
// Detect new Features, initialize Landmarks, create Factors, ... // Detect new Features, initialize Landmarks, create Factors, ...
processNew(params_tracker_->max_new_features); processNew(params_tracker_->max_new_features);
...@@ -171,11 +165,9 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -171,11 +165,9 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
// Update pointers // Update pointers
resetDerived(); resetDerived();
origin_ptr_ = last_ptr_; origin_ptr_ = last_ptr_;
origin_frame_ptr_ = last_frame_ptr_;
last_ptr_ = incoming_ptr_; last_ptr_ = incoming_ptr_;
last_frame_ptr_ = incoming_frame_ptr_; last_frame_ptr_ = frm;
incoming_ptr_ = nullptr; incoming_ptr_ = nullptr;
incoming_frame_ptr_ = nullptr;
break; break;
} }
...@@ -216,14 +208,10 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -216,14 +208,10 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
getProblem()->getDim(), getProblem()->getDim(),
last_ptr_->getFrame()->getStateVector()); last_ptr_->getFrame()->getStateVector());
incoming_ptr_->link(frm); incoming_ptr_->link(frm);
incoming_frame_ptr_ = frm;
origin_ptr_ = last_ptr_; origin_ptr_ = last_ptr_;
origin_frame_ptr_ = last_frame_ptr_;
last_ptr_ = incoming_ptr_; last_ptr_ = incoming_ptr_;
last_frame_ptr_ = incoming_frame_ptr_; last_frame_ptr_ = frm;
incoming_ptr_ = nullptr; incoming_ptr_ = nullptr;
incoming_frame_ptr_ = nullptr;
} }
/* TODO: create an auxiliary frame /* TODO: create an auxiliary frame
...@@ -270,14 +258,12 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -270,14 +258,12 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
getProblem()->getDim(), getProblem()->getDim(),
last_ptr_->getFrame()->getStateVector()); last_ptr_->getFrame()->getStateVector());
incoming_ptr_->link(frm); incoming_ptr_->link(frm);
incoming_frame_ptr_ = frm;
last_ptr_->getFrame()->remove(); // implicitly calling last_ptr_->remove(); last_ptr_->getFrame()->remove(); // implicitly calling last_ptr_->remove();
// Update pointers // Update pointers
last_ptr_ = incoming_ptr_; last_ptr_ = incoming_ptr_;
last_frame_ptr_ = incoming_frame_ptr_; last_frame_ptr_ = frm;
incoming_ptr_ = nullptr; incoming_ptr_ = nullptr;
incoming_frame_ptr_ = nullptr;
} }
break; 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