25 #ifndef CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_FAST_CORRELATIVE_SCAN_MATCHER_2D_H_ 26 #define CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_FAST_CORRELATIVE_SCAN_MATCHER_2D_H_ 35 #include "cartographer/mapping/proto/scan_matching/fast_correlative_scan_matcher_options_2d.pb.h" 40 namespace scan_matching {
42 proto::FastCorrelativeScanMatcherOptions2D
44 common::LuaParameterDictionary* parameter_dictionary);
52 std::vector<float>* reusable_intermediate_grid);
56 int GetValue(
const Eigen::Array2i& xy_index)
const {
57 const Eigen::Array2i local_xy_index = xy_index -
offset_;
63 if (static_cast<unsigned>(local_xy_index.x()) >=
65 static_cast<unsigned>(local_xy_index.y()) >=
70 return cells_[local_xy_index.x() + local_xy_index.y() * stride];
99 const proto::FastCorrelativeScanMatcherOptions2D& options);
102 return precomputation_grids_[index];
105 int max_depth()
const {
return precomputation_grids_.size() - 1; }
116 const proto::FastCorrelativeScanMatcherOptions2D& options);
142 bool MatchWithSearchParameters(
147 std::vector<Candidate2D> ComputeLowestResolutionCandidates(
148 const std::vector<DiscreteScan2D>& discrete_scans,
150 std::vector<Candidate2D> GenerateLowestResolutionCandidates(
153 const std::vector<DiscreteScan2D>& discrete_scans,
155 std::vector<Candidate2D>*
const candidates)
const;
156 Candidate2D BranchAndBound(
const std::vector<DiscreteScan2D>& discrete_scans,
158 const std::vector<Candidate2D>& candidates,
159 int candidate_depth,
float min_score)
const;
161 const proto::FastCorrelativeScanMatcherOptions2D
options_;
170 #endif // CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_FAST_CORRELATIVE_SCAN_MATCHER_2D_H_ const PrecomputationGrid2D & Get(int index)
float ToScore(float value) const
proto::FastCorrelativeScanMatcherOptions2D CreateFastCorrelativeScanMatcherOptions2D(common::LuaParameterDictionary *const parameter_dictionary)
const CellLimits wide_limits_
const proto::FastCorrelativeScanMatcherOptions2D options_
std::vector< uint8 > cells_
int GetValue(const Eigen::Array2i &xy_index) const
std::vector< Eigen::Vector3f > PointCloud
PrecomputationGrid2D(const Grid2D &grid, const CellLimits &limits, int width, std::vector< float > *reusable_intermediate_grid)
const Eigen::Array2i offset_
std::vector< PrecomputationGrid2D > precomputation_grids_
uint8 ComputeCellValue(float probability) const
std::unique_ptr< PrecomputationGridStack2D > precomputation_grid_stack_