1 #ifndef SLAM_CTOR_SLAM_VINYX_WORLD_H 2 #define SLAM_CTOR_SLAM_VINYX_WORLD_H 14 #include "../../core/states/single_state_hypothesis_laser_scan_grid_world.h" 16 #include "../viny/viny_grid_cell.h" 18 #include "../../core/scan_matchers/m3rsm_engine.h" 19 #include "../../core/maps/rescalable_caching_grid_map.h" 20 #include "../../core/maps/lazy_tiled_grid_map.h" 24 std::unique_ptr<GridCell>
clone()
const override {
25 return std::make_unique<VinyXDSCell>(*this);
46 _hypotheses.push_back(
WorldT{props});
51 handle_observation(scan);
52 notify_with_pose(pose());
53 notify_with_map(map());
57 for (
auto &h : _hypotheses) {
58 h.update_robot_pose(delta);
64 return _hypotheses[0];
72 for (
auto &h : _hypotheses) {
74 h.handle_observation(obs);
87 auto spe = _props.gsm->scan_probability_estimator();
89 raw_scan.
scan, rescalable_map,
true);
91 unsigned peaks_nm = 0;
94 if (!best_match.is_valid()) {
97 if (best_match.is_finest()) {
99 if (max_prob == -1) { max_prob = p; }
101 if (p < max_prob * 0.97 || p < 0.5) {
107 auto drift_center = best_match.translation_drift.center();
110 if (1 < peaks_nm) { std::cout <<
"PEAKS NM: " << peaks_nm << std::endl; }
VinyXWorld(const Properties &props)
void set_translation_lookup_range(double max_x_error, double max_y_error)
void handle_observation(TransformedLaserScan &obs) override
std::vector< WorldT > _hypotheses
std::unique_ptr< GridCell > clone() const override
void set_rotation_lookup_range(double sector, double step)
Match next_best_match(double translation_step)
void update_robot_pose(const RobotPoseDelta &delta) override
const WorldT & world() const override
const RobotPose & pose() const override
void add_match(Match &&match)
void handle_sensor_data(TransformedLaserScan &scan) override
decltype(SPEParams{}.sp_analysis_area) Rect
void add_scan_matching_request(std::shared_ptr< ScanProbabilityEstimator > spe, const RobotPose &pose, const LaserScan2D &raw_scan, GridMap &map, bool prerotate_scan=false)
const GridMap & map(unsigned scale_id) const
const VinyXMapT & map() const override
void detect_peaks(const TransformedLaserScan &raw_scan)
double discrepancy(const AreaOccupancyObservation &aoo) const override