low_resolution_matcher.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 namespace cartographer {
20 namespace mapping {
21 namespace scan_matching {
22 
23 std::function<float(const transform::Rigid3f&)> CreateLowResolutionMatcher(
24  const HybridGrid* low_resolution_grid, const sensor::PointCloud* points) {
25  return [=](const transform::Rigid3f& pose) {
26  float score = 0.f;
27  for (const Eigen::Vector3f& point :
29  // TODO(zhengj, whess): Interpolate the Grid to get better score.
30  score += low_resolution_grid->GetProbability(
31  low_resolution_grid->GetCellIndex(point));
32  }
33  return score / points->size();
34  };
35 }
36 
37 } // namespace scan_matching
38 } // namespace mapping
39 } // namespace cartographer
PointCloud TransformPointCloud(const PointCloud &point_cloud, const transform::Rigid3f &transform)
Definition: point_cloud.cc:25
std::function< float(const transform::Rigid3f &)> CreateLowResolutionMatcher(const HybridGrid *low_resolution_grid, const sensor::PointCloud *points)
float GetProbability(const Eigen::Array3i &index) const
Definition: hybrid_grid.h:521
std::vector< Eigen::Vector3f > PointCloud
Definition: point_cloud.h:32
Eigen::Array3i GetCellIndex(const Eigen::Vector3f &point) const
Definition: hybrid_grid.h:428
transform::Rigid3d pose


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58