This class stores a sequence of <Probabilistic Pose,SensoryFrame> pairs, thus a "metric map" can be totally determined with this information.
The pose of the sensory frame is not deterministic, but described by some PDF. Full 6D poses are used.
Definition at line 34 of file maps/CSimpleMap.h.
#include <mrpt/maps/CSimpleMap.h>
Public Member Functions | |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *ptr) throw () |
void | operator delete[] (void *ptr) throw () |
void | operator delete (void *memory, void *ptr) throw () |
void * | operator new (size_t size, const std::nothrow_t &) throw () |
void | operator delete (void *ptr, const std::nothrow_t &) throw () |
CSimpleMap () | |
Default constructor (empty map) More... | |
CSimpleMap (const CSimpleMap &o) | |
Copy constructor. More... | |
virtual | ~CSimpleMap () |
Destructor: More... | |
CSimpleMap & | operator= (const CSimpleMap &o) |
Copy. 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... | |
CObject * | clone () const |
Cloning interface for smart pointers. More... | |
Map access and modification | |
bool | saveToFile (const std::string &filName) const |
Save this object to a .simplemap binary file (compressed with gzip) More... | |
bool | loadFromFile (const std::string &filName) |
Load the contents of this object from a .simplemap binary file (possibly compressed with gzip) More... | |
size_t | size () const |
Returns the count of pairs (pose,sensory data) More... | |
bool | empty () const |
Returns size()!=0. More... | |
void | get (size_t index, mrpt::poses::CPose3DPDFPtr &out_posePDF, mrpt::obs::CSensoryFramePtr &out_SF) const |
Access to the i'th pair, first one is index '0'. More... | |
void | set (size_t index, const mrpt::poses::CPose3DPDFPtr &in_posePDF, const mrpt::obs::CSensoryFramePtr &in_SF) |
Changes the i'th pair, first one is index '0'. More... | |
void | set (size_t index, const mrpt::poses::CPosePDFPtr &in_posePDF, const mrpt::obs::CSensoryFramePtr &in_SF) |
Changes the i'th pair, first one is index '0'. More... | |
void | remove (size_t index) |
Deletes the i'th pair, first one is index '0'. More... | |
void | insert (const mrpt::poses::CPose3DPDF *in_posePDF, const mrpt::obs::CSensoryFrame &in_SF) |
Add a new pair to the sequence. More... | |
void | insert (const mrpt::poses::CPose3DPDF *in_posePDF, const mrpt::obs::CSensoryFramePtr &in_SF) |
Add a new pair to the sequence, making a copy of the smart pointer (it's not made unique). More... | |
void | insert (const mrpt::poses::CPose3DPDFPtr &in_posePDF, const mrpt::obs::CSensoryFramePtr &in_SF) |
Add a new pair to the sequence, making a copy of the smart pointer (it's not made unique). More... | |
void | insert (const mrpt::poses::CPosePDFPtr &in_posePDF, const mrpt::obs::CSensoryFramePtr &in_SF) |
Add a new pair to the sequence. More... | |
void | insert (const mrpt::poses::CPosePDF *in_posePDF, const mrpt::obs::CSensoryFrame &in_SF) |
Add a new pair to the sequence. More... | |
void | insert (const mrpt::poses::CPosePDF *in_posePDF, const mrpt::obs::CSensoryFramePtr &in_SF) |
Add a new pair to the sequence. More... | |
void | clear () |
Remove all stored pairs. More... | |
void | changeCoordinatesOrigin (const mrpt::poses::CPose3D &newOrigin) |
Change the coordinate origin of all stored poses, for consistency with future new poses to enter in the system. More... | |
RTTI classes and functions | |
mrpt::utils::CObjectPtr | 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) |
Static Public Attributes | |
static const mrpt::utils::TRuntimeClassId | classCObject |
RTTI stuff | |
static const mrpt::utils::TRuntimeClassId | classCSerializable |
Protected Member Functions | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const |
Introduces a pure virtual method responsible for writing to a CStream. More... | |
void | readFromStream (mrpt::utils::CStream &in, int version) |
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 | |
TPosePDFSensFramePairList | m_posesObsPairs |
The stored data. More... | |
RTTI stuff | |
typedef CSimpleMapPtr | Ptr |
typedef CSimpleMapPtr | ConstPtr |
static mrpt::utils::CLASSINIT | _init_CSimpleMap |
static mrpt::utils::TRuntimeClassId | classCSimpleMap |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. More... | |
static mrpt::utils::CObject * | CreateObject () |
static CSimpleMapPtr | Create () |
Iterators API | |
typedef std::pair< mrpt::poses::CPose3DPDFPtr, mrpt::obs::CSensoryFramePtr > | TPosePDFSensFramePair |
typedef std::deque< TPosePDFSensFramePair > | TPosePDFSensFramePairList |
typedef TPosePDFSensFramePairList::const_iterator | const_iterator |
typedef TPosePDFSensFramePairList::iterator | iterator |
typedef TPosePDFSensFramePairList::reverse_iterator | reverse_iterator |
typedef TPosePDFSensFramePairList::const_reverse_iterator | const_reverse_iterator |
const_iterator | begin () const |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
reverse_iterator | rbegin () |
reverse_iterator | rend () |
typedef TPosePDFSensFramePairList::const_iterator mrpt::maps::CSimpleMap::const_iterator |
Definition at line 130 of file maps/CSimpleMap.h.
typedef TPosePDFSensFramePairList::const_reverse_iterator mrpt::maps::CSimpleMap::const_reverse_iterator |
Definition at line 133 of file maps/CSimpleMap.h.
typedef CSimpleMapPtr mrpt::maps::CSimpleMap::ConstPtr |
Definition at line 37 of file maps/CSimpleMap.h.
typedef TPosePDFSensFramePairList::iterator mrpt::maps::CSimpleMap::iterator |
Definition at line 131 of file maps/CSimpleMap.h.
typedef CSimpleMapPtr mrpt::maps::CSimpleMap::Ptr |
A typedef for the associated smart pointer
Definition at line 37 of file maps/CSimpleMap.h.
typedef TPosePDFSensFramePairList::reverse_iterator mrpt::maps::CSimpleMap::reverse_iterator |
Definition at line 132 of file maps/CSimpleMap.h.
typedef std::pair<mrpt::poses::CPose3DPDFPtr,mrpt::obs::CSensoryFramePtr> mrpt::maps::CSimpleMap::TPosePDFSensFramePair |
Definition at line 127 of file maps/CSimpleMap.h.
typedef std::deque<TPosePDFSensFramePair> mrpt::maps::CSimpleMap::TPosePDFSensFramePairList |
Definition at line 128 of file maps/CSimpleMap.h.
CSimpleMap::CSimpleMap | ( | ) |
Default constructor (empty map)
Definition at line 32 of file CSimpleMap.cpp.
CSimpleMap::CSimpleMap | ( | const CSimpleMap & | o | ) |
|
virtual |
|
staticprotected |
|
inline |
Definition at line 135 of file maps/CSimpleMap.h.
|
inline |
Definition at line 137 of file maps/CSimpleMap.h.
void CSimpleMap::changeCoordinatesOrigin | ( | const mrpt::poses::CPose3D & | newOrigin | ) |
Change the coordinate origin of all stored poses, for consistency with future new poses to enter in the system.
Definition at line 318 of file CSimpleMap.cpp.
References m_posesObsPairs.
Referenced by mrpt::slam::CIncrementalMapPartitioner::changeCoordinatesOrigin(), and mrpt::slam::CIncrementalMapPartitioner::removeSetOfNodes().
void CSimpleMap::clear | ( | ) |
Remove all stored pairs.
Definition at line 79 of file CSimpleMap.cpp.
References m_posesObsPairs.
Referenced by mrpt::slam::CIncrementalMapPartitioner::clear(), mrpt::maps::CMultiMetricMapPDF::clear(), mrpt::hmtslam::CRobotPosesGraph::convertIntoSimplemap(), mrpt::slam::CMetricMapBuilder::loadCurrentMapFromFile(), readFromStream(), mrpt::slam::CRangeBearingKFSLAM2D::reset(), mrpt::slam::CRangeBearingKFSLAM::reset(), and ~CSimpleMap().
|
inlineinherited |
|
static |
|
static |
|
virtual |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlineinherited |
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).
Definition at line 162 of file CObject.h.
References mrpt::utils::CObjectPtr.
Referenced by mrpt::obs::CRawlog::addActions(), mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), and mrpt::obs::CRawlog::addObservations().
bool CSimpleMap::empty | ( | ) | const |
Returns size()!=0.
Definition at line 72 of file CSimpleMap.cpp.
References m_posesObsPairs.
Referenced by mrpt::slam::CMetricMapBuilderRBPF::initialize(), and mrpt::maps::CRandomFieldGridMap2D::internal_clear().
|
inline |
Definition at line 136 of file maps/CSimpleMap.h.
|
inline |
Definition at line 138 of file maps/CSimpleMap.h.
void CSimpleMap::get | ( | size_t | index, |
mrpt::poses::CPose3DPDFPtr & | out_posePDF, | ||
mrpt::obs::CSensoryFramePtr & | out_SF | ||
) | const |
Access to the i'th pair, first one is index '0'.
NOTE: This method returns pointers to the objects inside the list, nor a copy of them, so do neither modify them nor delete them. NOTE: You can pass a NULL pointer if you dont need one of the two variables to be returned.
std::exception | On index out of bounds. |
Definition at line 95 of file CSimpleMap.cpp.
References m_posesObsPairs, and THROW_EXCEPTION.
Referenced by mrpt::hmtslam::CLocalMetricHypothesis::changeCoordinateOrigin(), mrpt::slam::CIncrementalMapPartitioner::changeCoordinatesOriginPoseIndex(), mrpt::maps::CMultiMetricMapPDF::clear(), mrpt::slam::CRangeBearingKFSLAM::getAs3DObject(), mrpt::slam::CIncrementalMapPartitioner::getAs3DScene(), mrpt::slam::CRangeBearingKFSLAM::getLastPartitionLandmarks(), mrpt::slam::CMetricMapBuilderICP::initialize(), mrpt::maps::CMetricMap::loadFromProbabilisticPosesAndObservations(), mrpt::slam::CIncrementalMapPartitioner::removeSetOfNodes(), mrpt::slam::CRangeBearingKFSLAM2D::saveMapAndPath2DRepresentationAsMATLABFile(), and mrpt::slam::CRangeBearingKFSLAM::saveMapAndPath2DRepresentationAsMATLABFile().
|
virtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::utils::CSerializable.
void CSimpleMap::insert | ( | const mrpt::poses::CPose3DPDF * | in_posePDF, |
const mrpt::obs::CSensoryFrame & | in_SF | ||
) |
Add a new pair to the sequence.
The objects are copied, so original ones can be free if desired after insertion.
Definition at line 201 of file CSimpleMap.cpp.
References mrpt::utils::CObject::duplicate(), m_posesObsPairs, MRPT_END, and MRPT_START.
Referenced by mrpt::hmtslam::CRobotPosesGraph::convertIntoSimplemap(), mrpt::slam::CRangeBearingKFSLAM2D::processActionObservation(), mrpt::slam::CRangeBearingKFSLAM::processActionObservation(), and mrpt::slam::CMetricMapBuilderICP::processObservation().
void mrpt::maps::CSimpleMap::insert | ( | const mrpt::poses::CPose3DPDF * | in_posePDF, |
const mrpt::obs::CSensoryFramePtr & | in_SF | ||
) |
Add a new pair to the sequence, making a copy of the smart pointer (it's not made unique).
void mrpt::maps::CSimpleMap::insert | ( | const mrpt::poses::CPose3DPDFPtr & | in_posePDF, |
const mrpt::obs::CSensoryFramePtr & | in_SF | ||
) |
Add a new pair to the sequence, making a copy of the smart pointer (it's not made unique).
void mrpt::maps::CSimpleMap::insert | ( | const mrpt::poses::CPosePDFPtr & | in_posePDF, |
const mrpt::obs::CSensoryFramePtr & | in_SF | ||
) |
Add a new pair to the sequence.
The objects are copied, so original ones can be free if desired after insertion. This version for 2D PDFs just converts the 2D PDF into 3D before calling the 3D version.
void CSimpleMap::insert | ( | const mrpt::poses::CPosePDF * | in_posePDF, |
const mrpt::obs::CSensoryFrame & | in_SF | ||
) |
Add a new pair to the sequence.
The objects are copied, so original ones can be free if desired after insertion. This version for 2D PDFs just converts the 2D PDF into 3D before calling the 3D version.
Definition at line 218 of file CSimpleMap.cpp.
References mrpt::utils::CObject::duplicate(), m_posesObsPairs, MRPT_END, and MRPT_START.
void mrpt::maps::CSimpleMap::insert | ( | const mrpt::poses::CPosePDF * | in_posePDF, |
const mrpt::obs::CSensoryFramePtr & | in_SF | ||
) |
Add a new pair to the sequence.
The objects are copied, so original ones can be free if desired after insertion. This version for 2D PDFs just converts the 2D PDF into 3D before calling the 3D version.
bool CSimpleMap::loadFromFile | ( | const std::string & | filName | ) |
Load the contents of this object from a .simplemap binary file (possibly compressed with gzip)
Definition at line 346 of file CSimpleMap.cpp.
Definition at line 37 of file maps/CSimpleMap.h.
Definition at line 37 of file maps/CSimpleMap.h.
|
inline |
Definition at line 37 of file maps/CSimpleMap.h.
Definition at line 37 of file maps/CSimpleMap.h.
Definition at line 37 of file maps/CSimpleMap.h.
|
inline |
Definition at line 37 of file maps/CSimpleMap.h.
|
inline |
Definition at line 37 of file maps/CSimpleMap.h.
|
inline |
Definition at line 37 of file maps/CSimpleMap.h.
CSimpleMap & CSimpleMap::operator= | ( | const CSimpleMap & | o | ) |
Copy.
Definition at line 48 of file CSimpleMap.cpp.
References m_posesObsPairs, MRPT_END, and MRPT_START.
|
inline |
Definition at line 140 of file maps/CSimpleMap.h.
Referenced by mrpt::slam::CMetricMapBuilderRBPF::initialize().
|
inline |
Definition at line 142 of file maps/CSimpleMap.h.
|
protectedvirtual |
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 281 of file CSimpleMap.cpp.
References clear(), m_posesObsPairs, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and version.
void CSimpleMap::remove | ( | size_t | index | ) |
Deletes the i'th pair, first one is index '0'.
std::exception | On index out of bounds. |
Definition at line 110 of file CSimpleMap.cpp.
References m_posesObsPairs, MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by mrpt::slam::CIncrementalMapPartitioner::removeSetOfNodes().
|
inline |
Definition at line 141 of file maps/CSimpleMap.h.
|
inline |
Definition at line 143 of file maps/CSimpleMap.h.
bool CSimpleMap::saveToFile | ( | const std::string & | filName | ) | const |
Save this object to a .simplemap binary file (compressed with gzip)
Definition at line 328 of file CSimpleMap.cpp.
References CFileGZOutputStream.
void mrpt::maps::CSimpleMap::set | ( | size_t | index, |
const mrpt::poses::CPose3DPDFPtr & | in_posePDF, | ||
const mrpt::obs::CSensoryFramePtr & | in_SF | ||
) |
Changes the i'th pair, first one is index '0'.
The referenced object is COPIED, so you can freely destroy the object passed as parameter after calling this. If one of the pointers is NULL, the corresponding contents of the current i'th pair is not modified (i.e. if you want just to modify one of the values).
std::exception | On index out of bounds. |
void mrpt::maps::CSimpleMap::set | ( | size_t | index, |
const mrpt::poses::CPosePDFPtr & | in_posePDF, | ||
const mrpt::obs::CSensoryFramePtr & | in_SF | ||
) |
Changes the i'th pair, first one is index '0'.
The referenced object is COPIED, so you can freely destroy the object passed as parameter after calling this. If one of the pointers is NULL, the corresponding contents of the current i'th pair is not modified (i.e. if you want just to modify one of the values). This version for 2D PDFs just converts the 2D PDF into 3D before calling the 3D version.
std::exception | On index out of bounds. |
size_t CSimpleMap::size | ( | ) | const |
Returns the count of pairs (pose,sensory data)
Definition at line 67 of file CSimpleMap.cpp.
References m_posesObsPairs.
Referenced by mrpt::maps::CMultiMetricMapPDF::clear(), mrpt::slam::CIncrementalMapPartitioner::getAs3DScene(), mrpt::slam::CMetricMapBuilderICP::getCurrentlyBuiltMapSize(), mrpt::slam::CMetricMapBuilderRBPF::getCurrentlyBuiltMapSize(), mrpt::slam::CRangeBearingKFSLAM::getLastPartitionLandmarksAsIfFixedSubmaps(), mrpt::slam::CIncrementalMapPartitioner::getNodesCount(), mrpt::maps::CMultiMetricMapPDF::getNumberOfObservationsInSimplemap(), mrpt::slam::CMetricMapBuilderICP::initialize(), mrpt::slam::CMetricMapBuilderRBPF::initialize(), mrpt::maps::CMetricMap::loadFromProbabilisticPosesAndObservations(), mrpt::slam::CRangeBearingKFSLAM::processActionObservation(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::slam::CIncrementalMapPartitioner::removeSetOfNodes(), run_test_pf_localization(), mrpt::slam::CRangeBearingKFSLAM2D::saveMapAndPath2DRepresentationAsMATLABFile(), and mrpt::slam::CRangeBearingKFSLAM::saveMapAndPath2DRepresentationAsMATLABFile().
|
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 NULL is class does not support conversion to MATLAB. Definition at line 79 of file CSerializable.h.
|
protectedvirtual |
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 NULL, 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 264 of file CSimpleMap.cpp.
References m_posesObsPairs, and version.
|
staticprotected |
Definition at line 37 of file maps/CSimpleMap.h.
|
staticinherited |
|
staticinherited |
Definition at line 42 of file CSerializable.h.
|
static |
Definition at line 37 of file maps/CSimpleMap.h.
|
static |
Definition at line 37 of file maps/CSimpleMap.h.
|
private |
The stored data.
Definition at line 148 of file maps/CSimpleMap.h.
Referenced by changeCoordinatesOrigin(), clear(), CSimpleMap(), empty(), get(), insert(), operator=(), readFromStream(), remove(), size(), and writeToStream().
Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020 |