ArVizDrawer.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 <pcl/point_cloud.h>
25 #include <pcl/point_types.h>
26 
27 #include <SimoxUtility/color/Color.h>
28 #include <VirtualRobot/VirtualRobot.h>
29 
31 
33 
35 {
36 
38  {
39  public:
40  using Points = std::vector<Eigen::Vector2f>;
41 
42  ArVizDrawer(armarx::viz::Client& arviz) : arviz(arviz)
43  {
44  }
45 
46  void draw(const std::vector<Features>& features,
47  const std::string& frame,
48  const Eigen::Isometry3f& globalSensorPose);
49 
51  const Eigen::Isometry3f& globalSensorPose,
52  const simox::Color& color);
53 
54  void draw(const std::string& layerName,
55  const Circle& circle,
56  const Eigen::Isometry3f& robotGlobalPose,
57  const simox::Color& color);
58 
59  void draw(const std::string& layerName,
60  const VirtualRobot::MathTools::ConvexHull2D& robotHull,
61  const Eigen::Isometry3f& robotGlobalPose,
62  const simox::Color& color = simox::Color::red(100, 80));
63 
64  private:
65  void drawCircles(const std::vector<Features>& features,
66  const std::string& frame,
67  const Eigen::Isometry3f& globalSensorPose);
68  void drawCircle(viz::Layer& layer,
69  const Circle& circle,
70  const Eigen::Isometry3f& globalSensorPose,
71  const simox::Color& color);
72 
73  void drawConvexHulls(const std::vector<Features>& features,
74  const std::string& frame,
75  const Eigen::Isometry3f& globalSensorPose);
76  void drawConvexHull(viz::Layer& layer,
77  const VirtualRobot::MathTools::ConvexHull2D& hull,
78  const Eigen::Isometry3f& globalSensorPose,
79  const simox::Color& color);
80 
81  void drawEllipsoids(const std::vector<Features>& features,
82  const std::string& frame,
83  const Eigen::Isometry3f& globalSensorPose);
84 
85  void drawEllipsoid(viz::Layer& layer,
86  const Ellipsoid& ellipsoid,
87  const Eigen::Isometry3f& globalSensorPose);
88 
89  void drawChains(const std::vector<Features>& features,
90  const std::string& frame,
91  const Eigen::Isometry3f& globalSensorPose);
92  void drawChain(viz::Layer& layer,
93  const Points& chain,
94  const Eigen::Isometry3f& globalSensorPose);
95 
96  armarx::viz::Client arviz;
97  };
98 } // namespace armarx::navigation::components::laser_scanner_feature_extraction
armarx::armem::laser_scans::LaserScanStamped
Definition: types.h:40
ScopedClient.h
armarx::navigation::components::laser_scanner_feature_extraction::ArVizDrawer::Points
std::vector< Eigen::Vector2f > Points
Definition: ArVizDrawer.h:40
FeatureExtractor.h
Color
uint32_t Color
RGBA color.
Definition: color.h:8
armarx::navigation::memory::Ellipsoid
Definition: types.h:34
armarx::navigation::memory::Circle
Definition: types.h:41
armarx::red
QColor red()
Definition: StyleSheets.h:76
armarx::navigation::components::laser_scanner_feature_extraction::ArVizDrawer::ArVizDrawer
ArVizDrawer(armarx::viz::Client &arviz)
Definition: ArVizDrawer.h:42
armarx::navigation::components::laser_scanner_feature_extraction::ArVizDrawer
Definition: ArVizDrawer.h:37
armarx::viz::Client
Definition: Client.h:109
armarx::navigation::components::laser_scanner_feature_extraction
Definition: ArVizDrawer.cpp:28
armarx::viz::Layer
Definition: Layer.h:12
armarx::navigation::components::laser_scanner_feature_extraction::ArVizDrawer::draw
void draw(const std::vector< Features > &features, const std::string &frame, const Eigen::Isometry3f &globalSensorPose)
Definition: ArVizDrawer.cpp:32