class mrpt::hmtslam::CHMHMapNode

A class for representing a node in a hierarchical, multi-hypothesis map.

The node itself will be considered only if some given hypothesisID matchs its own ID. Create objects by invoking the class factory “::Create”

See also:

CHierarchicalMHMap, CHMHMapArc

#include <mrpt/hmtslam/CHMHMapNode.h>

class CHMHMapNode: public mrpt::serialization::CSerializable
{
public:
    // typedefs

    typedef mrpt::graphs::TNodeID TNodeID;

    //
fields

    THypothesisIDSet m_hypotheses;
    CMHPropertiesValuesList m_annotations;
    std::string m_nodeType;
    std::string m_label;

    // construction

    CHMHMapNode(CHierarchicalMHMap* parent = nullptr, const THypothesisIDSet& hyps = THypothesisIDSet());

    //
methods

    TNodeID getID() const;
    unsigned int getLevelInTheHierarchy();
    unsigned int getRelatedArcsCount();
    void getArcs(TArcList& out) const;
    void getArcs(TArcList& out, const THypothesisID& hyp_id) const;
    void getArcs(TArcList& out, const char* arcType, const THypothesisID& hyp_id) const;
    bool isNeighbor(const TNodeID& otherArea, const THypothesisID& hyp_id) const;
};

Typedefs

typedef mrpt::graphs::TNodeID TNodeID

The type of the IDs of nodes.

Fields

THypothesisIDSet m_hypotheses

The hypothesis IDs under which this node exists.

CMHPropertiesValuesList m_annotations

The annotations of the node, see the general description of the class for possible properties and values.

std::string m_nodeType

The type of the node, the possibilities are:

  • Place

  • Area

  • TopologicalMap

  • Object

std::string m_label

The label of the node, only for display it to the user.

Construction

CHMHMapNode(CHierarchicalMHMap* parent = nullptr, const THypothesisIDSet& hyps = THypothesisIDSet())

Constructor.

Methods

TNodeID getID() const

Reads the ID of the node (read-only property)

unsigned int getLevelInTheHierarchy()

Returns the level of this node in the hierarchy of arcs “arcType_Belongs”, where level=0 is the ground level, 1=its parents, etc.

unsigned int getRelatedArcsCount()

Returns the number of arcs starting from/ending into this node.

void getArcs(TArcList& out) const

Returns a list with the arcs from/to this node.

void getArcs(TArcList& out, const THypothesisID& hyp_id) const

Returns a list with the arcs from/to this node existing in a given hypothesis ID.

void getArcs(TArcList& out, const char* arcType, const THypothesisID& hyp_id) const

Returns a list with the arcs from/to this node existing in a given hypothesis ID and of a given type.

bool isNeighbor(const TNodeID& otherArea, const THypothesisID& hyp_id) const

Check whether an arc exists towards the given area.