7 #ifndef __GRID_SCAN_MATCHER_H 8 #define __GRID_SCAN_MATCHER_H 72 virtual double estimate_scan_cost(
const RobotState &pose,
87 _cost_estimator(estimator) {}
97 virtual double process_scan(
const RobotState &init_pose,
109 void subscribe(std::shared_ptr<GridScanMatcherObserver> obs) {
110 _observers.push_back(obs);
119 std::vector<std::weak_ptr<GridScanMatcherObserver>> new_observers;
121 auto obs_ptr = raw_obs.lock();
122 if (obs_ptr && obs_ptr != obs) {
123 new_observers.push_back(raw_obs);
126 _observers = new_observers;
132 return _cost_estimator;
136 std::vector<std::weak_ptr<GridScanMatcherObserver>> &
observers() {
140 std::vector<std::weak_ptr<GridScanMatcherObserver>>
_observers;
std::shared_ptr< ScanCostEstimator > cost_estimator()
Returns a pointer to the cost estimator.
virtual void on_matching_end(const RobotState &, double)
void subscribe(std::shared_ptr< GridScanMatcherObserver > obs)
An occupancy grid implementation.
GridScanMatcher(std::shared_ptr< ScanCostEstimator > estimator)
virtual void on_scan_test(const RobotState &, const TransformedLaserScan &, double)
virtual void on_matching_start(const RobotState &, const TransformedLaserScan &, const GridMap &)
Defines some structures related to data obtained from sensors. There are structures ScanPoint and Tra...
Class that matches scans. Performes a scan adjustment by altering a robot pose in order to maximize t...
virtual void on_pose_update(const RobotState &, const TransformedLaserScan &, double)
std::vector< std::weak_ptr< GridScanMatcherObserver > > & observers()
Returns a reference to the vector of pointers on observers.
std::vector< std::weak_ptr< GridScanMatcherObserver > > _observers
void unsubscribe(std::shared_ptr< GridScanMatcherObserver > obs)
Interface of scan matcher observer.
Defines a robot position in cartesian coordinates and an angle of rotation.
Defines some classes related to a robot state. There are classes RobotState and World.
virtual void reset_state()
Invoked to reset the scan matcher's state.
Interface of Estimator of Scan Cost. Cost - is a number that complies to a scan; the lower cost the b...
std::shared_ptr< ScanCostEstimator > _cost_estimator