diff --git a/include/core/processor/processor_loopclosure_base.h b/include/core/processor/processor_loopclosure_base.h index 151e7def92e1fcc2044f2e4d9be4b9c512804cea..944a1ca29ad72770c1bcb4ab8ec76ec6d12ad57b 100644 --- a/include/core/processor/processor_loopclosure_base.h +++ b/include/core/processor/processor_loopclosure_base.h @@ -89,8 +89,10 @@ protected: * * In this method you should add the capture to the keyframe if necessary * and add the features to the capture + * + * Returns a bool that tells if features were successfully created */ - virtual void computeFeatures(std::pair<FrameBasePtr,CaptureBasePtr>) = 0; + virtual bool computeFeatures(std::pair<FrameBasePtr,CaptureBasePtr>) = 0; /** \brief Find a KF that would be a good candidate to close a loop * if validateLoop is not overwritten, a loop will be closed with the returned candidate diff --git a/src/processor/processor_loopclosure_base.cpp b/src/processor/processor_loopclosure_base.cpp index f981cb0abf2095b6f11043fe895ae1f6f29969fd..04408df13f3e1c801f8351f044eadd9c47d614fa 100644 --- a/src/processor/processor_loopclosure_base.cpp +++ b/src/processor/processor_loopclosure_base.cpp @@ -28,9 +28,9 @@ void ProcessorLoopClosureBase::process(CaptureBasePtr _incoming_ptr) { std::pair<FrameBasePtr,CaptureBasePtr> pairKC = selectPairKC(); if (pairKC.first==nullptr || pairKC.second==nullptr) return; - computeFeatures(pairKC); + bool success_computeFeatures = computeFeatures(pairKC); - if (voteSearchLoopClosure(_incoming_ptr)) + if (success_computeFeatures && voteSearchLoopClosure(_incoming_ptr)) { CaptureBasePtr capture_1 = pairKC.second; CaptureBasePtr capture_2 = findLoopCandidate(capture_1);