1 #ifndef __TINY_SCAN_COST_ESTIMATOR 2 #define __TINY_SCAN_COST_ESTIMATOR 4 #include "../core/grid_scan_matcher.h" 28 double min_cost)
override {
30 for (
const auto &sp : scan.
points) {
31 if (!sp.is_occupied) {
35 double x_world = pose.
x + sp.range * std::cos(sp.angle+pose.
theta);
36 double y_world = pose.
y + sp.range * std::sin(sp.angle+pose.
theta);
39 double cell_value = map.
cell_value(cell_coord);
40 cost += 1.0 - cell_value;
41 if (min_cost < cost) {
double cell_value(const DiscretePoint2D &cell_coord) const
An implementation of the scan cost function described in the original tinySLAM paper.
An occupancy grid implementation.
virtual double estimate_scan_cost(const RobotState &pose, const TransformedLaserScan &scan, const GridMap &map, double min_cost) override
double theta
The position of robot.
Defines a robot position in cartesian coordinates and an angle of rotation.
DiscretePoint2D world_to_cell(double x, double y) const
Defines a point with integer coordinates on a plane.
Interface of Estimator of Scan Cost. Cost - is a number that complies to a scan; the lower cost the b...