Skip to content
Snippets Groups Projects
Commit ffa7ab6f authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

simplified a bit

parent c753b9c4
No related branches found
No related tags found
1 merge request!413Resolve "New ProcessorLoopClosure"
Pipeline #6422 passed
...@@ -27,7 +27,7 @@ struct ParamsProcessorLoopClosure : public ParamsProcessorBase ...@@ -27,7 +27,7 @@ struct ParamsProcessorLoopClosure : public ParamsProcessorBase
* - validateLoop(CaptureBasePtr, CaptureBasePtr) * - validateLoop(CaptureBasePtr, CaptureBasePtr)
* - emplaceFactors(CaptureBasePtr, CaptureBasePtr) * - emplaceFactors(CaptureBasePtr, CaptureBasePtr)
* + You can override the following classes : * + You can override the following classes :
* - process() * - process(CaptureBasePtr)
*/ */
class ProcessorLoopClosure : public ProcessorBase class ProcessorLoopClosure : public ProcessorBase
...@@ -45,11 +45,11 @@ public: ...@@ -45,11 +45,11 @@ public:
protected: protected:
/** \brief Process a frame containing a capture. /** \brief Process a capture (IMPORTANT: capture is linked to a frame).
* If voteFindLoopClosures() returns true, findLoopClosures() is called. * If voteFindLoopClosures() returns true, findLoopClosures() is called.
* emplaceFactors() is called for pairs of current capture and each capture returned by findLoopClosures() * emplaceFactors() is called for pairs of current capture and each capture returned by findLoopClosures()
*/ */
virtual void process(FrameBasePtr, CaptureBasePtr); virtual void process(CaptureBasePtr);
/** \brief Returns if findLoopClosures() has to be called for the given capture /** \brief Returns if findLoopClosures() has to be called for the given capture
*/ */
......
...@@ -27,7 +27,7 @@ void ProcessorLoopClosure::processCapture(CaptureBasePtr _capture) ...@@ -27,7 +27,7 @@ void ProcessorLoopClosure::processCapture(CaptureBasePtr _capture)
{ {
WOLF_DEBUG("CASE 1"); WOLF_DEBUG("CASE 1");
process(_capture->getFrame(), _capture); process(_capture);
// remove the frame and older frames // remove the frame and older frames
buffer_pack_kf_.removeUpTo(_capture->getFrame()->getTimeStamp()); buffer_pack_kf_.removeUpTo(_capture->getFrame()->getTimeStamp());
...@@ -45,7 +45,7 @@ void ProcessorLoopClosure::processCapture(CaptureBasePtr _capture) ...@@ -45,7 +45,7 @@ void ProcessorLoopClosure::processCapture(CaptureBasePtr _capture)
_capture->link(frame_pack->key_frame); _capture->link(frame_pack->key_frame);
process(frame_pack->key_frame, _capture); process(_capture);
// remove the frame and older frames // remove the frame and older frames
buffer_pack_kf_.removeUpTo(frame_pack->key_frame->getTimeStamp()); buffer_pack_kf_.removeUpTo(frame_pack->key_frame->getTimeStamp());
...@@ -74,7 +74,7 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t ...@@ -74,7 +74,7 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t
{ {
WOLF_DEBUG("CASE 1"); WOLF_DEBUG("CASE 1");
process(_frame, cap); process(cap);
// remove the capture (if stored) // remove the capture (if stored)
buffer_capture_.getContainer().erase(cap->getTimeStamp()); buffer_capture_.getContainer().erase(cap->getTimeStamp());
...@@ -92,7 +92,7 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t ...@@ -92,7 +92,7 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t
capture->link(_frame); capture->link(_frame);
process(_frame, capture); process(capture);
// remove the capture (if stored) // remove the capture (if stored)
buffer_capture_.getContainer().erase(capture->getTimeStamp()); buffer_capture_.getContainer().erase(capture->getTimeStamp());
...@@ -117,10 +117,10 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t ...@@ -117,10 +117,10 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t
// nothing (discard frame) // nothing (discard frame)
} }
void ProcessorLoopClosure::process(FrameBasePtr _frame, CaptureBasePtr _capture) void ProcessorLoopClosure::process(CaptureBasePtr _capture)
{ {
WOLF_DEBUG("ProcessorLoopClosure::process frame ", _frame->id(), " capture ", _capture->id()); assert(_capture->getFrame() != nullptr && "ProcessorLoopClosure::process _capture not linked to _frame");
assert(_capture->getFrame() == _frame && "ProcessorLoopClosure::process _capture not linked to _frame"); WOLF_DEBUG("ProcessorLoopClosure::process frame ", _capture->getFrame()->id(), " capture ", _capture->id());
// Detect and emplace features // Detect and emplace features
WOLF_DEBUG("emplacing features..."); WOLF_DEBUG("emplacing features...");
......
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