Skip to content
Snippets Groups Projects

Resolve "New ProcessorLoopClosure"

Merged Joan Vallvé Navarro requested to merge 398-new-processorloopclosure into devel
6 files
+ 373
5
Compare changes
  • Side-by-side
  • Inline
Files
6
#ifndef _WOLF_PROCESSOR_LOOP_CLOSURE_BASE_H
#define _WOLF_PROCESSOR_LOOP_CLOSURE_BASE_H
// Wolf related headers
#include "core/processor/processor_base.h"
namespace wolf{
WOLF_STRUCT_PTR_TYPEDEFS(ParamsProcessorLoopClosure);
struct ParamsProcessorLoopClosure : public ParamsProcessorBase
{
using ParamsProcessorBase::ParamsProcessorBase;
// virtual ~ParamsProcessorLoopClosure() = default;
// add neccesery parameters for loop closure initialisation here and initialize
// them in constructor
};
/** \brief General loop closure processor
*
* This is an abstract class.
* + You must define the following classes :
* - voteFindLoopClosures(CaptureBasePtr)
* - emplaceFeatures(CaptureBasePtr)
* - findLoopClosures(CaptureBasePtr)
* - validateLoop(CaptureBasePtr, CaptureBasePtr)
* - emplaceFactors(CaptureBasePtr, CaptureBasePtr)
* + You can override the following classes :
* - process()
*/
class ProcessorLoopClosure : public ProcessorBase
{
protected:
ParamsProcessorLoopClosurePtr params_loop_closure_;
public:
ProcessorLoopClosure(const std::string& _type, int _dim, ParamsProcessorLoopClosurePtr _params_loop_closure);
~ProcessorLoopClosure() override = default;
void configure(SensorBasePtr _sensor) override { };
protected:
/** \brief Process a frame containing a capture.
* 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);
/** \brief Returns if findLoopClosures() has to be called for the given capture
*/
virtual bool voteFindLoopClosures(CaptureBasePtr cap) = 0;
/** \brief detects and emplaces all features of the given capture
*/
virtual void emplaceFeatures(CaptureBasePtr cap) = 0;
/** \brief Find captures that correspond to loop closures with the given capture
*/
virtual CaptureBasePtrList findLoopClosures(CaptureBasePtr _capture) = 0;
/** \brief validates a loop closure
*/
virtual bool validateLoopClosure(CaptureBasePtr _capture_1, CaptureBasePtr _capture_2) = 0;
/** \brief emplaces the factor(s) corresponding to a Loop Closure between two captures
*/
virtual void emplaceFactors(CaptureBasePtr _capture_1, CaptureBasePtr _capture_2) = 0;
void processCapture(CaptureBasePtr) override;
void processKeyFrame(FrameBasePtr, const double&) override;
bool triggerInCapture(CaptureBasePtr _cap) const override { return true;};
bool triggerInKeyFrame(FrameBasePtr _frm, const double& _time_tol) const override { return true;};
bool storeKeyFrame(FrameBasePtr _frm) override { return false;};
bool storeCapture(CaptureBasePtr _cap) override { return false;};
bool voteForKeyFrame() const override { return false;};
};
} // namespace wolf
#endif /* _WOLF_PROCESSOR_LOOP_CLOSURE_BASE_H */
Loading