Template Class CRegistrationDeciderOrOptimizer

Inheritance Relationships

Base Type

  • public mrpt::system::COutputLogger

Derived Types

Class Documentation

template<class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
class CRegistrationDeciderOrOptimizer : public mrpt::system::COutputLogger

Interface for implementing node/edge registration deciders or optimizer classes.

Specific interfaces - for implementing node/edge deciders / optimizers - can inherit from CRegistrationDeciderOrOptimizer so that they can make use of the generic methods defined in the latter.

Note

Convention: For the already implemented deciders/optimizers the following naming convention has been used:

  • NRD: Node Registration Decider class

  • ERD: Edge Registration Decider class

  • GSO: GraphSlam Optimizer class

Subclassed by mrpt::graphslam::deciders::CEdgeRegistrationDecider< mrpt::graphs::CNetworkOfPoses2DInf >, mrpt::graphslam::deciders::CNodeRegistrationDecider< mrpt::graphs::CNetworkOfPoses2DInf >, mrpt::graphslam::optimizers::CGraphSlamOptimizer< mrpt::graphs::CNetworkOfPoses2DInf >

mrpt::graphslam::CWindowManager *m_win_manager = nullptr

Pointer to the CWindowManager object used to store visuals-related instances.

mrpt::gui::CDisplayWindow3D *m_win = nullptr

Window to use.

mrpt::graphslam::CWindowObserver *m_win_observer = nullptr

CWindowObserver object for monitoring various visual-oriented events.

bool m_initialized_visuals = false

Public Functions

CRegistrationDeciderOrOptimizer() = default
~CRegistrationDeciderOrOptimizer() override = default
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.

Warning

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).

Throws:

std::exception – If the method is called without having first provided a CDisplayWindow3D* to the class instance

virtual void updateVisuals()

Update the relevant visual features in CDisplayWindow.

Throws:

std::exception – If the method is called without having first provided a CDisplayWindow3D* to the class instance

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 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 void setGraphPtr(GRAPH_T *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.

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

Protected Functions

virtual void assertVisualsVars()

Handy function for making all the visuals assertions in a compact manner.

Protected Attributes

GRAPH_T *m_graph = nullptr

Pointer to the graph that is under construction.

std::mutex *m_graph_section = nullptr
mrpt::system::CTimeLogger m_time_logger

Time logger instance.

std::string m_class_name = "CRegistrationDeciderOrOptimizer"

Name of the class instance.

bool is_mr_slam_class = false

Boolean indicating if the current class can be used in multi-robot SLAM operations.