#include <CParticleFilter.h>
Public Member Functions | |
void | allocate (int m_size) |
Allocate the memory for cache. | |
void | allocate (int m_size) |
Allocate the memory for cache. | |
void | covRandom (float &xRand, float &yRand, float cov[3]) |
void | covRandom (float &xRand, float &yRand, float cov[3]) |
void | fillCache () |
void | fillCache () |
float | getCachedUniformRandom () |
float | getCachedUniformRandom () |
float | normalRandom () |
float | normalRandom () |
ownRandom () | |
ownRandom () | |
float | uniformRandom (void) |
float | uniformRandom (void) |
~ownRandom () | |
~ownRandom () | |
Public Attributes | |
bool | isOk |
float * | normalRandomCache |
int | size |
This is an implementation of a particle filter Short howto: Create -> CParticleFilter filt; Init -> filt.initializeNormalRandom(init_pose, variance,size_of_filter); ///also uniform init Predict -> filt.predict(delta_movement, std_of_noise)
Next Calculate the likehood using some likelihood function, which updates LikelihoodFunction(&filt) where you update the particle likelihood manually (filt.Particles[i].lik) or then you calculate the likelihood vector and use updateLikelihood(float *lik) - function
Next make the normalization -> filt.normalize();
Now you can go back to predict or then you can resample the distribution by calling filt.SIRupdate();
A helper class for calculating random numbers
Definition at line 35 of file CParticleFilter.h.
ownRandom::ownRandom | ( | ) | [inline] |
< set new seed
Definition at line 41 of file CParticleFilter.h.
ownRandom::~ownRandom | ( | ) | [inline] |
Definition at line 47 of file CParticleFilter.h.
ownRandom::ownRandom | ( | ) | [inline] |
< set new seed
Definition at line 27 of file ownRandom.h.
ownRandom::~ownRandom | ( | ) | [inline] |
Definition at line 33 of file ownRandom.h.
void ownRandom::allocate | ( | int | m_size | ) | [inline] |
Allocate the memory for cache.
Definition at line 37 of file ownRandom.h.
void ownRandom::allocate | ( | int | m_size | ) | [inline] |
Allocate the memory for cache.
Definition at line 51 of file CParticleFilter.h.
void ownRandom::covRandom | ( | float & | xRand, |
float & | yRand, | ||
float | cov[3] | ||
) | [inline] |
Returns a sample from given covariance "ellipse" cov[0] = X - variance cov[1] = XY -covariance cov[2] = Y - variance
Definition at line 118 of file ownRandom.h.
void ownRandom::covRandom | ( | float & | xRand, |
float & | yRand, | ||
float | cov[3] | ||
) | [inline] |
Returns a sample from given covariance "ellipse" cov[0] = X - variance cov[1] = XY -covariance cov[2] = Y - variance
Definition at line 132 of file CParticleFilter.h.
void ownRandom::fillCache | ( | ) | [inline] |
Definition at line 47 of file ownRandom.h.
void ownRandom::fillCache | ( | ) | [inline] |
Definition at line 61 of file CParticleFilter.h.
float ownRandom::getCachedUniformRandom | ( | ) | [inline] |
Gets the uniform random number from cache
< Just for precaution
Definition at line 62 of file ownRandom.h.
float ownRandom::getCachedUniformRandom | ( | ) | [inline] |
Gets the uniform random number from cache
< Just for precaution
Definition at line 76 of file CParticleFilter.h.
float ownRandom::normalRandom | ( | ) | [inline] |
Returns normally distributed random number Zero mean and unit variance.
Definition at line 89 of file ownRandom.h.
float ownRandom::normalRandom | ( | ) | [inline] |
Returns normally distributed random number Zero mean and unit variance.
Definition at line 103 of file CParticleFilter.h.
float ownRandom::uniformRandom | ( | void | ) | [inline] |
Returns a (pseudo) random number between 0 and 1.
Definition at line 81 of file ownRandom.h.
float ownRandom::uniformRandom | ( | void | ) | [inline] |
Returns a (pseudo) random number between 0 and 1.
Definition at line 95 of file CParticleFilter.h.
bool ownRandom::isOk |
Definition at line 38 of file CParticleFilter.h.
float * ownRandom::normalRandomCache |
Definition at line 37 of file CParticleFilter.h.
int ownRandom::size |
Definition at line 39 of file CParticleFilter.h.