1 #ifndef SLAM_CTOR_CORE_HILL_CLIMBING_SCAN_MATCHER_H 2 #define SLAM_CTOR_CORE_HILL_CLIMBING_SCAN_MATCHER_H 12 double rotation_delta)
39 assert(0 &&
"Missed shift destination");
41 *shiftee += shift_value;
44 return distorted_pose;
48 void feedback(
bool pose_is_acceptable)
override {}
53 static_assert(DimNm % 2 != DirNm % 2,
"");
63 template <
typename BasePoseEnumerator>
67 double translation_delta,
68 double rotation_delta)
69 : _max_failed_rounds{max_failed_rounds}
70 , _base_translation_delta{translation_delta}
71 , _base_rotation_delta{rotation_delta} {
76 return _failed_rounds < _max_failed_rounds;
80 if (!_round_pe.has_next()) {
88 return _round_pe.next(prev_pose);
99 void feedback(
bool pose_is_acceptable)
override {
100 _round_failed &= !pose_is_acceptable;
101 _round_pe.feedback(pose_is_acceptable);
105 void reset_round(
double translation_delta,
double rotation_delta) {
107 _round_failed =
true;
116 BasePoseEnumerator _round_pe{0, 0};
126 unsigned max_lookup_attempts_failed,
127 double translation_delta,
double rotation_delta)
130 std::make_shared<HCPE>(max_lookup_attempts_failed,
131 translation_delta, rotation_delta)
unsigned _max_failed_rounds
FailedRoundsLimitedPoseEnumerator(unsigned max_failed_rounds, double translation_delta, double rotation_delta)
double _translation_delta
void feedback(bool pose_is_acceptable) override
RobotPose next(const RobotPose &prev_pose) override
RobotPose next(const RobotPose &prev_pose) override
bool has_next() const override
void feedback(bool pose_is_acceptable) override
void reset_round(double translation_delta, double rotation_delta)
Distorsion1DPoseEnumerator(double translation_delta, double rotation_delta)
bool has_next() const override
double _base_translation_delta
double _translation_delta
HillClimbingScanMatcher(std::shared_ptr< ScanProbabilityEstimator > estimator, unsigned max_lookup_attempts_failed, double translation_delta, double rotation_delta)