MRPT  2.0.4
List of all members | Public Types | Public Member Functions | Public Attributes | Static Public Attributes
mrpt::bayes::CParticleFilterData< T, STORAGE > Class Template Reference

Detailed Description

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
class mrpt::bayes::CParticleFilterData< T, STORAGE >

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.

See also the methods in the base class CParticleFilterDataImpl<>.

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.

See also
CParticleFilter, CParticleFilterCapable, CParticleFilterDataImpl

Definition at line 184 of file CParticleFilterData.h.

#include <mrpt/bayes/CParticleFilterData.h>

Inheritance diagram for mrpt::bayes::CParticleFilterData< T, STORAGE >:

Public Types

using CParticleDataContent = T
 This is the type inside the corresponding CParticleData class. More...
 
using CParticleData = CProbabilityParticle< T, STORAGE >
 Use this to refer to each element in the m_particles array. More...
 
using CParticleList = std::deque< CParticleData >
 Use this type to refer to the list of particles m_particles. More...
 

Public Member Functions

 CParticleFilterData ()
 Default constructor. More...
 
void clearParticles ()
 Free the memory of all the particles and reset the array "m_particles" to length zero. More...
 
template<class STREAM >
void writeParticlesToStream (STREAM &out) const
 Dumps the sequence of particles and their weights to a stream (requires T implementing CSerializable). More...
 
template<class STREAM >
void readParticlesFromStream (STREAM &in)
 Reads the sequence of particles and their weights from a stream (requires T implementing CSerializable). More...
 
void getWeights (std::vector< double > &out_logWeights) const
 Returns a vector with the sequence of the logaritmic weights of all the samples. More...
 
const CParticleDatagetMostLikelyParticle () const
 Returns the particle with the highest weight. More...
 

Public Attributes

CParticleList m_particles
 The array of particles. More...
 

Static Public Attributes

static const particle_storage_mode PARTICLE_STORAGE = STORAGE
 

Member Typedef Documentation

◆ CParticleData

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
using mrpt::bayes::CParticleFilterData< T, STORAGE >::CParticleData = CProbabilityParticle<T, STORAGE>

Use this to refer to each element in the m_particles array.

Definition at line 190 of file CParticleFilterData.h.

◆ CParticleDataContent

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
using mrpt::bayes::CParticleFilterData< T, STORAGE >::CParticleDataContent = T

This is the type inside the corresponding CParticleData class.

Definition at line 188 of file CParticleFilterData.h.

◆ CParticleList

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
using mrpt::bayes::CParticleFilterData< T, STORAGE >::CParticleList = std::deque<CParticleData>

Use this type to refer to the list of particles m_particles.

Definition at line 192 of file CParticleFilterData.h.

Constructor & Destructor Documentation

◆ CParticleFilterData()

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
mrpt::bayes::CParticleFilterData< T, STORAGE >::CParticleFilterData ( )
inline

Default constructor.

Definition at line 199 of file CParticleFilterData.h.

Member Function Documentation

◆ clearParticles()

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
void mrpt::bayes::CParticleFilterData< T, STORAGE >::clearParticles ( )
inline

Free the memory of all the particles and reset the array "m_particles" to length zero.

Definition at line 202 of file CParticleFilterData.h.

Referenced by mrpt::maps::CMultiMetricMapPDF::getEstimatedPosePDFAtTime(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream().

Here is the caller graph for this function:

◆ getMostLikelyParticle()

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
const CParticleData* mrpt::bayes::CParticleFilterData< T, STORAGE >::getMostLikelyParticle ( ) const
inline

Returns the particle with the highest weight.

Definition at line 271 of file CParticleFilterData.h.

Referenced by mrpt::hmtslam::CHMTSLAM::generateLogFiles().

Here is the caller graph for this function:

◆ getWeights()

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
void mrpt::bayes::CParticleFilterData< T, STORAGE >::getWeights ( std::vector< double > &  out_logWeights) const
inline

Returns a vector with the sequence of the logaritmic weights of all the samples.

Definition at line 257 of file CParticleFilterData.h.

Referenced by mrpt::maps::CBeaconMap::internal_insertObservation().

Here is the caller graph for this function:

◆ readParticlesFromStream()

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
template<class STREAM >
void mrpt::bayes::CParticleFilterData< T, STORAGE >::readParticlesFromStream ( STREAM &  in)
inline

Reads the sequence of particles and their weights from a stream (requires T implementing CSerializable).

See also
writeParticlesToStream

Definition at line 230 of file CParticleFilterData.h.

◆ writeParticlesToStream()

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
template<class STREAM >
void mrpt::bayes::CParticleFilterData< T, STORAGE >::writeParticlesToStream ( STREAM &  out) const
inline

Dumps the sequence of particles and their weights to a stream (requires T implementing CSerializable).

See also
readParticlesFromStream

Definition at line 208 of file CParticleFilterData.h.

Member Data Documentation

◆ m_particles

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
CParticleList mrpt::bayes::CParticleFilterData< T, STORAGE >::m_particles

The array of particles.

Definition at line 196 of file CParticleFilterData.h.

Referenced by mrpt::poses::CPosePDFParticles::append(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::clearParticles(), mrpt::hmtslam::CHierarchicalMapMHPartition::computeCoordinatesTransformationBetweenNodes(), mrpt::hmtslam::CHierarchicalMapMHPartition::computeOverlapProbabilityBetweenNodes(), mrpt::poses::CPoseInterpolatorBase< 3 >::filter(), mrpt::poses::CPosePDFGrid::getCovarianceAndMean(), mrpt::poses::CPose3DPDFGrid::getCovarianceAndMean(), mrpt::maps::CMultiMetricMapPDF::getEstimatedPosePDFAtTime(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getMostLikelyParticle(), mrpt::hmtslam::CLocalMetricHypothesis::getPoseParticles(), mrpt::hmtslam::CLocalMetricHypothesis::getRelativePose(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getWeights(), mrpt::maps::CBeaconMap::internal_computeObservationLikelihood(), mrpt::maps::CBeaconMap::internal_insertObservation(), mrpt::hmtslam::CHMTSLAM::LSLAM_process_message_from_AA(), mrpt::hmtslam::CHMTSLAM::perform_TLC(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfAuxiliaryPFOptimal(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfOptimalProposal(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::processOneLMH(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream(), mrpt::hmtslam::CLocalMetricHypothesis::updateAreaFromLMH(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::writeParticlesToStream().

◆ PARTICLE_STORAGE

template<class T, particle_storage_mode STORAGE = particle_storage_mode::POINTER>
const particle_storage_mode mrpt::bayes::CParticleFilterData< T, STORAGE >::PARTICLE_STORAGE = STORAGE
static

Definition at line 193 of file CParticleFilterData.h.




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020