class mrpt::slam::CIncrementalMapPartitioner

Finds partitions in metric maps based on N-cut graph partition theory.

#include <mrpt/slam/CIncrementalMapPartitioner.h>

class CIncrementalMapPartitioner:
    public mrpt::system::COutputLogger,
    public mrpt::serialization::CSerializable
{
public:
    // structs

    struct TOptions;

    //
fields

    TOptions options;

    //
methods

    void clear();
    uint32_t addMapFrame(const mrpt::obs::CSensoryFrame& frame, const mrpt::poses::CPose3DPDF& robotPose3D);
    void updatePartitions(std::vector<std::vector<uint32_t>>& partitions);
    size_t getNodesCount();
    void removeSetOfNodes(std::vector<uint32_t> indexesToRemove, bool changeCoordsRef = true);
    void changeCoordinatesOrigin(const mrpt::poses::CPose3D& newOrigin);
    void changeCoordinatesOriginPoseIndex(unsigned int newOriginPose);
    void setSimilarityMethod(similarity_method_t method);
    void setSimilarityMethod(similarity_func_t func);
    void getAs3DScene(mrpt::opengl::CSetOfObjects::Ptr& objs, const std::map<uint32_t, int64_t>* renameIndexes = nullptr) const;

    template <class MATRIX>
    void getAdjacencyMatrix(MATRIX& outMatrix) const;

    const mrpt::math::CMatrixDouble& getAdjacencyMatrix() const;
    const mrpt::maps::CSimpleMap* getSequenceOfFrames() const;
    mrpt::maps::CSimpleMap* getSequenceOfFrames();
};

Inherited Members

public:
    // structs

    struct TMsg;

Fields

TOptions options

Algorithm parameters.

Methods

uint32_t addMapFrame(const mrpt::obs::CSensoryFrame& frame, const mrpt::poses::CPose3DPDF& robotPose3D)

Insert a new keyframe to the graph.

Call this method each time a new observation is added to the map/graph. Afterwards, call updatePartitions() to get the updated partitions.

Parameters:

frame

The sensed data

robotPose

An estimation of the robot global pose.

Returns:

The index of the new pose in the graph, which can be used to refer to this pose in the future.

See also:

updatePartitions

void updatePartitions(std::vector<std::vector<uint32_t>>& partitions)

Recalculate the map/graph partitions.

See also:

addMapFrame()

size_t getNodesCount()

Get the total node count currently in the internal map/graph.

void removeSetOfNodes(
    std::vector<uint32_t> indexesToRemove,
    bool changeCoordsRef = true
    )

Remove a list of keyframes, with indices as returned by addMapFrame()

Parameters:

changeCoordsRef

If true, coordinates are changed to leave the first node at (0,0,0).

void changeCoordinatesOriginPoseIndex(unsigned int newOriginPose)

The new origin is given by the index of the pose that is to become the new origin.

void setSimilarityMethod(similarity_method_t method)

Select the similarity method to use for newly inserted keyframes.

void setSimilarityMethod(similarity_func_t func)

Sets a custom function for the similarity of new keyframes.

void getAs3DScene(
    mrpt::opengl::CSetOfObjects::Ptr& objs,
    const std::map<uint32_t, int64_t>* renameIndexes = nullptr
    ) const

Return a 3D representation of the graph: poses & links between them.

The previous contents of “objs” will be discarded

template <class MATRIX>
void getAdjacencyMatrix(MATRIX& outMatrix) const

Return a copy of the adjacency matrix.

const mrpt::math::CMatrixDouble& getAdjacencyMatrix() const

Return a const ref to the internal adjacency matrix.

const mrpt::maps::CSimpleMap* getSequenceOfFrames() const

Read-only access to the sequence of Sensory Frames.

mrpt::maps::CSimpleMap* getSequenceOfFrames()

Access to the sequence of Sensory Frames.