Go to the documentation of this file.
64 vector<CRejectionSamplingRangeOnlyLocalization::TParticle>
samples;
70 printf(
"Preparing...");
74 printf(
"Ok! %fms\n", 1000 * tictac.
Tac());
76 printf(
"Computing...");
79 printf(
"Ok! %fms\n", 1000 * tictac.
Tac());
81 FILE* f =
os::fopen(
"_out_samples.txt",
"wt");
85 f,
"%f %f %f %e\n", it->d->x(), it->d->y(), it->d->phi(),
104 cout <<
"EXCEPCTION: " << e.what() << endl;
109 printf(
"Untyped excepcion!!");
Each one of the measurements.
float sensedDistance
The sensed range itself (in meters).
int void fclose(FILE *f)
An OS-independent version of fclose.
bool setParams(const mrpt::maps::CLandmarksMap &beaconsMap, const mrpt::obs::CObservationBeaconRanges &observation, float sigmaRanges, const mrpt::poses::CPose2D &oldPose, float robot_z=0, bool autoCheckAngleRanges=true)
The parameters used in the generation of random samples:
A high-performance stopwatch, with typical resolution of nanoseconds.
mrpt::config::CConfigFile CConfigFile
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
An implementation of rejection sampling for generating 2D robot pose from range-only measurements wit...
#define ASSERT_(f)
Defines an assertion mechanism.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
ProxySelectorContainerByClass< mrpt::maps::CLandmarksMap::Ptr, TListMaps > m_landmarksMap
Proxy that looks like a smart pointer to the first matching object in maps.
void randomize(const uint32_t seed)
Initialize the PRNG from the given random seed.
double Tac() noexcept
Stops the stopwatch.
A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap...
std::deque< TMeasurement > sensedData
The list of observed ranges.
Declares a class derived from "CObservation" that represents one (or more) range measurements to labe...
float stdError
The "sigma" of the sensor, assuming a zero-mean Gaussian noise model.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
This class stores any customizable set of metric maps.
int32_t beaconID
The ID of the sensed beacon (or INVALID_BEACON_ID if unknown)
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ionName) override
Loads the configuration for the set of internal maps from a textual definition in an INI-like file.
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.
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.
void setListOfMaps(const mrpt::maps::TSetOfMetricMapInitializers *initializers)
Sets the list of internal map according to the passed list of map initializers (Current maps' content...
A namespace of pseudo-random numbers generators of diferent distributions.
A class used to store a 3D point.
mrpt::poses::CPoint3D sensorLocationOnRobot
Position of the sensor on the robot.
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 | |