rotational_scan_matcher.h
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 
17 #ifndef CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_ROTATIONAL_SCAN_MATCHER_H_
18 #define CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_ROTATIONAL_SCAN_MATCHER_H_
19 
20 #include <vector>
21 
22 #include "Eigen/Geometry"
24 
25 namespace cartographer {
26 namespace mapping {
27 namespace scan_matching {
28 
30  public:
31  // Computes the histogram for a gravity aligned 'point_cloud'.
32  static Eigen::VectorXf ComputeHistogram(const sensor::PointCloud& point_cloud,
33  int histogram_size);
34 
35  // Creates a matcher from the given histograms rotated by the given angles.
36  // The angles should be chosen to bring the histograms into approximately the
37  // same frame.
38  explicit RotationalScanMatcher(
39  const std::vector<std::pair<Eigen::VectorXf, float>>&
40  histograms_at_angles);
41 
42  // Scores how well 'histogram' rotated by 'initial_angle' can be understood as
43  // further rotated by certain 'angles' relative to the 'nodes'. Each angle
44  // results in a score between 0 (worst) and 1 (best).
45  std::vector<float> Match(const Eigen::VectorXf& histogram,
46  float initial_angle,
47  const std::vector<float>& angles) const;
48 
49  private:
50  Eigen::VectorXf histogram_;
51 };
52 
53 } // namespace scan_matching
54 } // namespace mapping
55 } // namespace cartographer
56 
57 #endif // CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_ROTATIONAL_SCAN_MATCHER_H_
std::vector< float > Match(const Eigen::VectorXf &histogram, float initial_angle, const std::vector< float > &angles) const
std::vector< Eigen::Vector3f > PointCloud
Definition: point_cloud.h:32
static Eigen::VectorXf ComputeHistogram(const sensor::PointCloud &point_cloud, int histogram_size)
RotationalScanMatcher(const std::vector< std::pair< Eigen::VectorXf, float >> &histograms_at_angles)


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