Class CIncrementalMapPartitioner

Nested Relationships

Nested Types

Inheritance Relationships

Base Types

  • public mrpt::system::COutputLogger

  • public mrpt::serialization::CSerializable

Class Documentation

class CIncrementalMapPartitioner : public mrpt::system::COutputLogger, public mrpt::serialization::CSerializable

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

Main map partition API

TOptions options

Algorithm parameters

void clear()
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.

See also

updatePartitions

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.

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).

Change Coordinates System

Change the coordinate origin of all stored poses

Used for consistency with future new poses to enter in the system.

void changeCoordinatesOrigin(const mrpt::poses::CPose3D &newOrigin)
void changeCoordinatesOriginPoseIndex(unsigned int newOriginPose)

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

inline void setSimilarityMethod(similarity_method_t method)

Select the similarity method to use for newly inserted keyframes

inline void setSimilarityMethod(similarity_func_t func)

Sets a custom function for the similarity of new keyframes

Access API to internal graph data

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>
inline void getAdjacencyMatrix(MATRIX &outMatrix) const

Return a copy of the adjacency matrix.

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

Return a const ref to the internal adjacency matrix.

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

Read-only access to the sequence of Sensory Frames

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

Access to the sequence of Sensory Frames

Public Functions

inline CIncrementalMapPartitioner()

ctor

struct TOptions : public mrpt::config::CLoadableOptions

Configuration parameters

Public Functions

void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section) override
void saveToConfigFile(mrpt::config::CConfigFileBase &target, const std::string &section) const override
TOptions()

Public Members

double partitionThreshold = {1.0}

!< N-cut partition threshold [0,2] (default=1)

mrpt::maps::TMatchingRatioParams mrp

These parameters are loaded/saved to config files with the prefix “mrp.{param_name}”

bool forceBisectionOnly = {false}
similarity_method_t simil_method = {smMETRIC_MAP_MATCHING}

Defines the method for determining the adjacency matrix values.

uint64_t minimumNumberElementsEachCluster = {1}

If a partition leads to a cluster with less elements than this, it will be rejected even if had a good Ncut (default=1).

mrpt::maps::TSetOfMetricMapInitializers metricmap

Type and parameters of metric map(s) to build for each keyframe. Parameters can be loaded from a config file from sections with the prefix of this “TOptions” section + “.metricmap”. Default: a CSimplePointsMap

uint64_t maxKeyFrameDistanceToEval = {std::numeric_limits<uint64_t>::max()}

Maximum distance, in KF identifier numbers, to check for similarity. Default=Infinite. Can be used to constraint the wrong detection of clusters after loop closures but before correcting global poses.