tiny_scan_matcher.h
Go to the documentation of this file.
1 #ifndef __TINY_SCAN_MATCHER_H
2 #define __TINY_SCAN_MATCHER_H
3 
4 #include <random>
5 
6 #include "../core/monte_carlo_scan_matcher.h"
8 
16 private:
17  using ScePtr = std::shared_ptr<ScanCostEstimator>;
18 public:
28  TinyScanMatcher(ScePtr cost_estimator, unsigned bad_iter, unsigned max_iter,
29  double sigma_coord, double sigma_angle):
30  MonteCarloScanMatcher(cost_estimator, bad_iter, max_iter),
31  _sigma_coord(sigma_coord), _sigma_angle(sigma_angle),
33 
37  virtual void reset_state() override {
40  }
41 
42 protected:
43  virtual void sample_pose(RobotState &base_pose) override {
44  std::random_device rd;
45  std::mt19937 gen(rd());
46  std::normal_distribution<> d_coord(0.0, _curr_sigma_coord);
47  std::normal_distribution<> d_angle(0.0, _curr_sigma_angle);
48 
49  base_pose.x += d_coord(gen);
50  base_pose.y += d_coord(gen);
51  base_pose.theta += d_angle(gen);
52  }
53 
54  virtual unsigned on_estimate_update(unsigned sample_num,
55  unsigned sample_limit) override {
56  if (sample_num <= sample_limit / 3) {
57  return sample_num;
58  }
59 
60  _curr_sigma_coord *= 0.5;
61  _curr_sigma_angle *= 0.5;
62  return 0;
63  }
64 
65 private:
68 };
69 
70 #endif
virtual void sample_pose(RobotState &base_pose) override
double x
Definition: state_data.h:38
TinyScanMatcher(ScePtr cost_estimator, unsigned bad_iter, unsigned max_iter, double sigma_coord, double sigma_angle)
std::shared_ptr< ScanCostEstimator > cost_estimator()
Returns a pointer to the cost estimator.
virtual unsigned on_estimate_update(unsigned sample_num, unsigned sample_limit) override
virtual void reset_state() override
std::shared_ptr< ScanCostEstimator > ScePtr
double theta
The position of robot.
Definition: state_data.h:38
double y
Definition: state_data.h:38
Defines a robot position in cartesian coordinates and an angle of rotation.
Definition: state_data.h:14
The scan matcher based on the Monte Carlo simulation.
Scan Matcher based on the Monte Carlo method. The focus of the scan matcher is to compare a scan and ...


tiny_slam
Author(s):
autogenerated on Mon Jun 10 2019 15:30:57