FeatureMerger.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Tobias Gröger ( tobias dot groeger at student dot kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <cstddef>
25 #include <optional>
26 #include <vector>
27 
30 
32 {
33 
35  {
36  public:
37  FeatureMerger(std::vector<Features>&& features,
38  const ChainApproximation::Params& chainApproximationParams);
39  FeatureMerger(const std::vector<Features>& features,
40  const ChainApproximation::Params& chainApproximationParams);
41 
42  std::vector<Features> merge();
43 
44  public:
45  static bool insideConvexPoly(const Eigen::Vector2f& p,
46  const std::vector<Eigen::Vector2f>& vertices);
47 
48  private:
49  std::optional<std::size_t>
50  checkPoint(const Eigen::Vector2f p,
51  std::size_t ignore,
52  const std::optional<std::size_t> checkFirst = std::nullopt);
53  void addToFeature(Features& f, const Features& toAdd);
54  void recalculateFeatures(std::vector<Features>& features);
55 
56  private:
57  std::vector<Features> inputFeatures;
58  const ChainApproximation::Params chainApproximationParams;
59  };
60 
61 } // namespace armarx::navigation::components::laser_scanner_feature_extraction
armarx::detail::ChainApproximationParams
Definition: ChainApproximation.h:34
armarx::navigation::components::laser_scanner_feature_extraction::Features
Definition: FeatureExtractor.h:42
armarx::navigation::components::laser_scanner_feature_extraction::FeatureMerger
Definition: FeatureMerger.h:34
FeatureExtractor.h
armarx::navigation::components::laser_scanner_feature_extraction::FeatureMerger::merge
std::vector< Features > merge()
Definition: FeatureMerger.cpp:34
ChainApproximation.h
armarx::navigation::components::laser_scanner_feature_extraction::FeatureMerger::insideConvexPoly
static bool insideConvexPoly(const Eigen::Vector2f &p, const std::vector< Eigen::Vector2f > &vertices)
Definition: FeatureMerger.cpp:79
armarx::navigation::components::laser_scanner_feature_extraction::FeatureMerger::FeatureMerger
FeatureMerger(std::vector< Features > &&features, const ChainApproximation::Params &chainApproximationParams)
Definition: FeatureMerger.cpp:21
armarx::navigation::components::laser_scanner_feature_extraction
Definition: ArVizDrawer.cpp:28