This class can be used to make partitions on a map/graph build from observations taken at some poses/nodes.
Definition at line 29 of file CIncrementalMapPartitioner.h.
#include <mrpt/slam/CIncrementalMapPartitioner.h>
Classes | |
struct | TOptions |
Configuration of the algorithm: More... | |
Public Member Functions | |||||
void * | operator new (size_t size) | ||||
void * | operator new[] (size_t size) | ||||
void | operator delete (void *ptr) noexcept | ||||
void | operator delete[] (void *ptr) noexcept | ||||
void | operator delete (void *memory, void *ptr) noexcept | ||||
void * | operator new (size_t size, const std::nothrow_t &) noexcept | ||||
void | operator delete (void *ptr, const std::nothrow_t &) noexcept | ||||
CIncrementalMapPartitioner () | |||||
ctor More... | |||||
virtual | ~CIncrementalMapPartitioner () | ||||
dtor More... | |||||
void | clear () | ||||
void | updatePartitions (std::vector< vector_uint > &partitions) | ||||
This method executed only the neccesary part of the partition to take into account the lastest added frames. More... | |||||
unsigned int | getNodesCount () | ||||
Get the total node count currently in the internal map/graph. More... | |||||
void | removeSetOfNodes (vector_uint indexesToRemove, bool changeCoordsRef=true) | ||||
Remove the stated nodes (0-based indexes) from the internal lists. More... | |||||
template<class MATRIX > | |||||
void | getAdjacencyMatrix (MATRIX &outMatrix) const | ||||
Return a copy of the internal adjacency matrix. More... | |||||
const mrpt::math::CMatrixDouble & | getAdjacencyMatrix () const | ||||
Return a const ref to the internal adjacency matrix. More... | |||||
const mrpt::maps::CSimpleMap * | getSequenceOfFrames () const | ||||
Read-only access to the sequence of Sensory Frames. More... | |||||
mrpt::maps::CSimpleMap * | getSequenceOfFrames () | ||||
Access to the sequence of Sensory Frames. More... | |||||
void | markAllNodesForReconsideration () | ||||
Mark all nodes for reconsideration in the next call to "updatePartitions", instead of considering just those affected by aditions of new arcs. More... | |||||
void | getAs3DScene (mrpt::opengl::CSetOfObjects::Ptr &objs, const std::map< uint32_t, int64_t > *renameIndexes=NULL) const | ||||
Return a 3D representation of the current state: poses & links between them. More... | |||||
virtual mxArray * | writeToMatlab () const | ||||
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More... | |||||
Add to the Map Frames | |||||
Add a new frame to the current graph Call this method each time a new observation is added to the map/graph, and whenever you want to update the partitions, call "updatePartitions"
| |||||
unsigned int | addMapFrame (const mrpt::obs::CSensoryFrame::Ptr &frame, const mrpt::poses::CPosePDF::Ptr &robotPose2D) | ||||
unsigned int | addMapFrame (const mrpt::obs::CSensoryFrame::Ptr &frame, const mrpt::poses::CPose3DPDF::Ptr &robotPose3D) | ||||
unsigned int | addMapFrame (const mrpt::obs::CSensoryFrame &frame, const mrpt::poses::CPose3DPDF &robotPose3D) | ||||
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 (const unsigned &newOriginPose) | ||||
The new origin is given by the index of the pose that is to become the new origin. More... | |||||
RTTI classes and functions | |||||
mrpt::utils::CObject::Ptr | duplicateGetSmartPtr () const | ||||
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More... | |||||
Static Public Member Functions | |
static void * | operator new (size_t size, void *ptr) |
Public Attributes | |
mrpt::slam::CIncrementalMapPartitioner::TOptions | options |
Protected Member Functions | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const override |
Introduces a pure virtual method responsible for writing to a CStream. More... | |
void | readFromStream (mrpt::utils::CStream &in, int version) override |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More... | |
Private Attributes | |
mrpt::maps::CSimpleMap | m_individualFrames |
std::deque< mrpt::maps::CMultiMetricMap > | m_individualMaps |
mrpt::math::CMatrixD | m_A |
Adjacency matrix. More... | |
std::vector< vector_uint > | m_last_partition |
The last partition. More... | |
bool | m_last_last_partition_are_new_ones |
This will be true after adding new observations, and before an "updatePartitions" is invoked. More... | |
std::vector< uint8_t > | m_modified_nodes |
The list of keyframes to consider in the next update. More... | |
RTTI stuff | |
using | Ptr = std::shared_ptr< CIncrementalMapPartitioner > |
using | ConstPtr = std::shared_ptr< const CIncrementalMapPartitioner > |
static mrpt::utils::CLASSINIT | _init_CIncrementalMapPartitioner |
static const mrpt::utils::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "CIncrementalMapPartitioner" |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
static const mrpt::utils::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static mrpt::utils::CObject * | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::utils::CObject * | clone () const override |
Returns a deep copy (clone) of the object, indepently of its class. More... | |
using mrpt::slam::CIncrementalMapPartitioner::ConstPtr = std::shared_ptr<const CIncrementalMapPartitioner > |
Definition at line 33 of file CIncrementalMapPartitioner.h.
using mrpt::slam::CIncrementalMapPartitioner::Ptr = std::shared_ptr< CIncrementalMapPartitioner > |
A typedef for the associated smart pointer
Definition at line 33 of file CIncrementalMapPartitioner.h.
CIncrementalMapPartitioner::CIncrementalMapPartitioner | ( | ) |
ctor
Definition at line 40 of file CIncrementalMapPartitioner.cpp.
References mrpt::utils::clear().
|
virtual |
dtor
Definition at line 56 of file CIncrementalMapPartitioner.cpp.
References mrpt::utils::clear().
|
staticprotected |
unsigned int CIncrementalMapPartitioner::addMapFrame | ( | const mrpt::obs::CSensoryFrame::Ptr & | frame, |
const mrpt::poses::CPosePDF::Ptr & | robotPose2D | ||
) |
Definition at line 142 of file CIncrementalMapPartitioner.cpp.
References MRPT_END, and MRPT_START.
Referenced by addMapFrame(), mrpt::hmtslam::CHMTSLAM::areaAbstraction(), and mrpt::slam::CRangeBearingKFSLAM::processActionObservation().
unsigned int CIncrementalMapPartitioner::addMapFrame | ( | const mrpt::obs::CSensoryFrame::Ptr & | frame, |
const mrpt::poses::CPose3DPDF::Ptr & | robotPose3D | ||
) |
Definition at line 154 of file CIncrementalMapPartitioner.cpp.
References ASSERT_, mrpt::maps::CMultiMetricMap::compute3DMatchingRatio(), mrpt::maps::CSimpleMap::get(), mrpt::maps::CSimpleMap::insert(), mrpt::maps::CLandmarksMap::TInsertionOptions::insert_Landmarks_from_range_scans, mrpt::maps::CLandmarksMap::TInsertionOptions::insert_SIFTs_from_monocular_images, mrpt::maps::CLandmarksMap::TInsertionOptions::insert_SIFTs_from_stereo_images, mrpt::maps::CLandmarksMap::insertionOptions, m_A, m_individualFrames, m_individualMaps, mrpt::maps::CMultiMetricMap::m_landmarksMap, m_last_last_partition_are_new_ones, m_last_partition, m_modified_nodes, mrpt::maps::CMultiMetricMap::m_pointsMaps, mrpt::maps::TMatchingRatioParams::maxDistForCorr, mrpt::maps::TMatchingRatioParams::maxMahaDistForCorr, mrpt::slam::CIncrementalMapPartitioner::TOptions::minDistForCorrespondence, mrpt::slam::CIncrementalMapPartitioner::TOptions::minMahaDistForCorrespondence, MRPT_END_WITH_CLEAN_UP, MRPT_START, mrpt::slam::observationsOverlap(), options, mrpt::maps::TSetOfMetricMapInitializers::push_back(), mrpt::maps::CMultiMetricMap::setListOfMaps(), mrpt::maps::CSimpleMap::size(), mrpt::maps::CMultiMetricMap::ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER >::size(), mrpt::poses::CPose3D::size(), and mrpt::slam::CIncrementalMapPartitioner::TOptions::useMapMatching.
unsigned int CIncrementalMapPartitioner::addMapFrame | ( | const mrpt::obs::CSensoryFrame & | frame, |
const mrpt::poses::CPose3DPDF & | robotPose3D | ||
) |
Definition at line 729 of file CIncrementalMapPartitioner.cpp.
References addMapFrame(), and mrpt::utils::CObject::duplicateGetSmartPtr().
void CIncrementalMapPartitioner::changeCoordinatesOrigin | ( | const mrpt::poses::CPose3D & | newOrigin | ) |
Definition at line 591 of file CIncrementalMapPartitioner.cpp.
References mrpt::maps::CSimpleMap::changeCoordinatesOrigin(), and m_individualFrames.
Referenced by changeCoordinatesOriginPoseIndex().
void CIncrementalMapPartitioner::changeCoordinatesOriginPoseIndex | ( | const unsigned & | newOriginPose | ) |
The new origin is given by the index of the pose that is to become the new origin.
Definition at line 600 of file CIncrementalMapPartitioner.cpp.
References changeCoordinatesOrigin(), mrpt::maps::CSimpleMap::get(), m_individualFrames, MRPT_END, and MRPT_START.
void CIncrementalMapPartitioner::clear | ( | ) |
Definition at line 121 of file CIncrementalMapPartitioner.cpp.
References mrpt::maps::CSimpleMap::clear(), m_A, m_individualFrames, m_individualMaps, m_last_last_partition_are_new_ones, m_last_partition, and m_modified_nodes.
Referenced by mrpt::slam::CRangeBearingKFSLAM::reset().
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlinestatic |
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
static |
|
inline |
Return a copy of the internal adjacency matrix.
Definition at line 147 of file CIncrementalMapPartitioner.h.
References m_A.
Referenced by mrpt::hmtslam::CHMTSLAM::generateLogFiles().
|
inline |
Return a const ref to the internal adjacency matrix.
Definition at line 153 of file CIncrementalMapPartitioner.h.
References m_A.
void CIncrementalMapPartitioner::getAs3DScene | ( | mrpt::opengl::CSetOfObjects::Ptr & | objs, |
const std::map< uint32_t, int64_t > * | renameIndexes = NULL |
||
) | const |
Return a 3D representation of the current state: poses & links between them.
The previous contents of "objs" will be discarded
Definition at line 619 of file CIncrementalMapPartitioner.cpp.
References ASSERT_, mrpt::format(), mrpt::maps::CSimpleMap::get(), m_A, m_individualFrames, mrpt::maps::CSimpleMap::size(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().
Referenced by mrpt::hmtslam::CHMTSLAM::generateLogFiles().
unsigned int CIncrementalMapPartitioner::getNodesCount | ( | ) |
Get the total node count currently in the internal map/graph.
Definition at line 481 of file CIncrementalMapPartitioner.cpp.
References m_individualFrames, and mrpt::maps::CSimpleMap::size().
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::utils::CSerializable.
|
static |
|
inline |
Read-only access to the sequence of Sensory Frames.
Definition at line 157 of file CIncrementalMapPartitioner.h.
References m_individualFrames.
|
inline |
Access to the sequence of Sensory Frames.
Definition at line 165 of file CIncrementalMapPartitioner.h.
References m_individualFrames.
void CIncrementalMapPartitioner::markAllNodesForReconsideration | ( | ) |
Mark all nodes for reconsideration in the next call to "updatePartitions", instead of considering just those affected by aditions of new arcs.
Definition at line 578 of file CIncrementalMapPartitioner.cpp.
References m_last_last_partition_are_new_ones, m_last_partition, and m_modified_nodes.
Referenced by mrpt::hmtslam::CHMTSLAM::areaAbstraction(), and mrpt::slam::CRangeBearingKFSLAM::reconsiderPartitionsNow().
|
inlinenoexcept |
Definition at line 33 of file CIncrementalMapPartitioner.h.
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
inlinenoexcept |
Definition at line 33 of file CIncrementalMapPartitioner.h.
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
inline |
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
inlinenoexcept |
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
inlinestatic |
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
inline |
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
overrideprotectedvirtual |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any error, see CStream::ReadBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 692 of file CIncrementalMapPartitioner.cpp.
References m_A, m_individualFrames, m_individualMaps, m_last_last_partition_are_new_ones, m_last_partition, m_modified_nodes, and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.
void CIncrementalMapPartitioner::removeSetOfNodes | ( | vector_uint | indexesToRemove, |
bool | changeCoordsRef = true |
||
) |
Remove the stated nodes (0-based indexes) from the internal lists.
If changeCoordsRef is true, coordinates are changed to leave the first node at (0,0,0).
Definition at line 489 of file CIncrementalMapPartitioner.cpp.
References ASSERT_, mrpt::maps::CSimpleMap::changeCoordinatesOrigin(), mrpt::maps::CSimpleMap::get(), m_A, m_individualFrames, m_individualMaps, m_last_last_partition_are_new_ones, m_last_partition, m_modified_nodes, MRPT_END, MRPT_START, mrpt::maps::CSimpleMap::remove(), and mrpt::maps::CSimpleMap::size().
void CIncrementalMapPartitioner::updatePartitions | ( | std::vector< vector_uint > & | partitions | ) |
This method executed only the neccesary part of the partition to take into account the lastest added frames.
Definition at line 369 of file CIncrementalMapPartitioner.cpp.
References mrpt::slam::CIncrementalMapPartitioner::TOptions::forceBisectionOnly, m_A, m_last_last_partition_are_new_ones, m_last_partition, m_modified_nodes, mrpt::slam::CIncrementalMapPartitioner::TOptions::minimumNumberElementsEachCluster, MRPT_END, MRPT_START, options, and mrpt::slam::CIncrementalMapPartitioner::TOptions::partitionThreshold.
Referenced by mrpt::hmtslam::CHMTSLAM::areaAbstraction(), mrpt::slam::CRangeBearingKFSLAM::processActionObservation(), and mrpt::slam::CRangeBearingKFSLAM::reconsiderPartitionsNow().
|
inlinevirtualinherited |
Introduces a pure virtual method responsible for writing to a mxArray
Matlab object, typically a MATLAB struct
whose contents are documented in each derived class.
mxArray
(caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB. Definition at line 89 of file CSerializable.h.
|
overrideprotectedvirtual |
Introduces a pure virtual method responsible for writing to a CStream.
This can not be used directly be users, instead use "stream << object;" for writing it to a stream.
out | The output binary stream where object must be dumped. |
getVersion | If nullptr, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data. |
std::exception | On any error, see CStream::WriteBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 714 of file CIncrementalMapPartitioner.cpp.
References m_A, m_individualFrames, m_individualMaps, m_last_last_partition_are_new_ones, m_last_partition, and m_modified_nodes.
|
staticprotected |
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
static |
Definition at line 33 of file CIncrementalMapPartitioner.h.
|
private |
Adjacency matrix.
Definition at line 202 of file CIncrementalMapPartitioner.h.
Referenced by addMapFrame(), clear(), getAdjacencyMatrix(), getAs3DScene(), readFromStream(), removeSetOfNodes(), updatePartitions(), and writeToStream().
|
private |
Definition at line 198 of file CIncrementalMapPartitioner.h.
Referenced by addMapFrame(), changeCoordinatesOrigin(), changeCoordinatesOriginPoseIndex(), clear(), getAs3DScene(), getNodesCount(), getSequenceOfFrames(), readFromStream(), removeSetOfNodes(), and writeToStream().
|
private |
Definition at line 199 of file CIncrementalMapPartitioner.h.
Referenced by addMapFrame(), clear(), readFromStream(), removeSetOfNodes(), and writeToStream().
|
private |
This will be true after adding new observations, and before an "updatePartitions" is invoked.
Definition at line 209 of file CIncrementalMapPartitioner.h.
Referenced by addMapFrame(), clear(), markAllNodesForReconsideration(), readFromStream(), removeSetOfNodes(), updatePartitions(), and writeToStream().
|
private |
The last partition.
Definition at line 205 of file CIncrementalMapPartitioner.h.
Referenced by addMapFrame(), clear(), markAllNodesForReconsideration(), readFromStream(), removeSetOfNodes(), updatePartitions(), and writeToStream().
|
private |
The list of keyframes to consider in the next update.
Definition at line 212 of file CIncrementalMapPartitioner.h.
Referenced by addMapFrame(), clear(), markAllNodesForReconsideration(), readFromStream(), removeSetOfNodes(), updatePartitions(), and writeToStream().
mrpt::slam::CIncrementalMapPartitioner::TOptions mrpt::slam::CIncrementalMapPartitioner::options |
|
staticprotected |
Definition at line 33 of file CIncrementalMapPartitioner.h.
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019 |