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

Merge branch 'devel' into 248-processor-constructors-and-creators-requiring-a-sensor-pointer

parents 86f375d4 1c27aec2
No related branches found
No related tags found
1 merge request!313WIP: Resolve "Processor constructors and creators requiring a sensor pointer?"
Pipeline #4208 passed
...@@ -329,7 +329,7 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce ...@@ -329,7 +329,7 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce
void setSensor(SensorBasePtr _sen_ptr){sensor_ptr_ = _sen_ptr;} void setSensor(SensorBasePtr _sen_ptr){sensor_ptr_ = _sen_ptr;}
public: public:
virtual bool isMotion(); virtual bool isMotion() const;
void setTimeTolerance(Scalar _time_tolerance); void setTimeTolerance(Scalar _time_tolerance);
...@@ -380,7 +380,7 @@ std::shared_ptr<classType> ProcessorBase::emplace(SensorBasePtr _sen_ptr, T&&... ...@@ -380,7 +380,7 @@ std::shared_ptr<classType> ProcessorBase::emplace(SensorBasePtr _sen_ptr, T&&...
return prc; return prc;
} }
inline bool ProcessorBase::isMotion() inline bool ProcessorBase::isMotion() const
{ {
return false; return false;
} }
......
...@@ -159,7 +159,7 @@ class ProcessorMotion : public ProcessorBase ...@@ -159,7 +159,7 @@ class ProcessorMotion : public ProcessorBase
virtual void resetDerived(); virtual void resetDerived();
// Queries to the processor: // Queries to the processor:
virtual bool isMotion() override; virtual bool isMotion() const override;
/** \brief Fill a reference to the state integrated so far /** \brief Fill a reference to the state integrated so far
* \param _x the returned state vector * \param _x the returned state vector
...@@ -571,7 +571,7 @@ inline Motion ProcessorMotion::getMotion(const TimeStamp& _ts) const ...@@ -571,7 +571,7 @@ inline Motion ProcessorMotion::getMotion(const TimeStamp& _ts) const
return capture_ptr->getBuffer().getMotion(_ts); return capture_ptr->getBuffer().getMotion(_ts);
} }
inline bool ProcessorMotion::isMotion() inline bool ProcessorMotion::isMotion() const
{ {
return true; return true;
} }
......
...@@ -108,6 +108,8 @@ class ProcessorTracker : public ProcessorBase ...@@ -108,6 +108,8 @@ class ProcessorTracker : public ProcessorBase
ProcessorParamsTrackerPtr _params_tracker); ProcessorParamsTrackerPtr _params_tracker);
virtual ~ProcessorTracker(); virtual ~ProcessorTracker();
virtual bool isMotion() const final override {return false; }
bool checkTimeTolerance(const TimeStamp& _ts1, const TimeStamp& _ts2); bool checkTimeTolerance(const TimeStamp& _ts1, const TimeStamp& _ts2);
bool checkTimeTolerance(const CaptureBasePtr _cap, const TimeStamp& _ts); bool checkTimeTolerance(const CaptureBasePtr _cap, const TimeStamp& _ts);
......
...@@ -159,6 +159,8 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -159,6 +159,8 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
} }
case RUNNING_WITHOUT_PACK : case RUNNING_WITHOUT_PACK :
{ {
WOLF_DEBUG( "PT ", getName(), " RUNNING_WITHOUT_PACK");
processKnown(); processKnown();
if (voteForKeyFrame() && permittedKeyFrame()) if (voteForKeyFrame() && permittedKeyFrame())
...@@ -210,12 +212,14 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -210,12 +212,14 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
getProblem()->auxFrameCallback(last_ptr_->getFrame(), std::static_pointer_cast<ProcessorBase>(shared_from_this()), params_tracker_->time_tolerance); getProblem()->auxFrameCallback(last_ptr_->getFrame(), std::static_pointer_cast<ProcessorBase>(shared_from_this()), params_tracker_->time_tolerance);
// Advance this // 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 last_ptr_->getFrame()->addCapture(incoming_ptr_); // Add incoming Capture to the tracker's last Frame
// do not remove! last_ptr_->remove(); // do not remove! last_ptr_->remove();
incoming_ptr_->getFrame()->setTimeStamp(incoming_ptr_->getTimeStamp()); incoming_ptr_->getFrame()->setTimeStamp(incoming_ptr_->getTimeStamp());
// Update pointers // Update pointers
advanceDerived();
last_ptr_ = incoming_ptr_; last_ptr_ = incoming_ptr_;
incoming_ptr_ = nullptr; incoming_ptr_ = nullptr;
}*/ }*/
...@@ -224,14 +228,16 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr) ...@@ -224,14 +228,16 @@ void ProcessorTracker::processCapture(CaptureBasePtr _incoming_ptr)
// We do not create a KF // We do not create a KF
// Advance this // 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()); FrameBasePtr frm = getProblem()->emplaceFrame(NON_ESTIMATED, last_ptr_->getFrame()->getState(), incoming_ptr_->getTimeStamp());
incoming_ptr_->link(frm); incoming_ptr_->link(frm);
last_ptr_->getFrame()->remove(); // implicitly calling last_ptr_->remove(); last_ptr_->getFrame()->remove(); // implicitly calling last_ptr_->remove();
// Update pointers // Update pointers
advanceDerived(); last_ptr_ = incoming_ptr_;
last_ptr_ = incoming_ptr_; incoming_ptr_ = nullptr;
incoming_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