1 #ifndef SLAM_CTOR_UTILS_INIT_OCCUPANCY_MAPPING_H 2 #define SLAM_CTOR_UTILS_INIT_OCCUPANCY_MAPPING_H 9 #include "../core/maps/grid_map.h" 10 #include "../core/maps/grid_map_scan_adders.h" 11 #include "../core/maps/area_occupancy_estimator.h" 12 #include "../core/maps/const_occupancy_estimator.h" 15 static const std::string Map_NS =
"slam/map/";
16 auto w = props.
get_dbl(Map_NS +
"height_in_meters", 10);
17 auto h = props.
get_dbl(Map_NS +
"width_in_meters", 10);
18 auto scale = props.
get_dbl(Map_NS +
"meters_per_cell", 0.1);
20 static_cast<int>(std::ceil(h / scale)),
28 static const std::string COE_NS =
"slam/occupancy_estimator/";
29 auto base_occ =
Occupancy{props.
get_dbl(COE_NS +
"base_occupied/prob", 0.95),
30 props.
get_dbl(COE_NS +
"base_occupied/qual", 1.0)};
32 props.
get_dbl(COE_NS +
"base_empty/qual", 1.0)};
34 auto type = props.
get_str(COE_NS +
"type",
"const");
35 if (type ==
"const") {
36 return std::make_shared<ConstOccupancyEstimator>(base_occ, base_empty);
37 }
else if (type ==
"area") {
38 return std::make_shared<AreaOccupancyEstimator>(base_occ, base_empty);
40 std::cerr <<
"Unknown estimator type: " << type << std::endl;
46 static const auto DBL_INF = std::numeric_limits<double>::infinity();
50 .set_blur_distance(props.
get_dbl(
"slam/mapping/blur", 0.0))
51 .set_max_usable_range(props.
get_dbl(
"slam/mapping/max_range",
virtual str get_str(const std::string &id, const str &dflt) const =0
auto init_scan_adder(const PropertiesProvider &props)
std::shared_ptr< CellOccupancyEstimator > init_occ_estimator(const PropertiesProvider &props)
virtual double get_dbl(const std::string &id, double dflt) const =0
static WallDistanceBlurringScanAdderBuilder builder()
auto init_grid_map_params(const PropertiesProvider &props)
TFSIMD_FORCE_INLINE const tfScalar & w() const