10 #include <gtest/gtest.h> 34 for (
size_t i = 0; i <
demo9_N; i++)
48 for (
size_t i = 0; i <
demo9_N; i++)
51 pts.getPoint(i, x, y, z);
67 for (
size_t i = 0; i <
demo9_N; i++)
71 pts2.getPoint(i, x2, y2, z2);
72 pts3.getPoint(i, x3, y3, z3);
89 pts.clipOutOfRangeInZ(-10, -1);
96 pts.clipOutOfRangeInZ(-10, 10);
103 pts.clipOutOfRangeInZ(0.5, 1.5);
117 const float radius = 0.5;
120 pts.clipOutOfRange(pivot, radius);
127 const float radius = 1;
130 pts.clipOutOfRange(pivot, radius);
137 const float radius = 1.1f;
140 pts.clipOutOfRange(pivot, radius);
153 auto lmb1 = [&]() -> std::string {
154 std::stringstream ss;
155 bool ret = pts0.save3D_to_text_stream(ss);
163 std::stringstream ss;
165 bool ret = pts1.load3D_from_text_stream(ss);
171 std::stringstream ss;
172 ss.str(
"0 1\n1 2\n 3 4\n");
173 bool ret = pts1.load2D_from_text_stream(ss);
180 std::stringstream ss;
181 ss.str(
"0 1\n1 2\n 3 4\n");
183 bool ret = pts1.load3D_from_text_stream(ss, errMsg);
189 std::stringstream ss;
190 ss.str(
"0 1 3\n1 2 3 4\n3 4\n");
192 bool ret = pts1.load3D_from_text_stream(ss, errMsg);
197 std::stringstream ss;
198 ss.str(
"0 1\n1 2 3 4\n3 4\n");
200 bool ret = pts1.load3D_from_text_stream(ss, errMsg);
205 TEST(CSimplePointsMapTests, insertPoints)
207 do_test_insertPoints<CSimplePointsMap>();
210 TEST(CWeightedPointsMapTests, insertPoints)
212 do_test_insertPoints<CWeightedPointsMap>();
215 TEST(CColouredPointsMapTests, insertPoints)
217 do_test_insertPoints<CColouredPointsMap>();
222 TEST(CSimplePointsMapTests, clipOutOfRangeInZ)
224 do_test_clipOutOfRangeInZ<CSimplePointsMap>();
227 TEST(CWeightedPointsMapTests, clipOutOfRangeInZ)
229 do_test_clipOutOfRangeInZ<CWeightedPointsMap>();
232 TEST(CColouredPointsMapTests, clipOutOfRangeInZ)
234 do_test_clipOutOfRangeInZ<CColouredPointsMap>();
237 TEST(CSimplePointsMapTests, clipOutOfRange)
239 do_test_clipOutOfRange<CSimplePointsMap>();
242 TEST(CWeightedPointsMapTests, clipOutOfRange)
244 do_test_clipOutOfRange<CWeightedPointsMap>();
247 TEST(CColouredPointsMapTests, clipOutOfRange)
249 do_test_clipOutOfRange<CColouredPointsMap>();
252 TEST(CSimplePointsMapTests, loadSaveStreams)
254 do_tests_loadSaveStreams<CSimplePointsMap>();
257 TEST(CWeightedPointsMapTests, loadSaveStreams)
259 do_tests_loadSaveStreams<CWeightedPointsMap>();
262 TEST(CColouredPointsMapTests, loadSaveStreams)
264 do_tests_loadSaveStreams<CColouredPointsMap>();
EXPECT_TRUE(mrpt::system::fileExists(ini_fil))
const float demo9_zs[demo9_N]
void do_test_clipOutOfRange()
void do_test_clipOutOfRangeInZ()
const float demo9_xs[demo9_N]
This base provides a set of functions for maths stuff.
This namespace contains representation of robot actions and observations.
const float demo9_ys[demo9_N]
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
void load_demo_9pts_map(MAP &pts)
void do_test_insertPoints()
A map of 3D points with reflectance/intensity (float).
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void do_tests_loadSaveStreams()
EXPECT_EQ(out.image_pair_was_used.size(), NUM_IMGS)
TEST(CSimplePointsMapTests, insertPoints)