Main MRPT website > C++ reference
MRPT logo
List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
mrpt::slam::CSimpleMap Class Reference

Detailed Description

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.

Note
Objects of this class are serialized into (possibly GZ-compressed) files with the extension ".simplemap".
Before MRPT 0.9.0 the name of this class was "CSensFrameProbSequence", that's why there is a typedef with that name to allow backward compatibility.
See also
CSensoryFrame, CPosePDF

Definition at line 59 of file CSimpleMap.h.

#include <mrpt/slam/CSimpleMap.h>

Inheritance diagram for mrpt::slam::CSimpleMap:
Inheritance graph
[legend]

Public Types

typedef std::pair< CPose3DPDFPtr, CSensoryFramePtrTPosePDFSensFramePair
 
typedef std::deque< TPosePDFSensFramePairTPosePDFSensFramePairList
 
typedef TPosePDFSensFramePairList::const_iterator const_iterator
 
typedef TPosePDFSensFramePairList::iterator iterator
 
typedef TPosePDFSensFramePairList::reverse_iterator reverse_iterator
 
typedef TPosePDFSensFramePairList::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 CSimpleMap ()
 Constructor. More...
 
 CSimpleMap (const CSimpleMap &o)
 Copy constructor. More...
 
CSimpleMapoperator= (const CSimpleMap &o)
 Copy constructor. More...
 
virtual ~CSimpleMap ()
 Destructor: More...
 
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 pairs count. More...
 
void get (size_t index, CPose3DPDFPtr &out_posePDF, CSensoryFramePtr &out_SF) const
 Access to the i'th pair, first one is index '0'. More...
 
void set (size_t index, const CPose3DPDFPtr &in_posePDF, const CSensoryFramePtr &in_SF)
 Changes the i'th pair, first one is index '0'. More...
 
void set (size_t index, const CPosePDFPtr &in_posePDF, const 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 CPose3DPDF *in_posePDF, const CSensoryFrame &in_SF)
 Add a new pair to the sequence. More...
 
void insert (const CPose3DPDF *in_posePDF, const 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 CPose3DPDFPtr &in_posePDF, const 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 CPosePDFPtr &in_posePDF, const CSensoryFramePtr &in_SF)
 Add a new pair to the sequence. More...
 
void insert (const CPosePDF *in_posePDF, const CSensoryFrame &in_SF)
 Add a new pair to the sequence. More...
 
void insert (const CPosePDF *in_posePDF, const CSensoryFramePtr &in_SF)
 Add a new pair to the sequence. More...
 
void clear ()
 Remove all stored pairs. More...
 
void changeCoordinatesOrigin (const CPose3D &newOrigin)
 Change the coordinate origin of all stored poses, for consistency with future new poses to enter in the system. More...
 
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 ()
 
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...
 
CObjectclone () const
 Cloning interface for smart pointers. More...
 

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 SmartPtr
 
static mrpt::utils::CLASSINIT _init_CSimpleMap
 
static mrpt::utils::TRuntimeClassId classCSimpleMap
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static CSimpleMapPtr Create ()
 

Member Typedef Documentation

◆ const_iterator

typedef TPosePDFSensFramePairList::const_iterator mrpt::slam::CSimpleMap::const_iterator

Definition at line 168 of file CSimpleMap.h.

◆ const_reverse_iterator

typedef TPosePDFSensFramePairList::const_reverse_iterator mrpt::slam::CSimpleMap::const_reverse_iterator

Definition at line 171 of file CSimpleMap.h.

◆ iterator

typedef TPosePDFSensFramePairList::iterator mrpt::slam::CSimpleMap::iterator

Definition at line 169 of file CSimpleMap.h.

◆ reverse_iterator

typedef TPosePDFSensFramePairList::reverse_iterator mrpt::slam::CSimpleMap::reverse_iterator

Definition at line 170 of file CSimpleMap.h.

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 62 of file CSimpleMap.h.

◆ TPosePDFSensFramePair

Definition at line 165 of file CSimpleMap.h.

◆ TPosePDFSensFramePairList

Definition at line 166 of file CSimpleMap.h.

Constructor & Destructor Documentation

◆ CSimpleMap() [1/2]

mrpt::slam::CSimpleMap::CSimpleMap ( )

Constructor.

◆ CSimpleMap() [2/2]

mrpt::slam::CSimpleMap::CSimpleMap ( const CSimpleMap o)

Copy constructor.

◆ ~CSimpleMap()

virtual mrpt::slam::CSimpleMap::~CSimpleMap ( )
virtual

Destructor:

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId* mrpt::slam::CSimpleMap::_GetBaseClass ( )
staticprotected

◆ begin() [1/2]

const_iterator mrpt::slam::CSimpleMap::begin ( ) const
inline

Definition at line 174 of file CSimpleMap.h.

◆ begin() [2/2]

iterator mrpt::slam::CSimpleMap::begin ( )
inline

Definition at line 176 of file CSimpleMap.h.

◆ changeCoordinatesOrigin()

void mrpt::slam::CSimpleMap::changeCoordinatesOrigin ( const CPose3D newOrigin)

Change the coordinate origin of all stored poses, for consistency with future new poses to enter in the system.

◆ clear()

void mrpt::slam::CSimpleMap::clear ( )

Remove all stored pairs.

See also
remove

◆ clone()

CObject* mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 161 of file CObject.h.

◆ Create()

