1 #ifndef SLAM_CTOR_CORE_POSE_ENUMERATION_SCAN_MATCHER_H 2 #define SLAM_CTOR_CORE_POSE_ENUMERATION_SCAN_MATCHER_H 16 std::shared_ptr<PoseEnumerator> pe)
36 obs->on_matching_start(init_pose, raw_scan, map);
39 auto best_pose = init_pose;
43 obs->on_scan_test(best_pose, scan, best_pose_prob);
44 obs->on_pose_update(best_pose, scan, best_pose_prob);
52 &sampled_scan_prob](
ObsPtr obs) {
53 obs->on_scan_test(sampled_pose, scan, sampled_scan_prob);
56 auto pose_is_acceptable = best_pose_prob < sampled_scan_prob;
58 if (!pose_is_acceptable) {
63 best_pose_prob = sampled_scan_prob;
64 best_pose = sampled_pose;
68 obs->on_pose_update(best_pose, scan, best_pose_prob);
72 pose_delta = best_pose - init_pose;
74 obs->on_matching_end(pose_delta, scan, best_pose_prob);
76 return best_pose_prob;
PoseEnumerationScanMatcher(std::shared_ptr< ScanProbabilityEstimator > spe, std::shared_ptr< PoseEnumerator > pe)
std::shared_ptr< GridScanMatcherObserver > ObsPtr
double process_scan(const TransformedLaserScan &raw_scan, const RobotPose &init_pose, const GridMap &map, RobotPoseDelta &pose_delta) override
std::shared_ptr< PoseEnumerator > _pose_enumerator
void reset_state() override
LaserScan2D filter_scan(const LaserScan2D &scan, const RobotPose &pose, const GridMap &map)
double scan_probability(const LaserScan2D &scan, const RobotPose &pose, const GridMap &map) const
void do_for_each_observer(std::function< void(ObsPtr)> op)
auto pose_enumerator() const
void set_pose_enumerator(std::shared_ptr< PoseEnumerator > pe)