This template class declares the array of particles and its internal data, managing some memory-related issues and providing an easy implementation of virtual methods required for implementing a CParticleFilterCapable.
By adding IMPLEMENT_PARTICLE_FILTER_CAPABLE(T) to the body of the declaration of classes inheriting from both CParticleFilterData and CParticleFilterCapable, the following pure virtual methods are automatically implemented (the param T must be equal to the argument of the template CParticleFilterData).
Since CProbabilityParticle implements all the required operators, the member "m_particles" can be safely copied with "=" or copy constructor operators and new objects will be created internally instead of copying the internal pointers, which would lead to memory corruption.
#include <mrpt/bayes/CParticleFilterData.h>

Public Types | |
| typedef T | CParticleDataContent |
| This is the type inside the corresponding CParticleData class. | |
| typedef CProbabilityParticle< T > | CParticleData |
| Use this to refer to each element in the m_particles array. | |
| typedef std::deque< CParticleData > | CParticleList |
| Use this type to refer to the list of particles m_particles. | |
Public Member Functions | |
| CParticleFilterData () | |
| Default constructor. | |
| void | clearParticles () |
| Free the memory of all the particles and reset the array "m_particles" to length zero. | |
| virtual | ~CParticleFilterData () |
| Virtual destructor. | |
| void | writeParticlesToStream (utils::CStream &out) const |
| Dumps the sequence of particles and their weights to a stream (requires T implementing CSerializable). | |
| void | readParticlesFromStream (utils::CStream &in) |
| Reads the sequence of particles and their weights from a stream (requires T implementing CSerializable). | |
| void | getWeights (vector_double &out_logWeights) const |
| Returns a vector with the sequence of the logaritmic weights of all the samples. | |
| const CParticleData * | getMostLikelyParticle () const |
| Returns the particle with the highest weight. | |
Public Attributes | |
| CParticleList | m_particles |
| The array of particles. | |
Use this to refer to each element in the m_particles array.
Definition at line 61 of file CParticleFilterData.h.
This is the type inside the corresponding CParticleData class.
Definition at line 60 of file CParticleFilterData.h.
Use this type to refer to the list of particles m_particles.
Definition at line 62 of file CParticleFilterData.h.
| mrpt::bayes::CParticleFilterData::CParticleFilterData | ( | ) | [inline] |
Default constructor.
Definition at line 67 of file CParticleFilterData.h.
| virtual mrpt::bayes::CParticleFilterData::~CParticleFilterData | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 83 of file CParticleFilterData.h.
| void mrpt::bayes::CParticleFilterData::clearParticles | ( | ) | [inline] |
Free the memory of all the particles and reset the array "m_particles" to length zero.
Definition at line 72 of file CParticleFilterData.h.
Referenced by mrpt::bayes::CParticleFilterData< CRBPFParticleData >::~CParticleFilterData(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream().
| const CParticleData* mrpt::bayes::CParticleFilterData::getMostLikelyParticle | ( | ) | const [inline] |
Returns the particle with the highest weight.
Reimplemented in mrpt::poses::CPosePDFParticles, and mrpt::poses::CPose3DPDFParticles.
Definition at line 140 of file CParticleFilterData.h.
| void mrpt::bayes::CParticleFilterData::getWeights | ( | vector_double & | out_logWeights | ) | const [inline] |
Returns a vector with the sequence of the logaritmic weights of all the samples.
Definition at line 127 of file CParticleFilterData.h.
| void mrpt::bayes::CParticleFilterData::readParticlesFromStream | ( | utils::CStream & | in | ) | [inline] |
Reads the sequence of particles and their weights from a stream (requires T implementing CSerializable).
Definition at line 107 of file CParticleFilterData.h.
| void mrpt::bayes::CParticleFilterData::writeParticlesToStream | ( | utils::CStream & | out | ) | const [inline] |
Dumps the sequence of particles and their weights to a stream (requires T implementing CSerializable).
Definition at line 93 of file CParticleFilterData.h.
The array of particles.
Definition at line 64 of file CParticleFilterData.h.
Referenced by mrpt::bayes::CParticleFilterData< CRBPFParticleData >::clearParticles(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::writeParticlesToStream(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getWeights(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getMostLikelyParticle().
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011 |