11 #include <gtest/gtest.h> 13 TEST(CRandomFieldGridMap3D, insertCheckMapBounds)
22 grid3d.
setSize(-4.0,4.0, 0.0, 4.0, 0.0,4.0, 1.0 );
24 const double val = 10.0, var = 1.0;
43 TEST(CRandomFieldGridMap3D, insertPointsAndRead)
51 grid3d.
setSize(-4.0, 4.0, 0.0, 4.0, 0.0, 4.0, 1.0 );
53 const double val = 55.0, var = 1.0;
61 const double map_value = grid3d.
cellByPos(2.0, 3.0, 1.0)->mean_value;
62 EXPECT_NEAR(map_value,
val, 1e-6);
68 const double map_value = grid3d.
cellByPos(2.0, 3.0, 1.0)->mean_value;
69 EXPECT_NEAR(map_value,
val, 1e-6);
bool GMRF_skip_variance
(Default:false) Skip the computation of the variance, just compute the mean
T * cellByPos(double x, double y, double z)
Returns a pointer to the contents of a voxel given by its coordinates, or NULL if it is out of the ma...
The contents of each voxel in a CRandomFieldGridMap3D map.
virtual void resize(double new_x_min, double new_x_max, double new_y_min, double new_y_max, double new_z_min, double new_z_max, const TRandomFieldVoxel &defaultValueNewvoxels, double additionalMarginMeters=2.0) MRPT_OVERRIDE
Changes the size of the grid, maintaining previous contents.
bool saveAsCSV(const std::string &filName_mean, const std::string &filName_stddev=std::string()) const
Save the current estimated mean values to a CSV file (compatible with Paraview) with fields x y z mea...
CRandomFieldGridMap3D represents a 3D regular grid where each voxel is associated one real-valued pro...
TEST(CRandomFieldGridMap3D, insertCheckMapBounds)
virtual void setSize(const double x_min, const double x_max, const double y_min, const double y_max, const double z_min, const double z_max, const double resolution_xy, const double resolution_z=-1.0, const TRandomFieldVoxel *fill_value=NULL) MRPT_OVERRIDE
Changes the size of the grid, erasing previous contents.If resolution_z<0, the same resolution will b...
TVoxelInterpolationMethod
bool saveAsVtkStructuredGrid(const std::string &fil) const
Save the current estimated grid to a VTK file (.vts) as a "structured grid".
bool insertIndividualReading(const double sensorReading, const double sensorVariance, const mrpt::math::TPoint3D &point, const TVoxelInterpolationMethod method, const bool update_map)
Direct update of the map with a reading in a given position of the map.
void updateMapEstimation()
Run the method-specific procedure required to ensure that the mean & variances are up-to-date with al...
TInsertionOptions insertionOptions