Template Struct TUserOptionsChecker
Defined in File TUserOptionsChecker.h
Struct Documentation
-
template<class GRAPH_t>
struct TUserOptionsChecker Class containing the declarations of supplementary methods that can be used in application-related code. Class instance can be handy for adding keeping the available deciders/optimizers in a compact manner and for verifying whether a given decider can be used.
handy typedefs for the creation of deciders/optimzer instances from
the corresponding strings
-
using node_regs_t = std::map<std::string, mrpt::graphslam::deciders::CNodeRegistrationDecider<GRAPH_t> *(*)()>
-
using edge_regs_t = std::map<std::string, mrpt::graphslam::deciders::CEdgeRegistrationDecider<GRAPH_t> *(*)()>
-
using optimizers_t = std::map<std::string, mrpt::graphslam::optimizers::CGraphSlamOptimizer<GRAPH_t> *(*)()>
Mappings from registration decider/optimizer names to functors
}
for creating instances of the corresponding classes
-
node_regs_t node_regs_map
-
edge_regs_t edge_regs_map
-
optimizers_t optimizers_map
Vectors containing descriptions about the available
deciders/optimizers.
Handy for displaying information to the user (e.g. in help text)
-
std::vector<TRegistrationDeciderProps*> regs_descriptions
-
std::vector<TOptimizerProps*> optimizers_descriptions
Methods for initializing decider/optimizer instances based on the
user command line choices - http://stackoverflow.com/a/582456/2843583
Warning
Caller is responsible for deleting the initialized instances
-
template<class T>
static inline mrpt::graphslam::deciders::CNodeRegistrationDecider<GRAPH_t> *createNodeRegistrationDecider()
-
template<class T>
static inline mrpt::graphslam::deciders::CEdgeRegistrationDecider<GRAPH_t> *createEdgeRegistrationDecider()
-
template<class T>
static inline mrpt::graphslam::optimizers::CGraphSlamOptimizer<GRAPH_t> *createGraphSlamOptimizer()
Public Functions
-
TUserOptionsChecker()
Constructor.
-
virtual ~TUserOptionsChecker()
Destructor.
-
virtual void createDeciderOptimizerMappings()
Create the necessary mappings from strings to the corresponding instance creation functors.
Method is used for populating a map from string to instance creation function. The decider/optimzer can then be spawned according to the user selection.
-
virtual void _createDeciderOptimizerMappings()
-
virtual void populateDeciderOptimizerProperties()
Populate the available decider, optimizer classes available in user applications.
-
virtual bool checkRegistrationDeciderExists(std::string given_reg, std::string reg_type) const
Check if the given registrator decider exists in the vector of deciders.
- Parameters:
given_reg – [in] String specifying the type of decider - This should either be “node” or “edge”
- Returns:
True if it exists, false otherwise
-
virtual bool checkOptimizerExists(std::string given_opt) const
Check if the given optimizer exists in the vector of optimizers.
- Returns:
True if it exists, false otherwise
-
virtual void dumpRegistrarsToConsole(std::string reg_type = "all") const
Print the registration deciders vector in a formatted manner to the standard output.
- Parameters:
reg_type – [in] Method prints both the node registration and edge registration deciders of the given vector unless specified otherwise. The available argument options are “node”, “edge”, “all”
-
virtual void dumpOptimizersToConsole() const
Print the optimizers vector in a formatted manner to the standard output.
-
void _createDeciderOptimizerMappings()
-
void _createDeciderOptimizerMappings()
-
void _createDeciderOptimizerMappings()
-
using node_regs_t = std::map<std::string, mrpt::graphslam::deciders::CNodeRegistrationDecider<GRAPH_t> *(*)()>