10 #include <CTraitsTest.h> 11 #include <gtest/gtest.h> 21 template class mrpt::CTraitsTest<CPose3DPDFGrid>;
33 const double res_xyz = 0.25;
38 grid.uniformDistribution();
40 auto [COV, MEAN] = grid.getCovarianceAndMean();
42 EXPECT_NEAR(MEAN.x(), gt_mean.x, 1e-4);
43 EXPECT_NEAR(MEAN.y(), gt_mean.y, 1e-4);
44 EXPECT_NEAR(MEAN.z(), gt_mean.z, 1e-4);
46 EXPECT_NEAR(MEAN.yaw(), gt_mean.yaw, 1e-4);
47 EXPECT_NEAR(MEAN.pitch(), gt_mean.pitch, 1e-4);
48 EXPECT_NEAR(MEAN.roll(), gt_mean.roll, 1e-4);
50 for (
int i = 0; i < 3; i++) EXPECT_GT(COV(i, i),
mrpt::square(0.25));
51 for (
int i = 4; i < 6; i++)
60 const double res_xyz = 0.25;
67 *grid.getByPos(gt_mean) = .1;
71 auto [COV, MEAN] = grid.getCovarianceAndMean();
73 EXPECT_NEAR(MEAN.x(), gt_mean.x, 0.2);
74 EXPECT_NEAR(MEAN.y(), gt_mean.y, 0.2);
75 EXPECT_NEAR(MEAN.z(), gt_mean.z, 0.2);
77 EXPECT_NEAR(MEAN.yaw(), gt_mean.yaw, 0.1);
78 EXPECT_NEAR(MEAN.pitch(), gt_mean.pitch, 0.1);
79 EXPECT_NEAR(MEAN.roll(), gt_mean.roll, 0.1);
81 for (
int i = 0; i < 6; i++) EXPECT_LT(COV(i, i),
mrpt::square(0.05));
double DEG2RAD(const double x)
Degrees to radians.
T square(const T x)
Inline function for the square of a number.
This base provides a set of functions for maths stuff.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Declares a class that represents a Probability Distribution function (PDF) of a SE(3) pose (x...
TEST(CPose3DPDFGrid, uniformDistribution)