class mrpt::slam::CIncrementalMapPartitioner

Overview

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:
    // typedefs

    typedef std::shared_ptr<mrpt::slam ::CIncrementalMapPartitioner> Ptr;
    typedef std::shared_ptr<const mrpt::slam ::CIncrementalMapPartitioner> ConstPtr;
    typedef std::unique_ptr<mrpt::slam ::CIncrementalMapPartitioner> UniquePtr;
    typedef std::unique_ptr<const mrpt::slam ::CIncrementalMapPartitioner> ConstUniquePtr;

    // structs

    struct TOptions;

    // fields

    static constexpr const char* className = "mrpt::slam" "::" "CIncrementalMapPartitioner";
    TOptions options;

    // construction

    CIncrementalMapPartitioner();

    // methods

    static constexpr auto getClassName();
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    static std::shared_ptr<CObject> CreateObject();

    template <typename... Args>
    static Ptr Create(Args&&... args);

    template <typename Alloc, typename... Args>
    static Ptr CreateAlloc(
        const Alloc& alloc,
        Args&&... args
        );

    template <typename... Args>
    static UniquePtr CreateUnique(Args&&... args);

    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    virtual mrpt::rtti::CObject* clone() const;
    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::viz::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:
    // typedefs

    typedef std::shared_ptr<CObject> Ptr;
    typedef std::shared_ptr<const CObject> ConstPtr;
    typedef std::shared_ptr<CSerializable> Ptr;
    typedef std::shared_ptr<const CSerializable> ConstPtr;

    // structs

    struct TMsg;

    // methods

    COutputLogger& operator = (const COutputLogger&);
    COutputLogger& operator = (COutputLogger&&);
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();

Typedefs

typedef std::shared_ptr<mrpt::slam ::CIncrementalMapPartitioner> Ptr

A type for the associated smart pointer.

Fields

TOptions options

Algorithm parameters.

Construction

CIncrementalMapPartitioner()

ctor

Methods

virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const

Returns information about the class of an object in runtime.

virtual mrpt::rtti::CObject* clone() const

Returns a deep copy (clone) of the object, indepently of its class.

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::viz::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.