init_tiny_slam.h
Go to the documentation of this file.
1 #ifndef SLAM_CTOR_SLAMS_TINY_SLAM_H
2 #define SLAM_CTOR_SLAMS_TINY_SLAM_H
3 
4 #include <iostream>
5 #include <memory>
6 
7 #include "../../utils/init_scan_matching.h"
8 #include "../../utils/init_occupancy_mapping.h"
9 
10 #include "../../core/maps/plain_grid_map.h"
11 #include "../../core/states/single_state_hypothesis_laser_scan_grid_world.h"
12 
13 #include "tiny_grid_cell.h"
14 
16 
19  auto cell_type = props.get_str("slam/cell/type", "avg");
20 
21  if (cell_type == "base") {
22  // FIXME: move to params
23  sg_props.localized_scan_quality = 0.2;
24  sg_props.raw_scan_quality = 0.1;
25  sg_props.cell_prototype = std::make_shared<BaseTinyCell>();
26  } else if (cell_type == "avg") {
27  // FIXME: move to params
28  sg_props.localized_scan_quality = 0.9;
29  sg_props.raw_scan_quality = 0.6;
30  sg_props.cell_prototype = std::make_shared<AvgTinyCell>();
31  } else {
32  std::cerr << "Unknown cell type: " << cell_type << std::endl;
33  std::exit(-1);
34  }
35 }
36 
37 // FIXME: ~code duplication init_viny_slam.cpp
38 auto init_tiny_slam(const PropertiesProvider &props) {
39  auto slam_props = SingleStateHypothesisLSGWProperties{};
40  setup_tiny_cell_prototype(props, slam_props);
41 
42  slam_props.gsm = init_scan_matcher(props);
43  slam_props.gmsa = init_scan_adder(props);
44  slam_props.map_props = init_grid_map_params(props);
45  return std::make_shared<TinySlam>(slam_props);
46 }
47 
48 #endif
virtual str get_str(const std::string &id, const str &dflt) const =0
auto init_scan_adder(const PropertiesProvider &props)
auto init_tiny_slam(const PropertiesProvider &props)
auto init_grid_map_params(const PropertiesProvider &props)
auto init_scan_matcher(const PropertiesProvider &props)
void setup_tiny_cell_prototype(const PropertiesProvider &props, SingleStateHypothesisLSGWProperties &sg_props)


slam_constructor
Author(s): JetBrains Research, OSLL team
autogenerated on Mon Jun 10 2019 15:08:25