hill_climbing_sm_smoke_test.cpp
Go to the documentation of this file.
1 #include <gtest/gtest.h>
2 
3 #include <limits>
4 
5 #include "../mock_grid_cell.h"
7 
8 #include "../../../src/core/scan_matchers/hill_climbing_scan_matcher.h"
9 #include "../../../src/core/scan_matchers/occupancy_observation_probability.h"
10 #include "../../../src/core/maps/plain_grid_map.h"
11 
12 //------------------------------------------------------------------------------
13 // Smoke Tests Suite
14 // NB: the suit checks _fundamental_ abilities to find a correction.
15 
17  : public ScanMatcherTestBase<UnboundedPlainGridMap> {
18 protected: // consts
19  // map params
20  static constexpr int Map_Width = 100;
21  static constexpr int Map_Height = 100;
22  static constexpr double Map_Scale = 0.1;
23 
24  // map patching params
25  static constexpr int Cecum_Patch_W = 15, Cecum_Patch_H = 13;
26  static constexpr int Patch_Scale = 1;
27 
28  // laser scanner params
29  static constexpr double LS_Max_Dist = 15;
30  static constexpr int LS_FoW = 270;
31  static constexpr int LS_Pts_Nm = 10;
32 
33  // scan matcher params
34  static constexpr int Max_SM_Shirnks_Nm = 10;
35  static constexpr double Init_Lin_Step = 0.1;
36  static constexpr double Init_Ang_Step = deg2rad(30);
37 protected: // type aliases
40  using SPW = EvenSPW;
41 protected: // methods
43  : ScanMatcherTestBase{std::make_shared<SPE>(std::make_shared<OOPE>(),
44  std::make_shared<SPW>()),
45  Map_Width, Map_Height, Map_Scale,
46  to_lsp(LS_Max_Dist, LS_FoW, LS_Pts_Nm)}
47  , _hcsm{spe, Max_SM_Shirnks_Nm, Init_Lin_Step, Init_Ang_Step} {}
48 
49  GridScanMatcher& scan_matcher() override { return _hcsm; };
50 
52  using CecumMp = CecumTextRasterMapPrimitive;
53  auto bnd_pos = CecumMp::BoundPosition::Top;
54  auto cecum_mp = CecumMp{Cecum_Patch_W, Cecum_Patch_H, bnd_pos};
56 
58  (cecum_mp.width() * Patch_Scale / 2) * map.scale(),
59  (-cecum_mp.height() * Patch_Scale + 1) * map.scale(),
60  deg2rad(90)
61  };
62  }
63 
64 protected: // fields
66 };
67 
71 }
72 
73 TEST_F(HillClimbingScanMatcherSmokeTest, cecumLinStepXLeftDrift) {
76 }
77 
78 TEST_F(HillClimbingScanMatcherSmokeTest, cecumLinStepXRightDrift) {
81 }
82 
83 TEST_F(HillClimbingScanMatcherSmokeTest, cecumLinStepYUpDrift) {
86 }
87 
88 TEST_F(HillClimbingScanMatcherSmokeTest, cecumLinStepYDownDrift) {
91 }
92 
93 TEST_F(HillClimbingScanMatcherSmokeTest, cecumAngStepThetaCcwDrift) {
96 }
97 
98 TEST_F(HillClimbingScanMatcherSmokeTest, cecumAngStepThetaCwDrift) {
101 }
102 
103 /* FIXME: looks like the method itself should be fixed.
104 TEST_F(HillClimbingScanMatcherSmokeTest, cecumComboStepsDrift) {
105  init_pose_facing_top_cecum_bound();
106  test_scan_matcher({Init_Lin_Step, -Init_Lin_Step, Init_Ang_Step});
107 }
108 */
109 
110 //------------------------------------------------------------------------------
111 
112 // TODO: More sophisticated testing (e.g. an arbitrary noise cases,
113 // high res map/scanner, map state, etc.) is supposed to be implemented
114 // with a separate test suite.
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)
typename ScanMatcherTestBase< UnboundedPlainGridMap >::DefaultSPE SPE
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)
TEST_F(HillClimbingScanMatcherSmokeTest, cecumNoPoseNoise)
std::shared_ptr< ScanProbabilityEstimator > spe
constexpr double deg2rad(double angle_deg)
Definition: math_utils.h:56
int main(int argc, char *argv[])
virtual double scale() const


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