template struct mrpt::graphslam::TUncertaintyPath

Holds the data of an information path.

Path comprises of nodes (TNodeID type) and constraints between them. Only consecutive nodes are connected by edges, thus path.

See also:

mrpt::deciders::CLoopCloserERD

#include <mrpt/graphslam/misc/TUncertaintyPath.h>

template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
struct TUncertaintyPath: public mrpt::config::CLoadableOptions
{
    // typedefs

    typedef typename GRAPH_T::constraint_t constraint_t;
    typedef typename constraint_t::type_value pose_t;
    typedef TUncertaintyPath<GRAPH_T> self_t;

    //
fields

    bool determinant_is_updated;
    double determinant_cached;
    std::vector<mrpt::graphs::TNodeID> nodes_traversed;
    constraint_t curr_pose_pdf;

    // construction

    TUncertaintyPath();
    TUncertaintyPath(const mrpt::graphs::TNodeID& starting_node);

    TUncertaintyPath(
        const mrpt::graphs::TNodeID& starting_node,
        const mrpt::graphs::TNodeID& ending_node,
        const constraint_t& edge
        );

    //
methods

    void clear();
    bool isEmpty() const;
    void assertIsBetweenNodeIDs(const mrpt::graphs::TNodeID& from, const mrpt::graphs::TNodeID& to) const;
    virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase& source, const std::string& section);
    virtual void dumpToTextStream(std::ostream& out) const;
    std::string getAsString() const;
    void getAsString(std::string* str) const;
    const mrpt::graphs::TNodeID& getSource() const;
    const mrpt::graphs::TNodeID& getDestination() const;
    double getDeterminant();
    bool hasLowerUncertaintyThan(const self_t& other) const;
    void addToPath(const mrpt::graphs::TNodeID& node, const constraint_t& edge);
    self_t& operator += (const self_t& other);
    bool operator == (const self_t& other) const;
    bool operator != (const self_t& other) const;
};

Inherited Members

public:
    //
methods

    virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase& source, const std::string& section) = 0;
    void loadFromConfigFileName(const std::string& config_file, const std::string& section);
    virtual void saveToConfigFile(mrpt::config::CConfigFileBase& target, const std::string& section) const;
    void saveToConfigFileName(const std::string& config_file, const std::string& section) const;
    void dumpToConsole() const;
    virtual void dumpToTextStream(std::ostream& out) const;

Fields

bool determinant_is_updated

Determine whether the determinant of the Path is up-to-date and can be directly fetched or has to be computed again.

std::vector<mrpt::graphs::TNodeID> nodes_traversed

Nodes that the Path comprises of.

Nodes in the path are added to the end of the vector.

constraint_t curr_pose_pdf

Current path position + corresponding covariance.

Methods

void assertIsBetweenNodeIDs(const mrpt::graphs::TNodeID& from, const mrpt::graphs::TNodeID& to) const

Assert that the current path is between the given nodeIDs.

Call to this method practically checks if the give nodes match the source and destination nodeIDs.

Assertions will be executed only in Debug builds

Parameters:

std::runtime_error

in case the conditions don’t hold

virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase& source, const std::string& section)

This method load the options from a “.ini”-like file or memory-stored string list.

Only those parameters found in the given “section” and having the same name that the variable are loaded. Those not found in the file will stay with their previous values (usually the default values loaded at initialization). An example of an “.ini” file:

[section]
resolution    = 0.10   // blah blah...
modeSelection = 1      // 0=blah, 1=blah,...

See also:

loadFromConfigFileName, saveToConfigFile

virtual void dumpToTextStream(std::ostream& out) const

This method should clearly display all the contents of the structure in textual form, sending it to a std::ostream.

The default implementation in this base class relies on saveToConfigFile() to generate a plain text representation of all the parameters.

const mrpt::graphs::TNodeID& getSource() const

Return the source node of this path.

const mrpt::graphs::TNodeID& getDestination() const

Return the Destination node of this path.

bool hasLowerUncertaintyThan(const self_t& other) const

Test if the current path has a lower uncertainty than the other path.

Returns:

True if the current path does have a lower uncertainty

void addToPath(const mrpt::graphs::TNodeID& node, const constraint_t& edge)

add a new link in the current path.

Add the node that the path traverses and the information matrix of the extra link