static CSimpleMapPtr mrpt::slam::CSimpleMap::Create ( )
static

◆ CreateObject()

static mrpt::utils::CObject* mrpt::slam::CSimpleMap::CreateObject ( )
static

◆ duplicate()

virtual mrpt::utils::CObject* mrpt::slam::CSimpleMap::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

◆ duplicateGetSmartPtr()

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
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 158 of file CObject.h.

◆ end() [1/2]

const_iterator mrpt::slam::CSimpleMap::end ( ) const
inline

Definition at line 175 of file CSimpleMap.h.

◆ end() [2/2]

iterator mrpt::slam::CSimpleMap::end ( )
inline

Definition at line 177 of file CSimpleMap.h.

◆ get()

void mrpt::slam::CSimpleMap::get ( size_t  index,
CPose3DPDFPtr out_posePDF,
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.

Exceptions
std::exceptionOn index out of bounds.

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId* mrpt::slam::CSimpleMap::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

◆ insert() [1/6]

void mrpt::slam::CSimpleMap::insert ( const CPose3DPDF in_posePDF,
const CSensoryFrame in_SF 
)

Add a new pair to the sequence.

The objects are copied, so original ones can be free if desired after insertion.

◆ insert() [2/6]

void mrpt::slam::CSimpleMap::insert ( const CPose3DPDF in_posePDF,
const CSensoryFramePtr in_SF 
)

Add a new pair to the sequence, making a copy of the smart pointer (it's not made unique).

◆ insert() [3/6]

void mrpt::slam::CSimpleMap::insert ( const CPose3DPDFPtr in_posePDF,
const CSensoryFramePtr in_SF 
)

Add a new pair to the sequence, making a copy of the smart pointer (it's not made unique).

◆ insert() [4/6]

void mrpt::slam::CSimpleMap::insert ( const CPosePDFPtr in_posePDF,
const 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.

◆ insert() [5/6]

void mrpt::slam::CSimpleMap::insert ( const CPosePDF in_posePDF,
const 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.

◆ insert() [6/6]

void mrpt::slam::CSimpleMap::insert ( const CPosePDF in_posePDF,
const 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.

◆ loadFromFile()

bool mrpt::slam::CSimpleMap::loadFromFile ( const std::string &  filName)

Load the contents of this object from a .simplemap binary file (possibly compressed with gzip)

See also
saveToFile
Returns
false on any error.

◆ operator=()

CSimpleMap& mrpt::slam::CSimpleMap::operator= ( const CSimpleMap o)

Copy constructor.

◆ rbegin() [1/2]

const_reverse_iterator mrpt::slam::CSimpleMap::rbegin ( ) const
inline

Definition at line 179 of file CSimpleMap.h.

◆ rbegin() [2/2]

reverse_iterator mrpt::slam::CSimpleMap::rbegin ( )
inline

Definition at line 181 of file CSimpleMap.h.

◆ readFromStream()

void mrpt::slam::CSimpleMap::readFromStream ( mrpt::utils::CStream in,
int  version 
)
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.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

◆ remove()

void mrpt::slam::CSimpleMap::remove ( size_t  index)

Deletes the i'th pair, first one is index '0'.

Exceptions
std::exceptionOn index out of bounds.
See also
insert, get, set

◆ rend() [1/2]

const_reverse_iterator mrpt::slam::CSimpleMap::rend ( ) const
inline

Definition at line 180 of file CSimpleMap.h.

◆ rend() [2/2]

reverse_iterator mrpt::slam::CSimpleMap::rend ( )
inline

Definition at line 182 of file CSimpleMap.h.

◆ saveToFile()

bool mrpt::slam::CSimpleMap::saveToFile ( const std::string &  filName) const

Save this object to a .simplemap binary file (compressed with gzip)

See also
loadFromFile
Returns
false on any error.

◆ set() [1/2]

void mrpt::slam::CSimpleMap::set ( size_t  index,
const CPose3DPDFPtr in_posePDF,
const 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).

Exceptions
std::exceptionOn index out of bounds.
See also
insert, get, remove

◆ set() [2/2]

void mrpt::slam::CSimpleMap::set ( size_t  index,
const CPosePDFPtr in_posePDF,
const 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.

Exceptions
std::exceptionOn index out of bounds.
See also
insert, get, remove

◆ size()

size_t mrpt::slam::CSimpleMap::size ( ) const

◆ writeToStream()

void mrpt::slam::CSimpleMap::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
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.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf 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.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Member Data Documentation

◆ _init_CSimpleMap

mrpt::utils::CLASSINIT mrpt::slam::CSimpleMap::_init_CSimpleMap
staticprotected

Definition at line 62 of file CSimpleMap.h.

◆ classCObject

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 146 of file CObject.h.

◆ classCSerializable

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 61 of file CSerializable.h.

◆ classCSimpleMap

mrpt::utils::TRuntimeClassId mrpt::slam::CSimpleMap::classCSimpleMap
static

Definition at line 62 of file CSimpleMap.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::slam::CSimpleMap::classinfo
static

Definition at line 62 of file CSimpleMap.h.

◆ m_posesObsPairs

TPosePDFSensFramePairList mrpt::slam::CSimpleMap::m_posesObsPairs
private

The stored data.

Definition at line 186 of file CSimpleMap.h.




Page generated by Doxygen 1.8.14 for MRPT 1.0.2 SVN: at lun oct 28 00:52:41 CET 2019 Hosted on:
SourceForge.net Logo