diff --git a/include/core/processor/processor_loop_closure.h b/include/core/processor/processor_loop_closure.h index 39813708a7954a94a883b5fbbbdbcedf873f3fc9..5574aefc16ce9b5c3dfddc5cb7bfa36bf9a48d07 100644 --- a/include/core/processor/processor_loop_closure.h +++ b/include/core/processor/processor_loop_closure.h @@ -27,7 +27,7 @@ struct ParamsProcessorLoopClosure : public ParamsProcessorBase * - validateLoop(CaptureBasePtr, CaptureBasePtr) * - emplaceFactors(CaptureBasePtr, CaptureBasePtr) * + You can override the following classes : - * - process() + * - process(CaptureBasePtr) */ class ProcessorLoopClosure : public ProcessorBase @@ -45,11 +45,11 @@ public: 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. * 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 */ diff --git a/src/processor/processor_loop_closure.cpp b/src/processor/processor_loop_closure.cpp index 8123737b2f99f06df351b9bddd6233b21b144dcc..6642e1c66bf92f3cae54198808fcd61ee4a2413a 100644 --- a/src/processor/processor_loop_closure.cpp +++ b/src/processor/processor_loop_closure.cpp @@ -27,7 +27,7 @@ void ProcessorLoopClosure::processCapture(CaptureBasePtr _capture) { WOLF_DEBUG("CASE 1"); - process(_capture->getFrame(), _capture); + process(_capture); // remove the frame and older frames buffer_pack_kf_.removeUpTo(_capture->getFrame()->getTimeStamp()); @@ -45,7 +45,7 @@ void ProcessorLoopClosure::processCapture(CaptureBasePtr _capture) _capture->link(frame_pack->key_frame); - process(frame_pack->key_frame, _capture); + process(_capture); // remove the frame and older frames buffer_pack_kf_.removeUpTo(frame_pack->key_frame->getTimeStamp()); @@ -74,7 +74,7 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t { WOLF_DEBUG("CASE 1"); - process(_frame, cap); + process(cap); // remove the capture (if stored) buffer_capture_.getContainer().erase(cap->getTimeStamp()); @@ -92,7 +92,7 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t capture->link(_frame); - process(_frame, capture); + process(capture); // remove the capture (if stored) buffer_capture_.getContainer().erase(capture->getTimeStamp()); @@ -117,10 +117,10 @@ void ProcessorLoopClosure::processKeyFrame(FrameBasePtr _frame, const double& _t // 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() == _frame && "ProcessorLoopClosure::process _capture not linked to _frame"); + assert(_capture->getFrame() != nullptr && "ProcessorLoopClosure::process _capture not linked to _frame"); + WOLF_DEBUG("ProcessorLoopClosure::process frame ", _capture->getFrame()->id(), " capture ", _capture->id()); // Detect and emplace features WOLF_DEBUG("emplacing features...");