Skip to content
Snippets Groups Projects

Resolve "ProcessorLoopClosureBase class"

Merged Joan Vallvé Navarro requested to merge 220-processor-loop-closure-base into devel
5 files
+ 128
28
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -42,7 +42,7 @@ struct ProcessorParamsLoopClosure : public ProcessorParamsBase
* which are called at the beginning and at the end of process() respectively.
*/
class ProcessorLoopClosureBase : public ProcessorBase
class ProcessorLoopClosure : public ProcessorBase
{
protected:
@@ -50,9 +50,9 @@ protected:
public:
ProcessorLoopClosureBase(const std::string& _type, ProcessorParamsLoopClosurePtr _params_loop_closure);
ProcessorLoopClosure(const std::string& _type, ProcessorParamsLoopClosurePtr _params_loop_closure);
virtual ~ProcessorLoopClosureBase() = default;
virtual ~ProcessorLoopClosure() = default;
virtual void configure(SensorBasePtr _sensor) override { };
/** \brief Full processing of an incoming Capture.
@@ -66,13 +66,13 @@ protected:
/** \brief Called by process(). Tells if computeFeatures() will be called
*/
virtual bool voteComputeFeatures(CaptureBasePtr _incoming_ptr) = 0;
virtual bool voteComputeFeatures() = 0;
/** \brief Called by process(). Tells if findLoopCandidate() and createFactors() will be called
*
* WARNING : A LC can be searched only when voteComputeFeatures() return true
*/
virtual bool voteSearchLoopClosure(CaptureBasePtr _incoming_ptr) = 0;
virtual bool voteSearchLoopClosure() = 0;
/** \brief returns a KeyFrame-Capture pair compatible together (selected from the buffers)
*
@@ -80,19 +80,18 @@ protected:
* In the default implementation, we select the KF with the most recent TimeStamp
* and that is compatible with at least a Capture
*/
std::pair<FrameBasePtr,CaptureBasePtr> selectPairKC(void);
virtual std::pair<FrameBasePtr,CaptureBasePtr> selectPairKC(void);
/** \brief add the Capture and all features needed to the corresponding KF
*
* If the loop closure process requires features associated to each capture,
* the computations to create thies featrues must be done here
* the computations to create these features must be done here.
*
* In this method you should add the capture to the keyframe if necessary
* and add the features to the capture
* Important: All detected features should be emplaced to the capture.
*
* Returns a bool that tells if features were successfully created
*/
virtual bool computeFeatures(std::pair<FrameBasePtr,CaptureBasePtr>) = 0;
virtual bool detectFeatures(CaptureBasePtr cap) = 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
@@ -104,13 +103,12 @@ protected:
*
* overwrite it if you want an additional test after findLoopCandidate()
*/
bool validateLoop(CaptureBasePtr _capture_1, CaptureBasePtr _capture_2) {return true;};
virtual bool validateLoop(CaptureBasePtr _capture_1, CaptureBasePtr _capture_2) {return true;};
/** \brief create the factor(s)
/** \brief emplace the factor(s)
*
* overwrite it if needed
*/
virtual void createFactors(CaptureBasePtr _capture_1, CaptureBasePtr _capture_2) = 0;
virtual void emplaceFactors(CaptureBasePtr _capture_1, CaptureBasePtr _capture_2) = 0;
/** Pre-process incoming Capture
Loading