template class mrpt::graphslam::deciders::CEdgeRegistrationDecider

Interface for implementing edge registration classes.

CEdgeRegistrationDecider provides the basic methods that have to exist in every edge registration decider class. For an example of inheriting from this class see CICPCriteriaERD.

As a naming convention, all the implemented edge registration deciders are suffixed with the ERD acronym.

#include <mrpt/graphslam/interfaces/CEdgeRegistrationDecider.h>

template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
class CEdgeRegistrationDecider: public mrpt::graphslam::CRegistrationDeciderOrOptimizer
{
public:
    // typedefs

    typedef mrpt::graphslam::CRegistrationDeciderOrOptimizer<GRAPH_T> parent;
    typedef typename GRAPH_T::constraint_t constraint_t;
    typedef typename GRAPH_T::constraint_t::type_value pose_t;

    // construction

    CEdgeRegistrationDecider();

    //
methods

    virtual void getEdgesStats(std::map<std::string, int>* edge_type_to_num) const;
    virtual bool justInsertedLoopClosure() const;
    virtual void getDescriptiveReport(std::string* report_str) const;
    virtual bool updateState(mrpt::obs::CActionCollection::Ptr action, mrpt::obs::CSensoryFrame::Ptr observations, mrpt::obs::CObservation::Ptr observation) = 0;
    virtual void setWindowManagerPtr(mrpt::graphslam::CWindowManager* win_manager);
    virtual void setCriticalSectionPtr(std::mutex* graph_section);
    virtual void initializeVisuals();
    virtual void updateVisuals();
    virtual void notifyOfWindowEvents(const std::map<std::string, bool>& events_occurred);
    virtual void loadParams(const std::string& source_fname);
    virtual void printParams() const;
    virtual void setGraphPtr(typename mrpt::graphs::CNetworkOfPoses2DInf* graph);
    virtual void initializeLoggers(const std::string& name);
};

// direct descendants

template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
class CEmptyERD;

template <class GRAPH_T>
class CRangeScanEdgeRegistrationDecider;

Inherited Members

public:
    // structs

    struct TMsg;

    //
methods

    virtual void setClassName(const std::string& name);
    bool isMultiRobotSlamClass();
    std::string getClassName() const;

Typedefs

typedef mrpt::graphslam::CRegistrationDeciderOrOptimizer<GRAPH_T> parent

Handy typedefs.

Parent of current class

typedef typename GRAPH_T::constraint_t constraint_t

type of graph constraints

typedef typename GRAPH_T::constraint_t::type_value pose_t

type of underlying poses (2D/3D).

Methods

virtual void getEdgesStats(std::map<std::string, int>* edge_type_to_num) const

Fill the given map with the type of registered edges as well as the corresponding number of registration of each edge.

virtual bool justInsertedLoopClosure() const

Used by the caller to query for possible loop closures in the last edge registration procedure.

virtual void getDescriptiveReport(std::string* report_str) const

Fill the provided string with a detailed report of the decider/optimizer state.

Report should include (part of) the following:

  • Timing of important methods

  • Properties fo class at the current time

  • Logging of commands until current time

virtual bool updateState(mrpt::obs::CActionCollection::Ptr action, mrpt::obs::CSensoryFrame::Ptr observations, mrpt::obs::CObservation::Ptr observation) = 0

Generic method for fetching the incremental action-observations (or observation-only) measurements.

Returns:

True if operation was successful. Criteria for Success depend on the decider/optimizer implementing this method

virtual void setWindowManagerPtr(mrpt::graphslam::CWindowManager* win_manager)

Fetch a CWindowManager pointer.

CWindowManager instance should contain a CDisplayWindow3D* and, optionally, a CWindowObserver pointer so that interaction with the window is possible

virtual void setCriticalSectionPtr(std::mutex* graph_section)

Fetch a std::mutex for locking the GRAPH_T resource.

Handy for realising multithreading in the derived classes.

Beware that prior to the decider/optimizer public method call, the CCriticalSection will already be locked from CGraphSlamEngine_t instance, but this isn’t effective in multithreaded implementations where the decider/optimizer itself has to lock the function at which the extra thread runs.

virtual void initializeVisuals()

Initialize visual objects in CDisplayWindow (e.g.

add an object to scene).

Parameters:

std::exception

If the method is called without having first provided a CDisplayWindow3D* to the class instance

See also:

setWindowManagerPtr, updateVisuals

virtual void updateVisuals()

Update the relevant visual features in CDisplayWindow.

Parameters:

std::exception

If the method is called without having first provided a CDisplayWindow3D* to the class instance

See also:

setWindowManagerPtr, initializeVisuals

virtual void notifyOfWindowEvents(const std::map<std::string, bool>& events_occurred)

Get a list of the window events that happened since the last call.

Method in derived classes is automatically called from the CGraphSlamEngine_t instance. After that, decider/optimizer should just fetch the parameters that it is interested in.

virtual void loadParams(const std::string& source_fname)

Load the necessary for the decider/optimizer configuration parameters.

virtual void printParams() const

Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact way.

virtual void setGraphPtr(typename mrpt::graphs::CNetworkOfPoses2DInf* graph)

Fetch the graph on which the decider/optimizer will work on.

virtual void initializeLoggers(const std::string& name)

Initialize the COutputLogger, CTimeLogger instances given the name of the decider/optimizer at hand.