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 
25 
27 {
28 
30  {
31  public:
32  FeatureMerger(std::vector<Features>&& features,
33  const ChainApproximation::Params& chainApproximationParams);
34  FeatureMerger(const std::vector<Features>& features,
35  const ChainApproximation::Params& chainApproximationParams);
36 
37  std::vector<Features> merge();
38 
39  public:
40  static bool insideConvexPoly(const Eigen::Vector2f& p,
41  const std::vector<Eigen::Vector2f>& vertices);
42 
43  private:
44  std::optional<std::size_t>
45  checkPoint(const Eigen::Vector2f p,
46  std::size_t ignore,
47  const std::optional<std::size_t> checkFirst = std::nullopt);
48  void addToFeature(Features& f, const Features& toAdd);
49  void recalculateFeatures(std::vector<Features>& features);
50 
51  private:
52  std::vector<Features> inputFeatures;
53  const ChainApproximation::Params chainApproximationParams;
54  };
55 
56 } // namespace armarx::navigation::components::laser_scanner_feature_extraction
armarx::detail::ChainApproximationParams
Definition: ChainApproximation.h:31
armarx::navigation::components::laser_scanner_feature_extraction::Features
Definition: FeatureExtractor.h:44
armarx::navigation::components::laser_scanner_feature_extraction::FeatureMerger
Definition: FeatureMerger.h:29
FeatureExtractor.h
armarx::navigation::components::laser_scanner_feature_extraction::FeatureMerger::merge
std::vector< Features > merge()
Definition: FeatureMerger.cpp:27
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:72
armarx::navigation::components::laser_scanner_feature_extraction::FeatureMerger::FeatureMerger
FeatureMerger(std::vector< Features > &&features, const ChainApproximation::Params &chainApproximationParams)
Definition: FeatureMerger.cpp:14
armarx::navigation::components::laser_scanner_feature_extraction
Definition: ArVizDrawer.cpp:28