brute_force_sm_smoke_test.cpp
Go to the documentation of this file.
1 #include <gtest/gtest.h>
2 
3 #include "../mock_grid_cell.h"
5 
6 #include "../../../src/core/scan_matchers/brute_force_scan_matcher.h"
7 #include "../../../src/core/scan_matchers/occupancy_observation_probability.h"
8 #include "../../../src/core/maps/plain_grid_map.h"
9 
10 // TODO: BruteForcePoseEnumeratorTest
11 
12 //------------------------------------------------------------------------------
13 // Smoke Tests Suite
14 // NB: the suit checks _fundamental_ abilities to find a correction.
15 
17  : public ScanMatcherTestBase<UnboundedPlainGridMap> {
18 
19  // TODO: remove duplication (hc-test, m3mrsm-test)
20 protected: // consts
21  // map params
22  static constexpr int Map_Width = 100;
23  static constexpr int Map_Height = 100;
24  static constexpr double Map_Scale = 0.1;
25 
26  // map patching params
27  static constexpr int Cecum_Patch_W = 15, Cecum_Patch_H = 13;
28  static constexpr int Patch_Scale = 1;
29 
30  // laser scanner params
31  static constexpr double LS_Max_Dist = 15;
32  static constexpr int LS_FoW = 270;
33  static constexpr int LS_Pts_Nm = 10;
34 
35  // scan matcher params
36  static constexpr double From_Translation = -0.5;
37  static constexpr double To_Translation = 0.5;
38  static constexpr double Step_Translation = 0.05;
39  static constexpr double From_Rotation = deg2rad(-10);
40  static constexpr double To_Rotation = deg2rad(10);
41  static constexpr double Step_Rotation = deg2rad(1);
42 protected: // type aliases
45  using SPW = EvenSPW;
46 protected: // methods
48  : ScanMatcherTestBase{std::make_shared<SPE>(std::make_shared<OOPE>(),
49  std::make_shared<SPW>()),
50  Map_Width, Map_Height, Map_Scale,
51  to_lsp(LS_Max_Dist, LS_FoW, LS_Pts_Nm)}
52  , _bfsm{spe,
55  From_Rotation, To_Rotation, Step_Rotation} {}
56 
57  GridScanMatcher& scan_matcher() override { return _bfsm; };
58 
60  using CecumMp = CecumTextRasterMapPrimitive;
61  auto bnd_pos = CecumMp::BoundPosition::Top;
62  auto cecum_mp = CecumMp{Cecum_Patch_W, Cecum_Patch_H, bnd_pos};
64 
66  (cecum_mp.width() * Patch_Scale / 2) * map.scale(),
67  (-cecum_mp.height() * Patch_Scale + 1) * map.scale(),
68  deg2rad(90)
69  };
70  }
71 
72 protected: // fields
74 };
75 
79 }
80 
81 TEST_F(BruteForceScanMatcherSmokeTest, cecumLinStepXLeftDrift) {
84 }
85 
86 TEST_F(BruteForceScanMatcherSmokeTest, cecumLinStepXRightDrift) {
89 }
90 
91 TEST_F(BruteForceScanMatcherSmokeTest, cecumLinStepYUpDrift) {
94 }
95 
96 TEST_F(BruteForceScanMatcherSmokeTest, cecumLinStepYDownDrift) {
99 }
100 
101 TEST_F(BruteForceScanMatcherSmokeTest, cecumAngStepThetaCcwDrift) {
104 }
105 
106 TEST_F(BruteForceScanMatcherSmokeTest, cecumAngStepThetaCwDrift) {
109 }
110 
111 TEST_F(BruteForceScanMatcherSmokeTest, cecumComboStepsDrift) {
114 }
115 
116 //----------------------------------------------------------------------------//
117 
118 int main (int argc, char *argv[]) {
119  ::testing::InitGoogleTest(&argc, argv);
120  return RUN_ALL_TESTS();
121 }
static constexpr auto to_lsp(double max_dist, double fow_deg, unsigned pts_nm)
GridScanMatcher & scan_matcher() override
int main(int argc, char *argv[])
void test_scan_matcher(const LaserScannerParams &lsp, const RobotPoseDelta &noise, const RobotPoseDelta &acc_error)
virtual void add_primitive_to_map(const TextRasterMapPrimitive &mp, const DiscretePoint2D &offset, int w_scale, int h_scale)
typename ScanMatcherTestBase< UnboundedPlainGridMap >::DefaultSPE SPE
TEST_F(BruteForceScanMatcherSmokeTest, cecumNoPoseNoise)
std::shared_ptr< ScanProbabilityEstimator > spe
constexpr double deg2rad(double angle_deg)
Definition: math_utils.h:56
virtual double scale() const


slam_constructor
Author(s): JetBrains Research, OSLL team
autogenerated on Mon Jun 10 2019 15:08:25