Go to the documentation of this file.
27 #include <mrpt/examples_config.h>
29 MRPT_EXAMPLES_BASE_DIRECTORY +
30 string(
"maps_gridmap_likelihood_characterization/"));
51 string bmp = cfgFile.read_string(
"Params",
"bitmap_file",
"",
true);
53 cfgFile.read_float(
"Params",
"evaluation_grid_resolution", 0.1f,
true);
55 float evalgrid_x_min = 0, evalgrid_x_max = 0;
56 float evalgrid_y_min = 0, evalgrid_y_max = 0;
63 int type_experiment = 0;
72 if (type_experiment == 0)
98 printf(
"Performing simulation (saving to out_lik.txt)...");
100 FILE* f =
os::fopen(
"out_lik.txt",
"wt");
113 for (
float y = evalgrid_y_min;
y < evalgrid_y_max;
y +=
res)
115 for (
float x = evalgrid_x_min;
x < evalgrid_x_max;
x +=
res)
128 printf(
"Time:%fms\n", 1000.0f * tictac.
Tac());
141 catch (std::exception& e)
143 std::cout <<
"MRPT exception:\n" << e.what() << std::endl;
148 printf(
"Runtime exception!!");
void dumpToConsole() const
Just like dumpToTextStream() but sending the text to the console (std::cout)
float maxRange
The maximum range allowed by the device, in meters (e.g.
int void fclose(FILE *f)
An OS-independent version of fclose.
bool rightToLeft
The scanning direction: true=counterclockwise; false=clockwise.
bool loadFromBitmapFile(const std::string &file, float resolution, float xCentralPixel=-1, float yCentralPixel=-1)
Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile).
A high-performance stopwatch, with typical resolution of nanoseconds.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
double computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom)
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.
void insertPoint(float x, float y, float z=0)
Provides a way to insert (append) individual points into the map: the missing fields of child classes...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define ASSERT_(f)
Defines an assertion mechanism.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
This namespace contains representation of robot actions and observations.
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini" file.
#define MRPT_LOAD_CONFIG_VAR_NO_DEFAULT( variableName, variableType, configFileObject, sectionNameStr)
double Tac() noexcept
Stops the stopwatch.
void laserScanSimulator(mrpt::obs::CObservation2DRangeScan &inout_Scan, const mrpt::poses::CPose2D &robotPose, float threshold=0.6f, size_t N=361, float noiseStd=0, unsigned int decimation=1, float angleNoiseStd=mrpt::DEG2RAD(.0)) const
Simulates a laser range scan into the current grid map.
void resizeScanAndAssign(const size_t len, const float rangeVal, const bool rangeValidity, const int32_t rangeIntensity=0)
Resizes all data vectors to allocate a given number of scan rays and assign default values.
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees).
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
string iniFile(myDataDir+string("benchmark-options.ini"))
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
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.
bool saveAsBitmapFile(const std::string &file) const
Saves the gridmap as a graphical file (BMP,PNG,...).
This class allows loading and storing values and vectors of different types from "....
A class for storing an occupancy grid map.
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions likelihoodOptions
void clear()
Erase all the contents of the map.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
double DEG2RAD(const double x)
Degrees to radians.
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 | |