class mrpt::hmtslam::CHierarchicalMHMap

The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model.

This class is used within the HMT-SLAM implementation in CHMTSLAM.

See also:

CHMTSLAM, CHMHMapArc, CHMHMapNode, CHierarchicalMHMapPartition

#include <mrpt/hmtslam/CHierarchicalMHMap.h>

class CHierarchicalMHMap:
    public mrpt::serialization::CSerializable,
    public mrpt::hmtslam::CHierarchicalMapMHPartition
{
public:
    // typedefs

    typedef TNodeList::iterator iterator;
    typedef TNodeList::const_iterator const_iterator;

    // construction

    CHierarchicalMHMap();

    //
methods

    void dumpAsXMLfile(std::string fileName) const;
    void loadFromXMLfile(std::string fileName);
    void clear();
};

Inherited Members

public:
    // typedefs

    typedef std::vector<CHMHMapNode::TNodeID> TNodeIDsList;

    // structs

    struct TMsg;

    //
methods

    const_iterator begin() const;
    iterator begin();
    const_iterator end() const;
    iterator end();
    size_t nodeCount() const;
    size_t arcCount() const;
    CHMHMapNode::Ptr getFirstNode();
    CHMHMapNode::Ptr getNodeByID(CHMHMapNode::TNodeID id);
    const CHMHMapNode::Ptr getNodeByID(CHMHMapNode::TNodeID id) const;
    CHMHMapNode::Ptr getNodeByLabel(const std::string& label, const THypothesisID& hypothesisID);
    const CHMHMapNode::Ptr getNodeByLabel(const std::string& label, const THypothesisID& hypothesisID) const;
    void saveAreasDiagramForMATLAB(const std::string& filName, const CHMHMapNode::TNodeID& idReferenceNode, const THypothesisID& hypothesisID) const;

    void saveAreasDiagramWithEllipsedForMATLAB(
        const std::string& filName,
        const CHMHMapNode::TNodeID& idReferenceNode,
        const THypothesisID& hypothesisID,
        float uncertaintyExagerationFactor = 1.0f,
        bool drawArcs = false,
        unsigned int numberOfIterationsForOptimalGlobalPoses = 4
        ) const;

    void saveGlobalMapForMATLAB(const std::string& filName, const THypothesisID& hypothesisID, const CHMHMapNode::TNodeID& idReferenceNode) const;

    void findPathBetweenNodes(
        const CHMHMapNode::TNodeID& nodeFrom,
        const CHMHMapNode::TNodeID& nodeTo,
        const THypothesisID& hypothesisID,
        TArcList& out_path,
        bool direction = false
        ) const;

    void computeCoordinatesTransformationBetweenNodes(
        const CHMHMapNode::TNodeID& nodeFrom,
        const CHMHMapNode::TNodeID& nodeTo,
        mrpt::poses::CPose3DPDFParticles& posePDF,
        const THypothesisID& hypothesisID,
        unsigned int particlesCount = 100,
        float additionalNoiseXYratio = 0.02,
        float additionalNoisePhiRad = mrpt::DEG2RAD(0.1)
        ) const;

    float computeMatchProbabilityBetweenNodes(
        const CHMHMapNode::TNodeID& nodeFrom,
        const CHMHMapNode::TNodeID& nodeTo,
        float& maxMatchProb,
        mrpt::poses::CPose3DPDFSOG& estimatedRelativePose,
        const THypothesisID& hypothesisID,
        unsigned int monteCarloSamplesPose = 300
        );

    void findArcsBetweenNodes(const CHMHMapNode::TNodeID& node1, const CHMHMapNode::TNodeID& node2, const THypothesisID& hypothesisID, TArcList& out_listArcs) const;

    void findArcsOfTypeBetweenNodes(
        const CHMHMapNode::TNodeID& node1id,
        const CHMHMapNode::TNodeID& node2id,
        const THypothesisID& hypothesisID,
        const std::string& arcType,
        TArcList& ret
        ) const;

    CHMHMapArc::Ptr findArcOfTypeBetweenNodes(
        const CHMHMapNode::TNodeID& node1id,
        const CHMHMapNode::TNodeID& node2id,
        const THypothesisID& hypothesisID,
        const std::string& arcType,
        bool& isInverted
        ) const;

    bool areNodesNeightbour(
        const CHMHMapNode::TNodeID& node1,
        const CHMHMapNode::TNodeID& node2,
        const THypothesisID& hypothesisID,
        const char* requiredAnnotation = nullptr
        ) const;

    void computeGloballyConsistentNodeCoordinates(
        std::map<CHMHMapNode::TNodeID, mrpt::poses::CPose3DPDFGaussian>& nodePoses,
        const CHMHMapNode::TNodeID& idReferenceNode,
        const THypothesisID& hypothesisID,
        const unsigned int& numberOfIterations = 2
        ) const;

    void getAs3DScene(
        mrpt::opengl::COpenGLScene& outScene,
        const CHMHMapNode::TNodeID& idReferenceNode,
        const THypothesisID& hypothesisID,
        const unsigned int& numberOfIterationsForOptimalGlobalPoses = 5,
        bool showRobotPoseIDs = true
        ) const;

    void dumpAsText(std::vector<std::string>& s) const;

    double computeOverlapProbabilityBetweenNodes(
        const CHMHMapNode::TNodeID& nodeFrom,
        const CHMHMapNode::TNodeID& nodeTo,
        const THypothesisID& hypothesisID,
        size_t monteCarloSamples = 100,
        const float margin_to_substract = 6
        ) const;

Construction

CHierarchicalMHMap()

Default constructor.

Methods

void dumpAsXMLfile(std::string fileName) const

Destructor.

Save the whole graph as a XML file

void loadFromXMLfile(std::string fileName)

Load a graph from a XML file.

void clear()

Erase all the contents of map (It delete all nodes/arcs objects)