ScanClustering.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 Fabian Reister ( fabian dot reister at 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 <RobotAPI/interface/units/LaserScannerUnit.h>
25 
27 {
28  namespace detail
29  {
31  {
32  // Clustering options to decide whether a point belongs to the cluster
33  float distanceThreshold; // [mm]
34  float angleThreshold; // [rad]
35 
36  /// Range filter: only consider points that are closer than maxDistance
37  float maxDistance; // [mm]
38  };
39  } // namespace detail
40 
42  {
43  public:
45  using Clusters = std::vector<LaserScan>;
46 
47  ScanClustering(const Params& params);
48 
49  /**
50  * @brief Performs cluster detection on a full laser scan.
51  *
52  * @param scan A full scan
53  * @return The input scan split into clusters.
54  */
55  Clusters detectClusters(const LaserScan& scan);
56 
57  protected:
58  const LaserScan& cluster() const;
59 
60  bool add(const LaserScanStep& scanStep);
61  bool supports(const LaserScanStep& scanStep);
62 
63  void clear();
64 
65  private:
66  LaserScan scan;
67 
68  const Params params;
69  };
70 
71 } // namespace armarx::navigation::components::laser_scanner_feature_extraction
armarx::navigation::components::laser_scanner_feature_extraction::detail::ScanClusteringParams
Definition: ScanClustering.h:30
detail
Definition: OpenCVUtil.cpp:127
armarx::navigation::components::laser_scanner_feature_extraction::ScanClustering::ScanClustering
ScanClustering(const Params &params)
Definition: ScanClustering.cpp:7
armarx::navigation::components::laser_scanner_feature_extraction::ScanClustering::detectClusters
Clusters detectClusters(const LaserScan &scan)
Performs cluster detection on a full laser scan.
Definition: ScanClustering.cpp:30
armarx::navigation::components::laser_scanner_feature_extraction::ScanClustering::cluster
const LaserScan & cluster() const
Definition: ScanClustering.cpp:56
armarx::navigation::components::laser_scanner_feature_extraction::ScanClustering::clear
void clear()
Definition: ScanClustering.cpp:62
armarx::navigation::components::laser_scanner_feature_extraction::ScanClustering::supports
bool supports(const LaserScanStep &scanStep)
Definition: ScanClustering.cpp:68
armarx::navigation::components::laser_scanner_feature_extraction::ScanClustering
Definition: ScanClustering.h:41
armarx::navigation::components::laser_scanner_feature_extraction::detail::ScanClusteringParams::angleThreshold
float angleThreshold
Definition: ScanClustering.h:34
armarx::navigation::components::laser_scanner_feature_extraction::ScanClustering::Clusters
std::vector< LaserScan > Clusters
Definition: ScanClustering.h:45
armarx::navigation::components::laser_scanner_feature_extraction::detail::ScanClusteringParams::distanceThreshold
float distanceThreshold
Definition: ScanClustering.h:33
armarx::navigation::components::laser_scanner_feature_extraction::ScanClustering::add
bool add(const LaserScanStep &scanStep)
Definition: ScanClustering.cpp:12
armarx::navigation::components::laser_scanner_feature_extraction
Definition: ArVizDrawer.cpp:28
armarx::navigation::components::laser_scanner_feature_extraction::detail::ScanClusteringParams::maxDistance
float maxDistance
Range filter: only consider points that are closer than maxDistance.
Definition: ScanClustering.h:37