53 insertionOpts.loadFromConfigFile(
source, sectionNamePrefix+
string(
"_insertOpts") );
64 this->insertionOpts.dumpToTextStream(out);
86 double x_min,
double x_max,
87 double y_min,
double y_max,
125 robotPose2D =
CPose2D(*robotPose);
126 robotPose3D = (*robotPose);
157 resize(new_x_min,new_x_max, new_y_min,new_y_max, default_cell , 2.0 );
162 ASSERTMSG_(cell!=NULL,
"cell==NULL even after resizing grid!?")
165 const int cell_old =
static_cast<int>(*cell);
166 int cell_new = cell_old +
static_cast<int>(logodd_observation);
170 *cell =
static_cast<cell_t>(cell_new);
280 out.
printf(
"\n----------- [CReflectivityGridMap2D::TInsertionOptions] ------------ \n\n");
315 bool forceRGB )
const 321 unsigned char *destPtr;
326 else destPtr =
img(0,
y);
337 unsigned char *destPtr;
342 else destPtr =
img(0,
y);
373 unsigned char *destPtr_color;
374 unsigned char *destPtr_trans;
378 destPtr_color = imgColor(0,
y);
379 destPtr_trans = imgTrans(0,
y);
383 *destPtr_color++ = cell255;
386 *destPtr_trans++ = auxC>0 ? (auxC << 1) : ((-auxC) << 1);
390 outObj->assignImage_fast( imgColor,imgTrans );
391 outSetOfObj->insert( outObj );
double x() const
Common members of all points & poses classes.
Virtual base for specifying the kind and parameters of one map (normally, to be inserted into mrpt::m...
Parameters for CMetricMap::compute3DMatchingRatio()
#define ASSERT_BELOWEQ_(__A, __B)
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
CReflectivityGridMap2D(double x_min=-2, double x_max=2, double y_min=-2, double y_max=2, double resolution=0.1)
Constructor.
static const int8_t CELLTYPE_MIN
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
bool enableSaveAs3DObject
(Default=true) If false, calling CMetricMap::getAs3DObject() will have no effects ...
A class for storing images as grayscale or RGB bitmaps.
int8_t cell_t
The type of cells.
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
void WriteBuffer(const void *Buffer, size_t Count)
Writes a block of bytes to the stream from Buffer.
static CTexturedPlanePtr Create()
float reflectivityLevel
The read reflectivity level, in the range [0,1] (0=black, 1=white).
virtual void resize(double new_x_min, double new_x_max, double new_y_min, double new_y_max, const int8_t &defaultValueNewCells, double additionalMarginMeters=2.0)
Changes the size of the grid, maintaining previous contents.
Declares a class derived from "CObservation" that encapsules a single short-range reflectivity measur...
TMapGenericParams genericMapParams
Common params to all maps.
void loadFromConfigFile_map_specific(const mrpt::utils::CConfigFileBase &source, const std::string §ionNamePrefix)
Load all map-specific params.
IMPLEMENTS_SERIALIZABLE(CLogFileRecord_FullEval, CHolonomicLogFileRecord, mrpt::nav) IMPLEMENTS_SERIALIZABLE(CHolonomicFullEval
void fill(const int8_t &value)
Fills all the cells with the same value.
GLsizei GLsizei GLuint * obj
float sensorStdNoise
1-sigma of the sensor Gaussian noise (in the same normalized units than reflectivityLevel) ...
A 2D grid map representing the reflectivity of the environment (for example, measured with an IR prox...
This class allows loading and storing values and vectors of different types from a configuration text...
T square(const T x)
Inline function for the square of a number.
mrpt::poses::CPose3D sensorPose
The pose of this sensor in robot's local coordinates.
int8_t * cellByPos(double x, double y)
Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This base provides a set of functions for maths stuff.
void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
A 2D grid of dynamic size which stores any kind of data at each cell.
cell_t p2l(const float p)
Scales a real valued probability in [0,1] to an integer representation of: log(p)-log(1-p) in the val...
float compute3DMatchingRatio(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const MRPT_OVERRIDE
See docs in base class: in this class this always returns 0.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
void composeFrom(const CPose3D &A, const CPose3D &B)
Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids th...
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
Internal method called by insertObservation()
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
std::vector< int8_t > m_map
The cells.
bool isEmpty() const MRPT_OVERRIDE
Returns true if the map is empty/no observation has been inserted.
This namespace contains representation of robot actions and observations.
void dumpToTextStream_map_specific(mrpt::utils::CStream &out) const
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
Internal method called by computeObservationLikelihood()
GLsizei const GLchar ** string
void keep_max(T &var, const K test_val)
If the second argument is above the first one, set the first argument to this higher value...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
double resolution
See CReflectivityGridMap2DOptions::CReflectivityGridMap2DOptions.
#define MRPT_LOAD_CONFIG_VAR(variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define MAP_DEFINITION_REGISTER(_CLASSNAME_STRINGS, _CLASSNAME_WITH_NS)
Registers one map class into TMetricMapInitializer factory.
static const int8_t CELLTYPE_MAX
#define ASSERT_ABOVEEQ_(__A, __B)
uint8_t l2p_255(const cell_t l)
Scales an integer representation of the log-odd into a linear scale [0,255], using p=exp(l)/(1+exp(l)...
void keep_min(T &var, const K test_val)
If the second argument is below the first one, set the first argument to this lower value...
Declares a virtual base class for all metric maps storage classes.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents any robot's observation.
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of t...
bool saveToTextFile(const std::string &fileName) const
Saves a float representation of the grid (via "cell2float()") to a text file.
GLsizei GLsizei GLchar * source
void dyngridcommon_writeToStream(mrpt::utils::CStream &out) const
void internal_clear() MRPT_OVERRIDE
Internal method called by clear()
void getAsImage(utils::CImage &img, bool verticalFlip=false, bool forceRGB=false) const
Returns the grid as a 8-bit graylevel image, where each pixel is a cell (output image is RGB only if ...
void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
Returns a 3D object representing the map.
static CLogOddsGridMapLUT< cell_t > m_logodd_lut
Lookup tables for log-odds.
mrpt::maps::CReflectivityGridMap2D::TInsertionOptions insertionOpts
float l2p(const cell_t l)
Scales an integer representation of the log-odd into a real valued probability in [0...
unsigned __int32 uint32_t
void dyngridcommon_readFromStream(mrpt::utils::CStream &in, bool cast_from_float=false)
void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const MRPT_OVERRIDE
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >...
#define ASSERTMSG_(f, __ERROR_MSG)
static mrpt::maps::CMetricMap * internal_CreateFromMapDefinition(const mrpt::maps::TMetricMapInitializer &def)
GLenum const GLfloat * params
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) MRPT_OVERRIDE
This method load the options from a ".ini"-like file or memory-stored string list.
TInsertionOptions()
Default values loader.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
One static instance of this struct should exist in any class implementing CLogOddsGridMap2D to hold t...