Go to the documentation of this file.
30 void RS_drawFromProposal(
CPose2D& outSample)
34 outSample.
x(1.0f - cos(ang) *
R);
35 outSample.
y(sin(ang) *
R);
42 double RS_observationLikelihood(
const CPose2D&
x)
55 std::vector<CMyRejectionSampling::TParticle>
samples;
59 printf(
"Computing...");
63 printf(
"Ok! %fms\n", 1000 * tictac.
Tac());
65 FILE* f =
os::fopen(
"_out_samples.txt",
"wt");
69 f,
"%f %f %f %e\n", it->d->x(), it->d->y(), it->d->phi(),
86 catch (std::exception& e)
88 std::cout <<
"EXCEPCTION: " << e.what() << std::endl;
93 printf(
"Untyped excepcion!!");
int void fclose(FILE *f)
An OS-independent version of fclose.
A high-performance stopwatch, with typical resolution of nanoseconds.
A base class for implementing rejection sampling in a generic state space.
const double & phi() const
Get the phi angle of the 2D pose (in radians)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
T square(const T x)
Inline function for the square of a number.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
double Tac() noexcept
Stops the stopwatch.
double drawUniform(const double Min, const double Max)
Generate a uniformly distributed pseudo-random number using the MT19937 algorithm,...
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
double x() const
Common members of all points & poses classes.
void Tic() noexcept
Starts the stopwatch.
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
The namespace for Bayesian filtering algorithm: different particle filters and Kalman filter algorith...
void rejectionSampling(size_t desiredSamples, std::vector< TParticle > &outSamples, size_t timeoutTrials=1000)
Generates a set of N independent samples via rejection sampling.
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
A namespace of pseudo-random numbers generators of diferent distributions.
double drawGaussian1D(const double mean, const double std)
Generate a normally distributed pseudo-random number.
A class used to store a 2D point.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |