rotational_scan_matcher.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2016 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_ROTATIONAL_SCAN_MATCHER_H_
00018 #define CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_ROTATIONAL_SCAN_MATCHER_H_
00019 
00020 #include <vector>
00021 
00022 #include "Eigen/Geometry"
00023 #include "cartographer/sensor/point_cloud.h"
00024 
00025 namespace cartographer {
00026 namespace mapping {
00027 namespace scan_matching {
00028 
00029 class RotationalScanMatcher {
00030  public:
00031   // Rotates the given 'histogram' by the given 'angle'. This might lead to
00032   // rotations of a fractional bucket which is handled by linearly
00033   // interpolating.
00034   static Eigen::VectorXf RotateHistogram(const Eigen::VectorXf& histogram,
00035                                          float angle);
00036 
00037   // Computes the histogram for a gravity aligned 'point_cloud'.
00038   static Eigen::VectorXf ComputeHistogram(const sensor::PointCloud& point_cloud,
00039                                           int histogram_size);
00040 
00041   explicit RotationalScanMatcher(const Eigen::VectorXf* histogram);
00042 
00043   // Scores how well 'histogram' rotated by 'initial_angle' can be understood as
00044   // further rotated by certain 'angles' relative to the 'nodes'. Each angle
00045   // results in a score between 0 (worst) and 1 (best).
00046   std::vector<float> Match(const Eigen::VectorXf& histogram,
00047                            float initial_angle,
00048                            const std::vector<float>& angles) const;
00049 
00050  private:
00051   const Eigen::VectorXf* histogram_;
00052 };
00053 
00054 }  // namespace scan_matching
00055 }  // namespace mapping
00056 }  // namespace cartographer
00057 
00058 #endif  // CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_ROTATIONAL_SCAN_MATCHER_H_


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:36